diff options
author | Joseph K. Bradley <joseph@databricks.com> | 2016-03-01 21:26:47 -0800 |
---|---|---|
committer | Xiangrui Meng <meng@databricks.com> | 2016-03-01 21:26:47 -0800 |
commit | 9495c40f227b785d852abdc307461d2e7e5c2011 (patch) | |
tree | 486ec6f0602e7459b482b1025004bbd1c8836c3b /python | |
parent | e42724b12b976b3276accc1132f446fa67f7f981 (diff) | |
download | spark-9495c40f227b785d852abdc307461d2e7e5c2011.tar.gz spark-9495c40f227b785d852abdc307461d2e7e5c2011.tar.bz2 spark-9495c40f227b785d852abdc307461d2e7e5c2011.zip |
[SPARK-13008][ML][PYTHON] Put one alg per line in pyspark.ml all lists
This is to fix a long-time annoyance: Whenever we add a new algorithm to pyspark.ml, we have to add it to the ```__all__``` list at the top. Since we keep it alphabetized, it often creates a lot more changes than needed. It is also easy to add the Estimator and forget the Model. I'm going to switch it to have one algorithm per line.
This also alphabetizes a few out-of-place classes in pyspark.ml.feature. No changes have been made to the moved classes.
CC: thunterdb
Author: Joseph K. Bradley <joseph@databricks.com>
Closes #10927 from jkbradley/ml-python-all-list.
Diffstat (limited to 'python')
-rw-r--r-- | python/pyspark/ml/classification.py | 11 | ||||
-rw-r--r-- | python/pyspark/ml/clustering.py | 3 | ||||
-rw-r--r-- | python/pyspark/ml/feature.py | 37 |
3 files changed, 36 insertions, 15 deletions
diff --git a/python/pyspark/ml/classification.py b/python/pyspark/ml/classification.py index 3179fb30ab..253af15cb5 100644 --- a/python/pyspark/ml/classification.py +++ b/python/pyspark/ml/classification.py @@ -26,11 +26,12 @@ from pyspark.ml.regression import ( from pyspark.mllib.common import inherit_doc -__all__ = ['LogisticRegression', 'LogisticRegressionModel', 'DecisionTreeClassifier', - 'DecisionTreeClassificationModel', 'GBTClassifier', 'GBTClassificationModel', - 'RandomForestClassifier', 'RandomForestClassificationModel', 'NaiveBayes', - 'NaiveBayesModel', 'MultilayerPerceptronClassifier', - 'MultilayerPerceptronClassificationModel'] +__all__ = ['LogisticRegression', 'LogisticRegressionModel', + 'DecisionTreeClassifier', 'DecisionTreeClassificationModel', + 'GBTClassifier', 'GBTClassificationModel', + 'RandomForestClassifier', 'RandomForestClassificationModel', + 'NaiveBayes', 'NaiveBayesModel', + 'MultilayerPerceptronClassifier', 'MultilayerPerceptronClassificationModel'] @inherit_doc diff --git a/python/pyspark/ml/clustering.py b/python/pyspark/ml/clustering.py index 611b919049..1cea477acb 100644 --- a/python/pyspark/ml/clustering.py +++ b/python/pyspark/ml/clustering.py @@ -21,7 +21,8 @@ from pyspark.ml.wrapper import JavaEstimator, JavaModel from pyspark.ml.param.shared import * from pyspark.mllib.common import inherit_doc -__all__ = ['KMeans', 'KMeansModel', 'BisectingKMeans', 'BisectingKMeansModel'] +__all__ = ['BisectingKMeans', 'BisectingKMeansModel', + 'KMeans', 'KMeansModel'] class KMeansModel(JavaModel, MLWritable, MLReadable): diff --git a/python/pyspark/ml/feature.py b/python/pyspark/ml/feature.py index 369f3508fd..fb31c7310c 100644 --- a/python/pyspark/ml/feature.py +++ b/python/pyspark/ml/feature.py @@ -27,15 +27,34 @@ from pyspark.ml.wrapper import JavaEstimator, JavaModel, JavaTransformer, _jvm from pyspark.mllib.common import inherit_doc from pyspark.mllib.linalg import _convert_to_vector -__all__ = ['Binarizer', 'Bucketizer', 'CountVectorizer', 'CountVectorizerModel', 'DCT', - 'ElementwiseProduct', 'HashingTF', 'IDF', 'IDFModel', 'IndexToString', - 'MaxAbsScaler', 'MaxAbsScalerModel', 'MinMaxScaler', 'MinMaxScalerModel', - 'NGram', 'Normalizer', 'OneHotEncoder', 'PCA', 'PCAModel', 'PolynomialExpansion', - 'QuantileDiscretizer', 'RegexTokenizer', 'RFormula', 'RFormulaModel', - 'SQLTransformer', 'StandardScaler', 'StandardScalerModel', 'StopWordsRemover', - 'StringIndexer', 'StringIndexerModel', 'Tokenizer', 'VectorAssembler', - 'VectorIndexer', 'VectorSlicer', 'Word2Vec', 'Word2VecModel', 'ChiSqSelector', - 'ChiSqSelectorModel'] +__all__ = ['Binarizer', + 'Bucketizer', + 'ChiSqSelector', 'ChiSqSelectorModel', + 'CountVectorizer', 'CountVectorizerModel', + 'DCT', + 'ElementwiseProduct', + 'HashingTF', + 'IDF', 'IDFModel', + 'IndexToString', + 'MaxAbsScaler', 'MaxAbsScalerModel', + 'MinMaxScaler', 'MinMaxScalerModel', + 'NGram', + 'Normalizer', + 'OneHotEncoder', + 'PCA', 'PCAModel', + 'PolynomialExpansion', + 'QuantileDiscretizer', + 'RegexTokenizer', + 'RFormula', 'RFormulaModel', + 'SQLTransformer', + 'StandardScaler', 'StandardScalerModel', + 'StopWordsRemover', + 'StringIndexer', 'StringIndexerModel', + 'Tokenizer', + 'VectorAssembler', + 'VectorIndexer', 'VectorIndexerModel', + 'VectorSlicer', + 'Word2Vec', 'Word2VecModel'] @inherit_doc |