diff options
author | MechCoder <manojkumarsivaraj334@gmail.com> | 2015-08-06 10:08:33 -0700 |
---|---|---|
committer | Joseph K. Bradley <joseph@databricks.com> | 2015-08-06 10:08:33 -0700 |
commit | c5c6aded641048a3e66ac79d9e84d34e4b1abae7 (patch) | |
tree | 0ffac363ca1bfc8f8b9720ee06dc8794b89b17c1 /mllib/src/test/java | |
parent | 9f94c85ff35df6289371f80edde51c2aa6c4bcdc (diff) | |
download | spark-c5c6aded641048a3e66ac79d9e84d34e4b1abae7.tar.gz spark-c5c6aded641048a3e66ac79d9e84d34e4b1abae7.tar.bz2 spark-c5c6aded641048a3e66ac79d9e84d34e4b1abae7.zip |
[SPARK-9112] [ML] Implement Stats for LogisticRegression
I have added support for stats in LogisticRegression. The API is similar to that of LinearRegression with LogisticRegressionTrainingSummary and LogisticRegressionSummary
I have some queries and asked them inline.
Author: MechCoder <manojkumarsivaraj334@gmail.com>
Closes #7538 from MechCoder/log_reg_stats and squashes the following commits:
2e9f7c7 [MechCoder] Change defs into lazy vals
d775371 [MechCoder] Clean up class inheritance
9586125 [MechCoder] Add abstraction to handle Multiclass Metrics
40ad8ef [MechCoder] minor
640376a [MechCoder] remove unnecessary dataframe stuff and add docs
80d9954 [MechCoder] Added tests
fbed861 [MechCoder] DataFrame support for metrics
70a0fc4 [MechCoder] [SPARK-9112] [ML] Implement Stats for LogisticRegression
Diffstat (limited to 'mllib/src/test/java')
-rw-r--r-- | mllib/src/test/java/org/apache/spark/ml/classification/JavaLogisticRegressionSuite.java | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/mllib/src/test/java/org/apache/spark/ml/classification/JavaLogisticRegressionSuite.java b/mllib/src/test/java/org/apache/spark/ml/classification/JavaLogisticRegressionSuite.java index fb1de51163..7e9aa38372 100644 --- a/mllib/src/test/java/org/apache/spark/ml/classification/JavaLogisticRegressionSuite.java +++ b/mllib/src/test/java/org/apache/spark/ml/classification/JavaLogisticRegressionSuite.java @@ -152,4 +152,13 @@ public class JavaLogisticRegressionSuite implements Serializable { } } } + + @Test + public void logisticRegressionTrainingSummary() { + LogisticRegression lr = new LogisticRegression(); + LogisticRegressionModel model = lr.fit(dataset); + + LogisticRegressionTrainingSummary summary = model.summary(); + assert(summary.totalIterations() == summary.objectiveHistory().length); + } } |