spark git commit: [SPARK-10280][MLLIB][PYSPARK][DOCS] Add @since annotation to pyspark.ml.classification

2015-11-09 Thread meng
Repository: spark
Updated Branches:
  refs/heads/branch-1.6 62f664c5a -> 2459b3432


[SPARK-10280][MLLIB][PYSPARK][DOCS] Add @since annotation to 
pyspark.ml.classification

Author: Yu ISHIKAWA 

Closes #8690 from yu-iskw/SPARK-10280.

(cherry picked from commit 88a3fdcc783f880a8d01c7e194ec42fc114bdf8a)
Signed-off-by: Xiangrui Meng 


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/2459b343
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/2459b343
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/2459b343

Branch: refs/heads/branch-1.6
Commit: 2459b3432bad48da9f5c72763e2088bea7e26308
Parents: 62f664c
Author: Yu ISHIKAWA 
Authored: Mon Nov 9 13:16:04 2015 -0800
Committer: Xiangrui Meng 
Committed: Mon Nov 9 13:16:13 2015 -0800

--
 python/pyspark/ml/classification.py | 56 
 1 file changed, 56 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/spark/blob/2459b343/python/pyspark/ml/classification.py
--
diff --git a/python/pyspark/ml/classification.py 
b/python/pyspark/ml/classification.py
index 2e468f6..603f2c7 100644
--- a/python/pyspark/ml/classification.py
+++ b/python/pyspark/ml/classification.py
@@ -67,6 +67,8 @@ class LogisticRegression(JavaEstimator, HasFeaturesCol, 
HasLabelCol, HasPredicti
 Traceback (most recent call last):
 ...
 TypeError: Method setParams forces keyword arguments.
+
+.. versionadded:: 1.3.0
 """
 
 # a placeholder to make it appear in the generated doc
@@ -99,6 +101,7 @@ class LogisticRegression(JavaEstimator, HasFeaturesCol, 
HasLabelCol, HasPredicti
 self._checkThresholdConsistency()
 
 @keyword_only
+@since("1.3.0")
 def setParams(self, featuresCol="features", labelCol="label", 
predictionCol="prediction",
   maxIter=100, regParam=0.1, elasticNetParam=0.0, tol=1e-6, 
fitIntercept=True,
   threshold=0.5, thresholds=None, probabilityCol="probability",
@@ -119,6 +122,7 @@ class LogisticRegression(JavaEstimator, HasFeaturesCol, 
HasLabelCol, HasPredicti
 def _create_model(self, java_model):
 return LogisticRegressionModel(java_model)
 
+@since("1.4.0")
 def setThreshold(self, value):
 """
 Sets the value of :py:attr:`threshold`.
@@ -129,6 +133,7 @@ class LogisticRegression(JavaEstimator, HasFeaturesCol, 
HasLabelCol, HasPredicti
 del self._paramMap[self.thresholds]
 return self
 
+@since("1.4.0")
 def getThreshold(self):
 """
 Gets the value of threshold or its default value.
@@ -144,6 +149,7 @@ class LogisticRegression(JavaEstimator, HasFeaturesCol, 
HasLabelCol, HasPredicti
 else:
 return self.getOrDefault(self.threshold)
 
+@since("1.5.0")
 def setThresholds(self, value):
 """
 Sets the value of :py:attr:`thresholds`.
@@ -154,6 +160,7 @@ class LogisticRegression(JavaEstimator, HasFeaturesCol, 
HasLabelCol, HasPredicti
 del self._paramMap[self.threshold]
 return self
 
+@since("1.5.0")
 def getThresholds(self):
 """
 If :py:attr:`thresholds` is set, return its value.
@@ -185,9 +192,12 @@ class LogisticRegression(JavaEstimator, HasFeaturesCol, 
HasLabelCol, HasPredicti
 class LogisticRegressionModel(JavaModel):
 """
 Model fitted by LogisticRegression.
+
+.. versionadded:: 1.3.0
 """
 
 @property
+@since("1.4.0")
 def weights(self):
 """
 Model weights.
@@ -205,6 +215,7 @@ class LogisticRegressionModel(JavaModel):
 return self._call_java("coefficients")
 
 @property
+@since("1.4.0")
 def intercept(self):
 """
 Model intercept.
@@ -215,6 +226,8 @@ class LogisticRegressionModel(JavaModel):
 class TreeClassifierParams(object):
 """
 Private class to track supported impurity measures.
+
+.. versionadded:: 1.4.0
 """
 supportedImpurities = ["entropy", "gini"]
 
@@ -231,6 +244,7 @@ class TreeClassifierParams(object):
   "gain calculation (case-insensitive). Supported 
options: " +
   ", ".join(self.supportedImpurities))
 
+@since("1.6.0")
 def setImpurity(self, value):
 """
 Sets the value of :py:attr:`impurity`.
@@ -238,6 +252,7 @@ class TreeClassifierParams(object):
 self._paramMap[self.impurity] = value
 return self
 
+@since("1.6.0")
 def getImpurity(self):
 """
 Gets the value of impurity or its default value.
@@ -248,6 +263,8 @@ class TreeClassifierParams(object):
 class GBTParams(TreeEnsembleParams):
 """
 Private class to track supported GBT params.
+
+.. versionadded:: 1.4.0
 """
  

spark git commit: [SPARK-10280][MLLIB][PYSPARK][DOCS] Add @since annotation to pyspark.ml.classification

2015-11-09 Thread meng
Repository: spark
Updated Branches:
  refs/heads/master 860ea0d38 -> 88a3fdcc7


[SPARK-10280][MLLIB][PYSPARK][DOCS] Add @since annotation to 
pyspark.ml.classification

Author: Yu ISHIKAWA 

Closes #8690 from yu-iskw/SPARK-10280.


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/88a3fdcc
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/88a3fdcc
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/88a3fdcc

Branch: refs/heads/master
Commit: 88a3fdcc783f880a8d01c7e194ec42fc114bdf8a
Parents: 860ea0d
Author: Yu ISHIKAWA 
Authored: Mon Nov 9 13:16:04 2015 -0800
Committer: Xiangrui Meng 
Committed: Mon Nov 9 13:16:04 2015 -0800

--
 python/pyspark/ml/classification.py | 56 
 1 file changed, 56 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/spark/blob/88a3fdcc/python/pyspark/ml/classification.py
--
diff --git a/python/pyspark/ml/classification.py 
b/python/pyspark/ml/classification.py
index 2e468f6..603f2c7 100644
--- a/python/pyspark/ml/classification.py
+++ b/python/pyspark/ml/classification.py
@@ -67,6 +67,8 @@ class LogisticRegression(JavaEstimator, HasFeaturesCol, 
HasLabelCol, HasPredicti
 Traceback (most recent call last):
 ...
 TypeError: Method setParams forces keyword arguments.
+
+.. versionadded:: 1.3.0
 """
 
 # a placeholder to make it appear in the generated doc
@@ -99,6 +101,7 @@ class LogisticRegression(JavaEstimator, HasFeaturesCol, 
HasLabelCol, HasPredicti
 self._checkThresholdConsistency()
 
 @keyword_only
+@since("1.3.0")
 def setParams(self, featuresCol="features", labelCol="label", 
predictionCol="prediction",
   maxIter=100, regParam=0.1, elasticNetParam=0.0, tol=1e-6, 
fitIntercept=True,
   threshold=0.5, thresholds=None, probabilityCol="probability",
@@ -119,6 +122,7 @@ class LogisticRegression(JavaEstimator, HasFeaturesCol, 
HasLabelCol, HasPredicti
 def _create_model(self, java_model):
 return LogisticRegressionModel(java_model)
 
+@since("1.4.0")
 def setThreshold(self, value):
 """
 Sets the value of :py:attr:`threshold`.
@@ -129,6 +133,7 @@ class LogisticRegression(JavaEstimator, HasFeaturesCol, 
HasLabelCol, HasPredicti
 del self._paramMap[self.thresholds]
 return self
 
+@since("1.4.0")
 def getThreshold(self):
 """
 Gets the value of threshold or its default value.
@@ -144,6 +149,7 @@ class LogisticRegression(JavaEstimator, HasFeaturesCol, 
HasLabelCol, HasPredicti
 else:
 return self.getOrDefault(self.threshold)
 
+@since("1.5.0")
 def setThresholds(self, value):
 """
 Sets the value of :py:attr:`thresholds`.
@@ -154,6 +160,7 @@ class LogisticRegression(JavaEstimator, HasFeaturesCol, 
HasLabelCol, HasPredicti
 del self._paramMap[self.threshold]
 return self
 
+@since("1.5.0")
 def getThresholds(self):
 """
 If :py:attr:`thresholds` is set, return its value.
@@ -185,9 +192,12 @@ class LogisticRegression(JavaEstimator, HasFeaturesCol, 
HasLabelCol, HasPredicti
 class LogisticRegressionModel(JavaModel):
 """
 Model fitted by LogisticRegression.
+
+.. versionadded:: 1.3.0
 """
 
 @property
+@since("1.4.0")
 def weights(self):
 """
 Model weights.
@@ -205,6 +215,7 @@ class LogisticRegressionModel(JavaModel):
 return self._call_java("coefficients")
 
 @property
+@since("1.4.0")
 def intercept(self):
 """
 Model intercept.
@@ -215,6 +226,8 @@ class LogisticRegressionModel(JavaModel):
 class TreeClassifierParams(object):
 """
 Private class to track supported impurity measures.
+
+.. versionadded:: 1.4.0
 """
 supportedImpurities = ["entropy", "gini"]
 
@@ -231,6 +244,7 @@ class TreeClassifierParams(object):
   "gain calculation (case-insensitive). Supported 
options: " +
   ", ".join(self.supportedImpurities))
 
+@since("1.6.0")
 def setImpurity(self, value):
 """
 Sets the value of :py:attr:`impurity`.
@@ -238,6 +252,7 @@ class TreeClassifierParams(object):
 self._paramMap[self.impurity] = value
 return self
 
+@since("1.6.0")
 def getImpurity(self):
 """
 Gets the value of impurity or its default value.
@@ -248,6 +263,8 @@ class TreeClassifierParams(object):
 class GBTParams(TreeEnsembleParams):
 """
 Private class to track supported GBT params.
+
+.. versionadded:: 1.4.0
 """
 supportedLossTypes = ["logistic"]
 
@@ -287,6 +304,8 @@ class DecisionTreeClassifier(JavaEstimator, HasFe