You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by bharath-official <gi...@git.apache.org> on 2016/05/24 23:57:48 UTC

[GitHub] spark pull request: [SPARK-10592] [ML] [PySpark] Deprecate weights...

Github user bharath-official commented on the pull request:

    https://github.com/apache/spark/pull/9311#issuecomment-221436872
  
    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=<InputCol>, outputCol=<OutputCol>)
    hashingTF = HashingTF(inputCol=tokenizer.getOutputCol(), outputCol=<OutputCol>)
    lr = LogisticRegression(maxIter=10, regParam=0.01)
    pipeline = Pipeline(stages=[tokenizer, hashingTF, lr])
    model = pipeline.fit(labeledData)
    
    **Creating a DF:**
    testData=sc.textFile('<FilePath>').map(<UserDefinedFunctionToParseFile>) 
    testDf = sqlContext.createDataFrame(testData, schema).where(<Conditions>)
    
    **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.
    
    Warning:
    /usr/lib/spark/python/pyspark/ml/classification.py:207: UserWarning: weights is deprecated. Use coefficients instead.
    warnings.warn("weights is deprecated. Use coefficients instead.")


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org