spark-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sean Owen (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (SPARK-15478) LogisticRegressionModel coefficients() returns an empty vector
Date Mon, 23 May 2016 12:35:12 GMT

     [ https://issues.apache.org/jira/browse/SPARK-15478?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Sean Owen updated SPARK-15478:
------------------------------
    Summary: LogisticRegressionModel coefficients() returns an empty vector  (was: LogisticRegressionModel
's  Coefficients always  return a empty vector)

Can you clarify what example you have modified, and what is in the file? can you do a little
more debugging to verify the data is read correctly?

It can't be true that it always returns zero, given tests, so am modifying the title.

> LogisticRegressionModel coefficients() returns an empty vector
> --------------------------------------------------------------
>
>                 Key: SPARK-15478
>                 URL: https://issues.apache.org/jira/browse/SPARK-15478
>             Project: Spark
>          Issue Type: Bug
>          Components: MLlib
>    Affects Versions: 1.6.1
>            Reporter: lichenglin
>
> I'm not sure this is a bug.
> I'm runing the sample code like this
> {code}
> 	public static void main(String[] args) {
> 		SQLContext sqlContext = getSQLContext();
> 		DataFrame training = sqlContext.read().format("libsvm")
> 				.load("file:///E:/workspace-mars/bigdata/sparkjob/data/mllib/sample_libsvm_data.txt");
> 		LogisticRegression lr = new LogisticRegression().setMaxIter(10).setRegParam(0.3).setElasticNetParam(0.8);
> 		// Fit the model
> 		LogisticRegressionModel lrModel = lr.fit(training);
> 		// Print the coefficients and intercept for logistic regression
> 		System.out.println("Coefficients: " + lrModel.coefficients() + " Intercept: " + lrModel.intercept());
> 	}
> {code}
> but the Coefficients always return a empty vector.
> {code}
> Coefficients: (692,[],[]) Intercept: 2.751535313041949
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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


Mime
View raw message