-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-8925] [MLlib] Add @since tags to mllib.util #7436
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
b7a8ae8
Adding the annotation since
201e0fd
resubmitting
sthota2014 902d49b
pulled @deprecated outside of comment block
sthota2014 865149c
removed space and deprecated kept the annotation
sthota2014 5eece6e
remove one more space found
sthota2014 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -64,6 +64,7 @@ object MLUtils { | |
| * feature dimensions. | ||
| * @param minPartitions min number of partitions | ||
| * @return labeled data stored as an RDD[LabeledPoint] | ||
| * @since 1.0.0 | ||
| */ | ||
| def loadLibSVMFile( | ||
| sc: SparkContext, | ||
|
|
@@ -113,7 +114,10 @@ object MLUtils { | |
| } | ||
|
|
||
| // Convenient methods for `loadLibSVMFile`. | ||
|
|
||
|
|
||
| /** | ||
| * @since 1.0.0 | ||
| */ | ||
| @deprecated("use method without multiclass argument, which no longer has effect", "1.1.0") | ||
| def loadLibSVMFile( | ||
| sc: SparkContext, | ||
|
|
@@ -126,13 +130,17 @@ object MLUtils { | |
| /** | ||
| * Loads labeled data in the LIBSVM format into an RDD[LabeledPoint], with the default number of | ||
| * partitions. | ||
| * @since 1.0.0 | ||
| */ | ||
| def loadLibSVMFile( | ||
| sc: SparkContext, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We still need to keep this as an annotation. We should keep each PR minimal, so please keep all |
||
| path: String, | ||
| numFeatures: Int): RDD[LabeledPoint] = | ||
| loadLibSVMFile(sc, path, numFeatures, sc.defaultMinPartitions) | ||
|
|
||
| /** | ||
| * @since 1.0.0 | ||
| */ | ||
| @deprecated("use method without multiclass argument, which no longer has effect", "1.1.0") | ||
| def loadLibSVMFile( | ||
| sc: SparkContext, | ||
|
|
@@ -141,6 +149,9 @@ object MLUtils { | |
| numFeatures: Int): RDD[LabeledPoint] = | ||
| loadLibSVMFile(sc, path, numFeatures) | ||
|
|
||
| /** | ||
| * @since 1.0.0 | ||
| */ | ||
| @deprecated("use method without multiclass argument, which no longer has effect", "1.1.0") | ||
| def loadLibSVMFile( | ||
| sc: SparkContext, | ||
|
|
@@ -151,6 +162,7 @@ object MLUtils { | |
| /** | ||
| * Loads binary labeled data in the LIBSVM format into an RDD[LabeledPoint], with number of | ||
| * features determined automatically and the default number of partitions. | ||
| * @since 1.0.0 | ||
| */ | ||
| def loadLibSVMFile(sc: SparkContext, path: String): RDD[LabeledPoint] = | ||
| loadLibSVMFile(sc, path, -1) | ||
|
|
@@ -181,12 +193,14 @@ object MLUtils { | |
| * @param path file or directory path in any Hadoop-supported file system URI | ||
| * @param minPartitions min number of partitions | ||
| * @return vectors stored as an RDD[Vector] | ||
| * @since 1.1.0 | ||
| */ | ||
| def loadVectors(sc: SparkContext, path: String, minPartitions: Int): RDD[Vector] = | ||
| sc.textFile(path, minPartitions).map(Vectors.parse) | ||
|
|
||
| /** | ||
| * Loads vectors saved using `RDD[Vector].saveAsTextFile` with the default number of partitions. | ||
| * @since 1.1.0 | ||
| */ | ||
| def loadVectors(sc: SparkContext, path: String): RDD[Vector] = | ||
| sc.textFile(path, sc.defaultMinPartitions).map(Vectors.parse) | ||
|
|
@@ -197,13 +211,15 @@ object MLUtils { | |
| * @param path file or directory path in any Hadoop-supported file system URI | ||
| * @param minPartitions min number of partitions | ||
| * @return labeled points stored as an RDD[LabeledPoint] | ||
| * @since 1.1.0 | ||
| */ | ||
| def loadLabeledPoints(sc: SparkContext, path: String, minPartitions: Int): RDD[LabeledPoint] = | ||
| sc.textFile(path, minPartitions).map(LabeledPoint.parse) | ||
|
|
||
| /** | ||
| * Loads labeled points saved using `RDD[LabeledPoint].saveAsTextFile` with the default number of | ||
| * partitions. | ||
| * @since 1.1.0 | ||
| */ | ||
| def loadLabeledPoints(sc: SparkContext, dir: String): RDD[LabeledPoint] = | ||
| loadLabeledPoints(sc, dir, sc.defaultMinPartitions) | ||
|
|
@@ -220,6 +236,7 @@ object MLUtils { | |
| * | ||
| * @deprecated Should use [[org.apache.spark.rdd.RDD#saveAsTextFile]] for saving and | ||
| * [[org.apache.spark.mllib.util.MLUtils#loadLabeledPoints]] for loading. | ||
| * @since 1.0.0 | ||
| */ | ||
| @deprecated("Should use MLUtils.loadLabeledPoints instead.", "1.0.1") | ||
| def loadLabeledData(sc: SparkContext, dir: String): RDD[LabeledPoint] = { | ||
|
|
@@ -241,6 +258,7 @@ object MLUtils { | |
| * | ||
| * @deprecated Should use [[org.apache.spark.rdd.RDD#saveAsTextFile]] for saving and | ||
| * [[org.apache.spark.mllib.util.MLUtils#loadLabeledPoints]] for loading. | ||
| * @since 1.0.0 | ||
| */ | ||
| @deprecated("Should use RDD[LabeledPoint].saveAsTextFile instead.", "1.0.1") | ||
| def saveLabeledData(data: RDD[LabeledPoint], dir: String) { | ||
|
|
@@ -253,6 +271,7 @@ object MLUtils { | |
| * Return a k element array of pairs of RDDs with the first element of each pair | ||
| * containing the training data, a complement of the validation data and the second | ||
| * element, the validation data, containing a unique 1/kth of the data. Where k=numFolds. | ||
| * @since 1.0.0 | ||
| */ | ||
| @Experimental | ||
| def kFold[T: ClassTag](rdd: RDD[T], numFolds: Int, seed: Int): Array[(RDD[T], RDD[T])] = { | ||
|
|
@@ -268,6 +287,7 @@ object MLUtils { | |
|
|
||
| /** | ||
| * Returns a new vector with `1.0` (bias) appended to the input vector. | ||
| * @since 1.0.0 | ||
| */ | ||
| def appendBias(vector: Vector): Vector = { | ||
| vector match { | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need to leave the
@deprecatedoutside the JavaDoc as a Scala annotation to make it work in Scala.