Я следую примеру из - https://spark.apache.org/docs/2.3.0/ml-classification-regression.html#multinomial-logistic-regression
Когда я пытаюсь получить сводку модели, я сталкиваюсь с ошибкой.Вот мой код с ошибкой -
// START
import org.apache.spark.ml.classification.LogisticRegression
// Load training data
val training = spark.read.format("libsvm").load("file:///Users/my_username/Desktop/sample_multiclass_classification_data.txt")
val lr = new LogisticRegression().setMaxIter(10).setRegParam(0.3).setElasticNetParam(0.8)
// Fit the model
val lrModel = lr.fit(training)
// Print the coefficients and intercept for multinomial logistic regression
println(s"Coefficients: \n${lrModel.coefficientMatrix}")
println(s"Intercepts: \n${lrModel.interceptVector}")
val trainingSummary = lrModel.summary
org.apache.spark.SparkException: No training summary available for this LogisticRegressionModel
at org.apache.spark.ml.classification.LogisticRegressionModel$$anonfun$summary$1.apply(LogisticRegression.scala:1002)
at org.apache.spark.ml.classification.LogisticRegressionModel$$anonfun$summary$1.apply(LogisticRegression.scala:1002)
at scala.Option.getOrElse(Option.scala:121)
at org.apache.spark.ml.classification.LogisticRegressionModel.summary(LogisticRegression.scala:1001)
... 48 elided
Я хочу напечатать метрики из модели после этого шага.
Я получил данные от - https://github.com/apache/spark/blob/master/data/mllib/sample_multiclass_classification_data.txt