You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "lichenglin (JIRA)" <ji...@apache.org> on 2016/05/23 06:39:13 UTC

[jira] [Created] (SPARK-15478) LogisticRegressionModel 's Coefficients always be a empty vector

lichenglin created SPARK-15478:
----------------------------------

             Summary: LogisticRegressionModel 's  Coefficients always  be a 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 don't know if 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