Skip to content

Commit 6d97fe6

Browse files
committed
add AlphaComponent annotation
1 parent 731f0e4 commit 6d97fe6

File tree

13 files changed

+57
-0
lines changed

13 files changed

+57
-0
lines changed

mllib/src/main/scala/org/apache/spark/ml/Estimator.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,16 @@ package org.apache.spark.ml
2020
import scala.annotation.varargs
2121
import scala.collection.JavaConverters._
2222

23+
import org.apache.spark.annotation.AlphaComponent
2324
import org.apache.spark.ml.param.{ParamMap, ParamPair, Params}
2425
import org.apache.spark.sql.SchemaRDD
2526
import org.apache.spark.sql.api.java.JavaSchemaRDD
2627

2728
/**
29+
* :: AlphaComponent ::
2830
* Abstract class for estimators that fit models to data.
2931
*/
32+
@AlphaComponent
3033
abstract class Estimator[M <: Model[M]] extends PipelineStage with Params {
3134

3235
/**

mllib/src/main/scala/org/apache/spark/ml/Evaluator.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,15 @@
1717

1818
package org.apache.spark.ml
1919

20+
import org.apache.spark.annotation.AlphaComponent
2021
import org.apache.spark.ml.param.ParamMap
2122
import org.apache.spark.sql.SchemaRDD
2223

2324
/**
25+
* :: AlphaComponent ::
2426
* Abstract class for evaluators that compute metrics from predictions.
2527
*/
28+
@AlphaComponent
2629
abstract class Evaluator extends Identifiable {
2730

2831
/**

mllib/src/main/scala/org/apache/spark/ml/Identifiable.scala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,13 @@ package org.apache.spark.ml
1919

2020
import java.util.UUID
2121

22+
import org.apache.spark.annotation.AlphaComponent
23+
2224
/**
25+
* :: AlphaComponent ::
2326
* Object with a unique id.
2427
*/
28+
@AlphaComponent
2529
trait Identifiable extends Serializable {
2630

2731
/**

mllib/src/main/scala/org/apache/spark/ml/Model.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,16 @@
1717

1818
package org.apache.spark.ml
1919

20+
import org.apache.spark.annotation.AlphaComponent
2021
import org.apache.spark.ml.param.ParamMap
2122

2223
/**
24+
* :: AlphaComponent ::
2325
* A fitted model, i.e., a [[Transformer]] produced by an [[Estimator]].
2426
*
2527
* @tparam M model type
2628
*/
29+
@AlphaComponent
2730
abstract class Model[M <: Model[M]] extends Transformer {
2831
/**
2932
* The parent estimator that produced this model.

mllib/src/main/scala/org/apache/spark/ml/Pipeline.scala

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,15 @@ package org.apache.spark.ml
2020
import scala.collection.mutable.ListBuffer
2121

2222
import org.apache.spark.Logging
23+
import org.apache.spark.annotation.AlphaComponent
2324
import org.apache.spark.ml.param.{Param, ParamMap}
2425
import org.apache.spark.sql.{SchemaRDD, StructType}
2526

2627
/**
28+
* :: AlphaComponent ::
2729
* A stage in a pipeline, either an Estimator or an Transformer.
2830
*/
31+
@AlphaComponent
2932
abstract class PipelineStage extends Serializable with Logging {
3033

3134
/**
@@ -49,6 +52,7 @@ abstract class PipelineStage extends Serializable with Logging {
4952
}
5053

5154
/**
55+
* :: AlphaComponent ::
5256
* A simple pipeline, which acts as an estimator. A Pipeline consists of a sequence of stages, each
5357
* of which is either an [[Estimator]] or a [[Transformer]]. When [[Pipeline.fit]] is called, the
5458
* stages are executed in order. If a stage is an [[Estimator]], its [[Estimator.fit]] method will
@@ -59,6 +63,7 @@ abstract class PipelineStage extends Serializable with Logging {
5963
* transformers, corresponding to the pipeline stages. If there are no stages, the pipeline acts as
6064
* an identity transformer.
6165
*/
66+
@AlphaComponent
6267
class Pipeline extends Estimator[PipelineModel] {
6368

6469
/** param for pipeline stages */
@@ -125,8 +130,10 @@ class Pipeline extends Estimator[PipelineModel] {
125130
}
126131

127132
/**
133+
* :: AlphaComponent ::
128134
* Represents a compiled pipeline.
129135
*/
136+
@AlphaComponent
130137
class PipelineModel(
131138
override val parent: Pipeline,
132139
override val fittingParamMap: ParamMap,

mllib/src/main/scala/org/apache/spark/ml/Transformer.scala

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import scala.annotation.varargs
2121
import scala.reflect.runtime.universe.TypeTag
2222

2323
import org.apache.spark.Logging
24+
import org.apache.spark.annotation.AlphaComponent
2425
import org.apache.spark.ml.param._
2526
import org.apache.spark.sql.SchemaRDD
2627
import org.apache.spark.sql.api.java.JavaSchemaRDD
@@ -30,8 +31,10 @@ import org.apache.spark.sql.catalyst.dsl._
3031
import org.apache.spark.sql.catalyst.types._
3132

3233
/**
34+
* :: AlphaComponet ::
3335
* Abstract class for transformers that transform one dataset into another.
3436
*/
37+
@AlphaComponent
3538
abstract class Transformer extends PipelineStage with Params {
3639

3740
/**
@@ -80,9 +83,11 @@ abstract class Transformer extends PipelineStage with Params {
8083
}
8184

8285
/**
86+
* :: AlphaComponent ::
8387
* Abstract class for transformers that take one input column, apply transformation, and output the
8488
* result as a new column.
8589
*/
90+
@AlphaComponent
8691
abstract class UnaryTransformer[IN, OUT: TypeTag, T <: UnaryTransformer[IN, OUT, T]]
8792
extends Transformer with HasInputCol with HasOutputCol with Logging {
8893

mllib/src/main/scala/org/apache/spark/ml/classification/LogisticRegression.scala

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
package org.apache.spark.ml.classification
1919

20+
import org.apache.spark.annotation.AlphaComponent
2021
import org.apache.spark.ml._
2122
import org.apache.spark.ml.param._
2223
import org.apache.spark.mllib.classification.LogisticRegressionWithLBFGS
@@ -28,8 +29,10 @@ import org.apache.spark.sql.catalyst.dsl._
2829
import org.apache.spark.storage.StorageLevel
2930

3031
/**
32+
* :: AlphaComponent ::
3133
* Params for logistic regression.
3234
*/
35+
@AlphaComponent
3336
private[classification] trait LogisticRegressionParams extends Params
3437
with HasRegParam with HasMaxIter with HasLabelCol with HasThreshold with HasFeaturesCol
3538
with HasScoreCol with HasPredictionCol {
@@ -108,8 +111,10 @@ class LogisticRegression extends Estimator[LogisticRegressionModel] with Logisti
108111
}
109112

110113
/**
114+
* :: AlphaComponent ::
111115
* Model produced by [[LogisticRegression]].
112116
*/
117+
@AlphaComponent
113118
class LogisticRegressionModel private[ml] (
114119
override val parent: LogisticRegression,
115120
override val fittingParamMap: ParamMap,

mllib/src/main/scala/org/apache/spark/ml/evaluation/BinaryClassificationEvaluator.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,17 @@
1717

1818
package org.apache.spark.ml.evaluation
1919

20+
import org.apache.spark.annotation.AlphaComponent
2021
import org.apache.spark.ml._
2122
import org.apache.spark.ml.param._
2223
import org.apache.spark.mllib.evaluation.BinaryClassificationMetrics
2324
import org.apache.spark.sql.{DoubleType, Row, SchemaRDD}
2425

2526
/**
27+
* :: AlphaComponent ::
2628
* Evaluator for binary classification, which expects two input columns: score and label.
2729
*/
30+
@AlphaComponent
2831
class BinaryClassificationEvaluator extends Evaluator with Params
2932
with HasScoreCol with HasLabelCol {
3033

mllib/src/main/scala/org/apache/spark/ml/feature/HashingTF.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,17 @@
1717

1818
package org.apache.spark.ml.feature
1919

20+
import org.apache.spark.annotation.AlphaComponent
2021
import org.apache.spark.ml.UnaryTransformer
2122
import org.apache.spark.ml.param.{IntParam, ParamMap}
2223
import org.apache.spark.mllib.feature
2324
import org.apache.spark.mllib.linalg.Vector
2425

2526
/**
27+
* :: AlphaComponent ::
2628
* Maps a sequence of terms to their term frequencies using the hashing trick.
2729
*/
30+
@AlphaComponent
2831
class HashingTF extends UnaryTransformer[Iterable[_], Vector, HashingTF] {
2932

3033
/** number of features */

mllib/src/main/scala/org/apache/spark/ml/feature/StandardScaler.scala

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
package org.apache.spark.ml.feature
1919

20+
import org.apache.spark.annotation.AlphaComponent
2021
import org.apache.spark.ml._
2122
import org.apache.spark.ml.param._
2223
import org.apache.spark.mllib.feature
@@ -31,9 +32,11 @@ import org.apache.spark.sql.catalyst.dsl._
3132
private[feature] trait StandardScalerParams extends Params with HasInputCol with HasOutputCol
3233

3334
/**
35+
* :: AlphaComponent ::
3436
* Standardizes features by removing the mean and scaling to unit variance using column summary
3537
* statistics on the samples in the training set.
3638
*/
39+
@AlphaComponent
3740
class StandardScaler extends Estimator[StandardScalerModel] with StandardScalerParams {
3841

3942
def setInputCol(value: String): this.type = set(inputCol, value)
@@ -66,8 +69,10 @@ class StandardScaler extends Estimator[StandardScalerModel] with StandardScalerP
6669
}
6770

6871
/**
72+
* :: AlphaComponent ::
6973
* Model fitted by [[StandardScaler]].
7074
*/
75+
@AlphaComponent
7176
class StandardScalerModel private[ml] (
7277
override val parent: StandardScaler,
7378
override val fittingParamMap: ParamMap,

0 commit comments

Comments
 (0)