File tree Expand file tree Collapse file tree 6 files changed +12
-6
lines changed
mllib/src/main/scala/org/apache/spark/mllib Expand file tree Collapse file tree 6 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ import org.apache.spark.mllib.classification.impl.GLMClassificationModel
2323import org .apache .spark .mllib .linalg .BLAS .dot
2424import org .apache .spark .mllib .linalg .{DenseVector , Vector }
2525import org .apache .spark .mllib .optimization ._
26+ import org .apache .spark .mllib .pmml .PMMLExportable
2627import org .apache .spark .mllib .regression ._
2728import org .apache .spark .mllib .util .{DataValidators , Saveable , Loader }
2829import org .apache .spark .rdd .RDD
@@ -46,7 +47,7 @@ class LogisticRegressionModel (
4647 val numFeatures : Int ,
4748 val numClasses : Int )
4849 extends GeneralizedLinearModel (weights, intercept) with ClassificationModel with Serializable
49- with Saveable {
50+ with Saveable with PMMLExportable {
5051
5152 if (numClasses == 2 ) {
5253 require(weights.size == numFeatures,
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ import org.apache.spark.annotation.Experimental
2222import org .apache .spark .mllib .classification .impl .GLMClassificationModel
2323import org .apache .spark .mllib .linalg .Vector
2424import org .apache .spark .mllib .optimization ._
25+ import org .apache .spark .mllib .pmml .PMMLExportable
2526import org .apache .spark .mllib .regression ._
2627import org .apache .spark .mllib .util .{DataValidators , Saveable , Loader }
2728import org .apache .spark .rdd .RDD
@@ -37,7 +38,7 @@ class SVMModel (
3738 override val weights : Vector ,
3839 override val intercept : Double )
3940 extends GeneralizedLinearModel (weights, intercept) with ClassificationModel with Serializable
40- with Saveable {
41+ with Saveable with PMMLExportable {
4142
4243 private var threshold : Option [Double ] = Some (0.0 )
4344
Original file line number Diff line number Diff line change @@ -21,11 +21,12 @@ import org.apache.spark.api.java.JavaRDD
2121import org .apache .spark .rdd .RDD
2222import org .apache .spark .SparkContext ._
2323import org .apache .spark .mllib .linalg .Vector
24+ import org .apache .spark .mllib .pmml .PMMLExportable
2425
2526/**
2627 * A clustering model for K-means. Each point belongs to the cluster with the closest center.
2728 */
28- class KMeansModel (val clusterCenters : Array [Vector ]) extends Serializable {
29+ class KMeansModel (val clusterCenters : Array [Vector ]) extends Serializable with PMMLExportable {
2930
3031 /** Total number of clusters. */
3132 def k : Int = clusterCenters.length
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ package org.apache.spark.mllib.regression
2020import org .apache .spark .SparkContext
2121import org .apache .spark .mllib .linalg .Vector
2222import org .apache .spark .mllib .optimization ._
23+ import org .apache .spark .mllib .pmml .PMMLExportable
2324import org .apache .spark .mllib .regression .impl .GLMRegressionModel
2425import org .apache .spark .mllib .util .{Saveable , Loader }
2526import org .apache .spark .rdd .RDD
@@ -34,7 +35,7 @@ class LassoModel (
3435 override val weights : Vector ,
3536 override val intercept : Double )
3637 extends GeneralizedLinearModel (weights, intercept)
37- with RegressionModel with Serializable with Saveable {
38+ with RegressionModel with Serializable with Saveable with PMMLExportable {
3839
3940 override protected def predictPoint (
4041 dataMatrix : Vector ,
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ package org.apache.spark.mllib.regression
2020import org .apache .spark .SparkContext
2121import org .apache .spark .mllib .linalg .Vector
2222import org .apache .spark .mllib .optimization ._
23+ import org .apache .spark .mllib .pmml .PMMLExportable
2324import org .apache .spark .mllib .regression .impl .GLMRegressionModel
2425import org .apache .spark .mllib .util .{Saveable , Loader }
2526import org .apache .spark .rdd .RDD
@@ -34,7 +35,7 @@ class LinearRegressionModel (
3435 override val weights : Vector ,
3536 override val intercept : Double )
3637 extends GeneralizedLinearModel (weights, intercept) with RegressionModel with Serializable
37- with Saveable {
38+ with Saveable with PMMLExportable {
3839
3940 override protected def predictPoint (
4041 dataMatrix : Vector ,
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ package org.apache.spark.mllib.regression
2020import org .apache .spark .SparkContext
2121import org .apache .spark .mllib .linalg .Vector
2222import org .apache .spark .mllib .optimization ._
23+ import org .apache .spark .mllib .pmml .PMMLExportable
2324import org .apache .spark .mllib .regression .impl .GLMRegressionModel
2425import org .apache .spark .mllib .util .{Loader , Saveable }
2526import org .apache .spark .rdd .RDD
@@ -35,7 +36,7 @@ class RidgeRegressionModel (
3536 override val weights : Vector ,
3637 override val intercept : Double )
3738 extends GeneralizedLinearModel (weights, intercept)
38- with RegressionModel with Serializable with Saveable {
39+ with RegressionModel with Serializable with Saveable with PMMLExportable {
3940
4041 override protected def predictPoint (
4142 dataMatrix : Vector ,
You can’t perform that action at this time.
0 commit comments