diff --git a/mllib/src/main/scala/org/apache/spark/ml/classification/LinearSVC.scala b/mllib/src/main/scala/org/apache/spark/ml/classification/LinearSVC.scala index 3b14c4b00416ab76f17c92bdcd151c5e76df798b..bf6e76d7ac44ecb4ded6e14df5ce71c436210a52 100644 --- a/mllib/src/main/scala/org/apache/spark/ml/classification/LinearSVC.scala +++ b/mllib/src/main/scala/org/apache/spark/ml/classification/LinearSVC.scala @@ -47,7 +47,8 @@ private[classification] trait LinearSVCParams extends ClassifierParams with HasR /** * :: Experimental :: * - * Linear SVM Classifier (https://en.wikipedia.org/wiki/Support_vector_machine#Linear_SVM) + * <a href = "https://en.wikipedia.org/wiki/Support_vector_machine#Linear_SVM"> + * Linear SVM Classifier</a> * * This binary classifier optimizes the Hinge Loss using the OWLQN optimizer. * diff --git a/python/pyspark/ml/classification.py b/python/pyspark/ml/classification.py index d41fc81fd75d4cc3b472d5e30162de6f5a6461a6..69f0cea82ede2142a4d2c835f5b6fda9002f4a6c 100644 --- a/python/pyspark/ml/classification.py +++ b/python/pyspark/ml/classification.py @@ -65,7 +65,10 @@ class LinearSVC(JavaEstimator, HasFeaturesCol, HasLabelCol, HasPredictionCol, Ha HasRegParam, HasTol, HasRawPredictionCol, HasFitIntercept, HasStandardization, HasThreshold, HasWeightCol, HasAggregationDepth, JavaMLWritable, JavaMLReadable): """ + .. note:: Experimental + `Linear SVM Classifier <https://en.wikipedia.org/wiki/Support_vector_machine#Linear_SVM>`_ + This binary classifier optimizes the Hinge Loss using the OWLQN optimizer. >>> from pyspark.sql import Row @@ -89,10 +92,6 @@ class LinearSVC(JavaEstimator, HasFeaturesCol, HasLabelCol, HasPredictionCol, Ha 1.0 >>> result.rawPrediction DenseVector([-1.4831, 1.4831]) - >>> svm.setParams("vector") - Traceback (most recent call last): - ... - TypeError: Method setParams forces keyword arguments. >>> svm_path = temp_path + "/svm" >>> svm.save(svm_path) >>> svm2 = LinearSVC.load(svm_path) @@ -150,6 +149,8 @@ class LinearSVC(JavaEstimator, HasFeaturesCol, HasLabelCol, HasPredictionCol, Ha class LinearSVCModel(JavaModel, JavaClassificationModel, JavaMLWritable, JavaMLReadable): """ + .. note:: Experimental + Model fitted by LinearSVC. .. versionadded:: 2.2.0 diff --git a/python/pyspark/ml/param/__init__.py b/python/pyspark/ml/param/__init__.py index ade4864e1d7858c03c4079fa9cd070d7c0163f6d..dc3d23ff1661dd73c8de3d30f4ab6e1a4213efed 100644 --- a/python/pyspark/ml/param/__init__.py +++ b/python/pyspark/ml/param/__init__.py @@ -24,11 +24,9 @@ if sys.version > '3': from abc import ABCMeta import copy import numpy as np -import warnings from py4j.java_gateway import JavaObject -from pyspark import since from pyspark.ml.linalg import DenseVector, Vector from pyspark.ml.util import Identifiable @@ -251,7 +249,6 @@ class Params(Identifiable): setattr(self, name, param._copy_new_parent(self)) @property - @since("1.3.0") def params(self): """ Returns all params ordered by name. The default implementation @@ -264,7 +261,6 @@ class Params(Identifiable): not isinstance(getattr(type(self), x, None), property)])) return self._params - @since("1.4.0") def explainParam(self, param): """ Explains a single param and returns its name, doc, and optional @@ -282,7 +278,6 @@ class Params(Identifiable): valueStr = "(" + ", ".join(values) + ")" return "%s: %s %s" % (param.name, param.doc, valueStr) - @since("1.4.0") def explainParams(self): """ Returns the documentation of all params with their optionally @@ -290,7 +285,6 @@ class Params(Identifiable): """ return "\n".join([self.explainParam(param) for param in self.params]) - @since("1.4.0") def getParam(self, paramName): """ Gets a param by its name. @@ -301,7 +295,6 @@ class Params(Identifiable): else: raise ValueError("Cannot find param with name %s." % paramName) - @since("1.4.0") def isSet(self, param): """ Checks whether a param is explicitly set by user. @@ -309,7 +302,6 @@ class Params(Identifiable): param = self._resolveParam(param) return param in self._paramMap - @since("1.4.0") def hasDefault(self, param): """ Checks whether a param has a default value. @@ -317,7 +309,6 @@ class Params(Identifiable): param = self._resolveParam(param) return param in self._defaultParamMap - @since("1.4.0") def isDefined(self, param): """ Checks whether a param is explicitly set by user or has @@ -325,7 +316,6 @@ class Params(Identifiable): """ return self.isSet(param) or self.hasDefault(param) - @since("1.4.0") def hasParam(self, paramName): """ Tests whether this instance contains a param with a given @@ -337,7 +327,6 @@ class Params(Identifiable): else: raise TypeError("hasParam(): paramName must be a string") - @since("1.4.0") def getOrDefault(self, param): """ Gets the value of a param in the user-supplied param map or its @@ -349,7 +338,6 @@ class Params(Identifiable): else: return self._defaultParamMap[param] - @since("1.4.0") def extractParamMap(self, extra=None): """ Extracts the embedded default param values and user-supplied @@ -368,7 +356,6 @@ class Params(Identifiable): paramMap.update(extra) return paramMap - @since("1.4.0") def copy(self, extra=None): """ Creates a copy of this instance with the same uid and some