You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@spark.apache.org by Vinayak Agrawal <vi...@gmail.com> on 2016/01/21 23:05:33 UTC

Getting Co-oefficients of a logistic regression model for a pipelinemodel Spark ML library

Hi All,
I am working with Spark ML package, NOT mllib.
I have a working pipelinemodel. I am trying to get the co-efficients of my
model but I cant find a method to do so.
Documentation here
http://spark.apache.org/docs/latest/ml-classification-regression.html#logistic-regression

shows how to get co-efficient for a logistic regression model but not
pipeline model.
I found an old archive mail asking the same but it does not have a
solution.
https://www.mail-archive.com/search?l=issues@spark.apache.org&q=subject:%22\[jira\]+\[Commented\]+\%28SPARK\-9492\%29+LogisticRegression+in+R+should+provide+model+statistics%22&o=newest&f=1

Any suggestions?
-- 
Vinayak Agrawal

"To Strive, To Seek, To Find and Not to Yield!"
~Lord Alfred Tennyson

Re: Getting Co-oefficients of a logistic regression model for a pipelinemodel Spark ML library

Posted by Holden Karau <ho...@pigscanfly.ca>.
Hi Vinayaka,

You can access the different stages in your pipeline through the stages
array on our pipeline model (
http://spark.apache.org/docs/latest/api/scala/index.html#org.apache.spark.ml.PipelineModel
) and then cast it to the correct stage (if working in Scala or if in
Python just access the coefficients at this point). What programming
language are you working in?

Cheers,

Holden :)

On Thu, Jan 21, 2016 at 2:05 PM, Vinayak Agrawal <vinayakagrawal88@gmail.com
> wrote:

> Hi All,
> I am working with Spark ML package, NOT mllib.
> I have a working pipelinemodel. I am trying to get the co-efficients of my
> model but I cant find a method to do so.
> Documentation here
>
> http://spark.apache.org/docs/latest/ml-classification-regression.html#logistic-regression
>
> shows how to get co-efficient for a logistic regression model but not
> pipeline model.
> I found an old archive mail asking the same but it does not have a
> solution.
>
> https://www.mail-archive.com/search?l=issues@spark.apache.org&q=subject:%22\[jira\]+\[Commented\]+\%28SPARK\-9492\%29+LogisticRegression+in+R+should+provide+model+statistics%22&o=newest&f=1
> <https://www.mail-archive.com/search?l=issues@spark.apache.org&q=subject:%22%5C[jira%5C]+%5C[Commented%5C]+%5C%28SPARK%5C-9492%5C%29+LogisticRegression+in+R+should+provide+model+statistics%22&o=newest&f=1>
>
> Any suggestions?
> --
> Vinayak Agrawal
>
> "To Strive, To Seek, To Find and Not to Yield!"
> ~Lord Alfred Tennyson
>



-- 
Cell : 425-233-8271
Twitter: https://twitter.com/holdenkarau