Skip to content

Commit 3ce1dff

Browse files
huaxingaosrowen
authored andcommitted
[SPARK-30930][ML] Remove ML/MLLIB DeveloperApi annotations
### What changes were proposed in this pull request? jira link: https://issues.apache.org/jira/browse/SPARK-30930 Remove ML/MLLIB DeveloperApi annotations. ### Why are the changes needed? The Developer APIs in ML/MLLIB have been there for a long time. They are stable now and are very unlikely to be changed or removed, so I unmark these Developer APIs in this PR. ### Does this PR introduce any user-facing change? Yes. DeveloperApi annotations are removed from docs. ### How was this patch tested? existing tests Closes #27859 from huaxingao/spark-30930. Authored-by: Huaxin Gao <[email protected]> Signed-off-by: Sean Owen <[email protected]>
1 parent e736c62 commit 3ce1dff

File tree

65 files changed

+49
-397
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+49
-397
lines changed

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,13 @@ package org.apache.spark.ml
1919

2020
import scala.annotation.varargs
2121

22-
import org.apache.spark.annotation.{DeveloperApi, Since}
22+
import org.apache.spark.annotation.Since
2323
import org.apache.spark.ml.param.{ParamMap, ParamPair}
2424
import org.apache.spark.sql.Dataset
2525

2626
/**
27-
* :: DeveloperApi ::
2827
* Abstract class for estimators that fit models to data.
2928
*/
30-
@DeveloperApi
3129
abstract class Estimator[M <: Model[M]] extends PipelineStage {
3230

3331
/**

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

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

1818
package org.apache.spark.ml
1919

20-
import org.apache.spark.annotation.DeveloperApi
2120
import org.apache.spark.ml.param.ParamMap
2221

2322
/**
24-
* :: DeveloperApi ::
2523
* A fitted model, i.e., a [[Transformer]] produced by an [[Estimator]].
2624
*
2725
* @tparam M model type
2826
*/
29-
@DeveloperApi
3027
abstract class Model[M <: Model[M]] extends Transformer {
3128
/**
3229
* The parent estimator that produced this model.

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,11 @@ import org.apache.spark.sql.{DataFrame, Dataset}
3636
import org.apache.spark.sql.types.StructType
3737

3838
/**
39-
* :: DeveloperApi ::
4039
* A stage in a pipeline, either an [[Estimator]] or a [[Transformer]].
4140
*/
42-
@DeveloperApi
4341
abstract class PipelineStage extends Params with Logging {
4442

4543
/**
46-
* :: DeveloperApi ::
4744
*
4845
* Check transform validity and derive the output schema from the input schema.
4946
*
@@ -54,7 +51,6 @@ abstract class PipelineStage extends Params with Logging {
5451
* Typical implementation should first conduct verification on schema change and parameter
5552
* validity, including complex parameter interaction checks.
5653
*/
57-
@DeveloperApi
5854
def transformSchema(schema: StructType): StructType
5955

6056
/**

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
package org.apache.spark.ml
1919

20-
import org.apache.spark.annotation.{DeveloperApi, Since}
20+
import org.apache.spark.annotation.Since
2121
import org.apache.spark.ml.feature.{Instance, LabeledPoint}
2222
import org.apache.spark.ml.linalg.{Vector, VectorUDT}
2323
import org.apache.spark.ml.param._
@@ -99,7 +99,6 @@ private[ml] trait PredictorParams extends Params
9999
}
100100

101101
/**
102-
* :: DeveloperApi ::
103102
* Abstraction for prediction problems (regression and classification). It accepts all NumericType
104103
* labels and will automatically cast it to DoubleType in `fit()`. If this predictor supports
105104
* weights, it accepts all NumericType weights, which will be automatically casted to DoubleType
@@ -112,7 +111,6 @@ private[ml] trait PredictorParams extends Params
112111
* @tparam M Specialization of [[PredictionModel]]. If you subclass this type, use this type
113112
* parameter to specify the concrete type for the corresponding model.
114113
*/
115-
@DeveloperApi
116114
abstract class Predictor[
117115
FeaturesType,
118116
Learner <: Predictor[FeaturesType, Learner, M],
@@ -190,15 +188,13 @@ abstract class Predictor[
190188
}
191189

192190
/**
193-
* :: DeveloperApi ::
194191
* Abstraction for a model for prediction tasks (regression and classification).
195192
*
196193
* @tparam FeaturesType Type of features.
197194
* E.g., `VectorUDT` for vector features.
198195
* @tparam M Specialization of [[PredictionModel]]. If you subclass this type, use this type
199196
* parameter to specify the concrete type for the corresponding model.
200197
*/
201-
@DeveloperApi
202198
abstract class PredictionModel[FeaturesType, M <: PredictionModel[FeaturesType, M]]
203199
extends Model[M] with PredictorParams {
204200

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ package org.apache.spark.ml
2020
import scala.annotation.varargs
2121
import scala.reflect.runtime.universe.TypeTag
2222

23-
import org.apache.spark.annotation.{DeveloperApi, Since}
23+
import org.apache.spark.annotation.Since
2424
import org.apache.spark.internal.Logging
2525
import org.apache.spark.ml.param._
2626
import org.apache.spark.ml.param.shared._
@@ -29,10 +29,8 @@ import org.apache.spark.sql.functions._
2929
import org.apache.spark.sql.types._
3030

3131
/**
32-
* :: DeveloperApi ::
3332
* Abstract class for transformers that transform one dataset into another.
3433
*/
35-
@DeveloperApi
3634
abstract class Transformer extends PipelineStage {
3735

3836
/**
@@ -75,11 +73,9 @@ abstract class Transformer extends PipelineStage {
7573
}
7674

7775
/**
78-
* :: DeveloperApi ::
7976
* Abstract class for transformers that take one input column, apply transformation, and output the
8077
* result as a new column.
8178
*/
82-
@DeveloperApi
8379
abstract class UnaryTransformer[IN: TypeTag, OUT: TypeTag, T <: UnaryTransformer[IN, OUT, T]]
8480
extends Transformer with HasInputCol with HasOutputCol with Logging {
8581

mllib/src/main/scala/org/apache/spark/ml/attribute/AttributeGroup.scala

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,10 @@ package org.apache.spark.ml.attribute
1919

2020
import scala.collection.mutable.ArrayBuffer
2121

22-
import org.apache.spark.annotation.DeveloperApi
2322
import org.apache.spark.ml.linalg.VectorUDT
2423
import org.apache.spark.sql.types.{Metadata, MetadataBuilder, StructField}
2524

2625
/**
27-
* :: DeveloperApi ::
2826
* Attributes that describe a vector ML column.
2927
*
3028
* @param name name of the attribute group (the ML column name)
@@ -33,7 +31,6 @@ import org.apache.spark.sql.types.{Metadata, MetadataBuilder, StructField}
3331
* @param attrs optional array of attributes. Attribute will be copied with their corresponding
3432
* indices in the array.
3533
*/
36-
@DeveloperApi
3734
class AttributeGroup private (
3835
val name: String,
3936
val numAttributes: Option[Int],
@@ -186,10 +183,8 @@ class AttributeGroup private (
186183
}
187184

188185
/**
189-
* :: DeveloperApi ::
190186
* Factory methods to create attribute groups.
191187
*/
192-
@DeveloperApi
193188
object AttributeGroup {
194189

195190
import AttributeKeys._

mllib/src/main/scala/org/apache/spark/ml/attribute/AttributeType.scala

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

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

20-
import org.apache.spark.annotation.DeveloperApi
2120

2221
/**
23-
* :: DeveloperApi ::
2422
* An enum-like type for attribute types: [[AttributeType$#Numeric]], [[AttributeType$#Nominal]],
2523
* and [[AttributeType$#Binary]].
2624
*/
27-
@DeveloperApi
2825
sealed abstract class AttributeType(val name: String)
2926

30-
/**
31-
* :: DeveloperApi ::
32-
*/
33-
@DeveloperApi
3427
object AttributeType {
3528

3629
/** Numeric type. */

mllib/src/main/scala/org/apache/spark/ml/attribute/attributes.scala

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,11 @@ package org.apache.spark.ml.attribute
1919

2020
import scala.annotation.varargs
2121

22-
import org.apache.spark.annotation.DeveloperApi
2322
import org.apache.spark.sql.types.{DoubleType, Metadata, MetadataBuilder, NumericType, StructField}
2423

2524
/**
26-
* :: DeveloperApi ::
2725
* Abstract class for ML attributes.
2826
*/
29-
@DeveloperApi
3027
sealed abstract class Attribute extends Serializable {
3128

3229
name.foreach { n =>
@@ -150,10 +147,6 @@ private[attribute] trait AttributeFactory {
150147
def fromStructField(field: StructField): Attribute = decodeStructField(field, false)
151148
}
152149

153-
/**
154-
* :: DeveloperApi ::
155-
*/
156-
@DeveloperApi
157150
object Attribute extends AttributeFactory {
158151

159152
private[attribute] override def fromMetadata(metadata: Metadata): Attribute = {
@@ -182,7 +175,6 @@ object Attribute extends AttributeFactory {
182175

183176

184177
/**
185-
* :: DeveloperApi ::
186178
* A numeric attribute with optional summary statistics.
187179
* @param name optional name
188180
* @param index optional index
@@ -191,7 +183,6 @@ object Attribute extends AttributeFactory {
191183
* @param std optional standard deviation
192184
* @param sparsity optional sparsity (ratio of zeros)
193185
*/
194-
@DeveloperApi
195186
class NumericAttribute private[ml] (
196187
override val name: Option[String] = None,
197188
override val index: Option[Int] = None,
@@ -299,10 +290,8 @@ class NumericAttribute private[ml] (
299290
}
300291

301292
/**
302-
* :: DeveloperApi ::
303293
* Factory methods for numeric attributes.
304294
*/
305-
@DeveloperApi
306295
object NumericAttribute extends AttributeFactory {
307296

308297
/** The default numeric attribute. */
@@ -321,7 +310,6 @@ object NumericAttribute extends AttributeFactory {
321310
}
322311

323312
/**
324-
* :: DeveloperApi ::
325313
* A nominal attribute.
326314
* @param name optional name
327315
* @param index optional index
@@ -330,7 +318,6 @@ object NumericAttribute extends AttributeFactory {
330318
* defined.
331319
* @param values optional values. At most one of `numValues` and `values` can be defined.
332320
*/
333-
@DeveloperApi
334321
class NominalAttribute private[ml] (
335322
override val name: Option[String] = None,
336323
override val index: Option[Int] = None,
@@ -464,10 +451,8 @@ class NominalAttribute private[ml] (
464451
}
465452

466453
/**
467-
* :: DeveloperApi ::
468454
* Factory methods for nominal attributes.
469455
*/
470-
@DeveloperApi
471456
object NominalAttribute extends AttributeFactory {
472457

473458
/** The default nominal attribute. */
@@ -487,13 +472,11 @@ object NominalAttribute extends AttributeFactory {
487472
}
488473

489474
/**
490-
* :: DeveloperApi ::
491475
* A binary attribute.
492476
* @param name optional name
493477
* @param index optional index
494478
* @param values optional values. If set, its size must be 2.
495479
*/
496-
@DeveloperApi
497480
class BinaryAttribute private[ml] (
498481
override val name: Option[String] = None,
499482
override val index: Option[Int] = None,
@@ -566,10 +549,8 @@ class BinaryAttribute private[ml] (
566549
}
567550

568551
/**
569-
* :: DeveloperApi ::
570552
* Factory methods for binary attributes.
571553
*/
572-
@DeveloperApi
573554
object BinaryAttribute extends AttributeFactory {
574555

575556
/** The default binary attribute. */
@@ -586,10 +567,8 @@ object BinaryAttribute extends AttributeFactory {
586567
}
587568

588569
/**
589-
* :: DeveloperApi ::
590570
* An unresolved attribute.
591571
*/
592-
@DeveloperApi
593572
object UnresolvedAttribute extends Attribute {
594573

595574
override def attrType: AttributeType = AttributeType.Unresolved

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

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
package org.apache.spark.ml.classification
1919

2020
import org.apache.spark.SparkException
21-
import org.apache.spark.annotation.{DeveloperApi, Since}
21+
import org.apache.spark.annotation.Since
2222
import org.apache.spark.ml.{PredictionModel, Predictor, PredictorParams}
2323
import org.apache.spark.ml.feature.{Instance, LabeledPoint}
2424
import org.apache.spark.ml.linalg.{Vector, VectorUDT}
@@ -62,16 +62,13 @@ private[spark] trait ClassifierParams
6262
}
6363

6464
/**
65-
* :: DeveloperApi ::
66-
*
6765
* Single-label binary or multiclass classification.
6866
* Classes are indexed {0, 1, ..., numClasses - 1}.
6967
*
7068
* @tparam FeaturesType Type of input features. E.g., `Vector`
7169
* @tparam E Concrete Estimator type
7270
* @tparam M Concrete Model type
7371
*/
74-
@DeveloperApi
7572
abstract class Classifier[
7673
FeaturesType,
7774
E <: Classifier[FeaturesType, E, M],
@@ -166,15 +163,12 @@ abstract class Classifier[
166163
}
167164

168165
/**
169-
* :: DeveloperApi ::
170-
*
171166
* Model produced by a [[Classifier]].
172167
* Classes are indexed {0, 1, ..., numClasses - 1}.
173168
*
174169
* @tparam FeaturesType Type of input features. E.g., `Vector`
175170
* @tparam M Concrete Model type
176171
*/
177-
@DeveloperApi
178172
abstract class ClassificationModel[FeaturesType, M <: ClassificationModel[FeaturesType, M]]
179173
extends PredictionModel[FeaturesType, M] with ClassifierParams {
180174

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

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

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

20-
import org.apache.spark.annotation.{DeveloperApi, Since}
20+
import org.apache.spark.annotation.Since
2121
import org.apache.spark.ml.linalg.{DenseVector, Vector, VectorUDT}
2222
import org.apache.spark.ml.param.shared._
2323
import org.apache.spark.ml.util.SchemaUtils
@@ -41,15 +41,12 @@ private[ml] trait ProbabilisticClassifierParams
4141

4242

4343
/**
44-
* :: DeveloperApi ::
45-
*
4644
* Single-label binary or multiclass classifier which can output class conditional probabilities.
4745
*
4846
* @tparam FeaturesType Type of input features. E.g., `Vector`
4947
* @tparam E Concrete Estimator type
5048
* @tparam M Concrete Model type
5149
*/
52-
@DeveloperApi
5350
abstract class ProbabilisticClassifier[
5451
FeaturesType,
5552
E <: ProbabilisticClassifier[FeaturesType, E, M],
@@ -65,15 +62,12 @@ abstract class ProbabilisticClassifier[
6562

6663

6764
/**
68-
* :: DeveloperApi ::
69-
*
7065
* Model produced by a [[ProbabilisticClassifier]].
7166
* Classes are indexed {0, 1, ..., numClasses - 1}.
7267
*
7368
* @tparam FeaturesType Type of input features. E.g., `Vector`
7469
* @tparam M Concrete Model type
7570
*/
76-
@DeveloperApi
7771
abstract class ProbabilisticClassificationModel[
7872
FeaturesType,
7973
M <: ProbabilisticClassificationModel[FeaturesType, M]]

0 commit comments

Comments
 (0)