Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ private[classification] trait LinearSVCParams extends ClassifierParams with HasR
* Linear SVM Classifier</a>
*
* This binary classifier optimizes the Hinge Loss using the OWLQN optimizer.
* Only supports L2 regularization currently.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this something should be mentioned in R too?

Copy link
Contributor Author

@yanboliang yanboliang May 11, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@felixcheung Yeah, it should be. However, since SparkR exposed more MLlib APIs during 2.2 releasing cycle, I'm preparing a separate PR to audit new SparkR MLlib APIs which would include this update. Thanks.

*
*/
@Since("2.2.0")
Expand Down Expand Up @@ -148,7 +149,7 @@ class LinearSVC @Since("2.2.0") (
@Since("2.2.0")
override def copy(extra: ParamMap): LinearSVC = defaultCopy(extra)

override protected[classification] def train(dataset: Dataset[_]): LinearSVCModel = {
override protected def train(dataset: Dataset[_]): LinearSVCModel = {
val w = if (!isDefined(weightCol) || $(weightCol).isEmpty) lit(1.0) else col($(weightCol))
val instances: RDD[Instance] =
dataset.select(col($(labelCol)), w, col($(featuresCol))).rdd.map {
Expand Down Expand Up @@ -264,7 +265,7 @@ object LinearSVC extends DefaultParamsReadable[LinearSVC] {

/**
* :: Experimental ::
* SVM Model trained by [[LinearSVC]]
* Linear SVM Model trained by [[LinearSVC]]
*/
@Since("2.2.0")
@Experimental
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,12 @@ private[classification] trait LogisticRegressionParams extends ProbabilisticClas
}

/**
* Logistic regression. Supports multinomial logistic (softmax) regression and binomial logistic
* regression.
* Logistic regression. Supports:
* - Multinomial logistic (softmax) regression.
* - Binomial logistic regression.
*
* This class supports fitting traditional logistic regression model by LBFGS/OWLQN and
* bound (box) constrained logistic regression model by LBFGSB.
*/
@Since("1.2.0")
class LogisticRegression @Since("1.2.0") (
Expand Down
14 changes: 8 additions & 6 deletions mllib/src/main/scala/org/apache/spark/ml/feature/Imputer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ private[feature] trait ImputerParams extends Params with HasInputCols {
* computing median, DataFrameStatFunctions.approxQuantile is used with a relative error of 0.001.
*/
@Experimental
class Imputer @Since("2.2.0")(override val uid: String)
@Since("2.2.0")
class Imputer @Since("2.2.0") (@Since("2.2.0") override val uid: String)
extends Estimator[ImputerModel] with ImputerParams with DefaultParamsWritable {

@Since("2.2.0")
Expand Down Expand Up @@ -165,8 +166,8 @@ class Imputer @Since("2.2.0")(override val uid: String)
object Imputer extends DefaultParamsReadable[Imputer] {

/** strategy names that Imputer currently supports. */
private[ml] val mean = "mean"
private[ml] val median = "median"
private[feature] val mean = "mean"
private[feature] val median = "median"

@Since("2.2.0")
override def load(path: String): Imputer = super.load(path)
Expand All @@ -180,9 +181,10 @@ object Imputer extends DefaultParamsReadable[Imputer] {
* which are used to replace the missing values in the input DataFrame.
*/
@Experimental
class ImputerModel private[ml](
override val uid: String,
val surrogateDF: DataFrame)
@Since("2.2.0")
class ImputerModel private[ml] (
@Since("2.2.0") override val uid: String,
@Since("2.2.0") val surrogateDF: DataFrame)
extends Model[ImputerModel] with ImputerParams with MLWritable {

import ImputerModel._
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ object FPGrowth extends DefaultParamsReadable[FPGrowth] {
@Experimental
class FPGrowthModel private[ml] (
@Since("2.2.0") override val uid: String,
@transient val freqItemsets: DataFrame)
@Since("2.2.0") @transient val freqItemsets: DataFrame)
extends Model[FPGrowthModel] with FPGrowthParams with MLWritable {

/** @group setParam */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import org.apache.spark.sql.{DataFrame, Dataset, Row}
import org.apache.spark.sql.types.{StructField, StructType}

/**
* API for correlation functions in MLlib, compatible with Dataframes and Datasets.
* API for correlation functions in MLlib, compatible with DataFrames and Datasets.
*
* The functions in this package generalize the functions in [[org.apache.spark.sql.Dataset#stat]]
* to spark.ml's Vector types.
Expand Down
1 change: 1 addition & 0 deletions python/pyspark/ml/classification.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ class LinearSVC(JavaEstimator, HasFeaturesCol, HasLabelCol, HasPredictionCol, Ha
`Linear SVM Classifier <https://en.wikipedia.org/wiki/Support_vector_machine#Linear_SVM>`_

This binary classifier optimizes the Hinge Loss using the OWLQN optimizer.
Only supports L2 regularization currently.

>>> from pyspark.sql import Row
>>> from pyspark.ml.linalg import Vectors
Expand Down