spark-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bharath Venkatesh (JIRA)" <>
Subject [jira] [Commented] (SPARK-10592) deprecate weights and use coefficients instead in ML models
Date Wed, 25 May 2016 00:04:12 GMT


Bharath Venkatesh commented on SPARK-10592:

Hi Kai

I am trying to build a learning model in Spark 1.6 and I think I am hitting a bug related
to this deprecation.

This is our sample usecase.

Creating a learning model:
tokenizer = Tokenizer(inputCol=, outputCol=)
hashingTF = HashingTF(inputCol=tokenizer.getOutputCol(), outputCol=)
lr = LogisticRegression(maxIter=10, regParam=0.01)
pipeline = Pipeline(stages=[tokenizer, hashingTF, lr])
model =

Creating a DF:
testDf = sqlContext.createDataFrame(testData, schema).where()

Evaluate a target Dataset by calling Model.Transform:
predictionsDf = model.transform(testDf)

I am calling the transform function. The transform is in turn referring to weights which seems
to be deprecated. I am getting the below Warning.

/usr/lib/spark/python/pyspark/ml/ UserWarning: weights is deprecated.
Use coefficients instead.
warnings.warn("weights is deprecated. Use coefficients instead.")

> deprecate weights and use coefficients instead in ML models
> -----------------------------------------------------------
>                 Key: SPARK-10592
>                 URL:
>             Project: Spark
>          Issue Type: Improvement
>          Components: ML, PySpark
>            Reporter: Xiangrui Meng
>            Assignee: Kai Jiang
>            Priority: Critical
>             Fix For: 1.6.0
> The name `weights` becomes confusing as we are supporting weighted instanced. As discussed
in, we want to deprecate `weights` and use `coefficients`
> * Deprecate but do not remove `weights`.
> * Only make changes under ``.

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message