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
23
23
import org .apache .spark .mllib .linalg .BLAS .dot
24
24
import org .apache .spark .mllib .linalg .{DenseVector , Vector }
25
25
import org .apache .spark .mllib .optimization ._
26
+ import org .apache .spark .mllib .pmml .PMMLExportable
26
27
import org .apache .spark .mllib .regression ._
27
28
import org .apache .spark .mllib .util .{DataValidators , Saveable , Loader }
28
29
import org .apache .spark .rdd .RDD
@@ -46,7 +47,7 @@ class LogisticRegressionModel (
46
47
val numFeatures : Int ,
47
48
val numClasses : Int )
48
49
extends GeneralizedLinearModel (weights, intercept) with ClassificationModel with Serializable
49
- with Saveable {
50
+ with Saveable with PMMLExportable {
50
51
51
52
if (numClasses == 2 ) {
52
53
require(weights.size == numFeatures,
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ import org.apache.spark.annotation.Experimental
22
22
import org .apache .spark .mllib .classification .impl .GLMClassificationModel
23
23
import org .apache .spark .mllib .linalg .Vector
24
24
import org .apache .spark .mllib .optimization ._
25
+ import org .apache .spark .mllib .pmml .PMMLExportable
25
26
import org .apache .spark .mllib .regression ._
26
27
import org .apache .spark .mllib .util .{DataValidators , Saveable , Loader }
27
28
import org .apache .spark .rdd .RDD
@@ -37,7 +38,7 @@ class SVMModel (
37
38
override val weights : Vector ,
38
39
override val intercept : Double )
39
40
extends GeneralizedLinearModel (weights, intercept) with ClassificationModel with Serializable
40
- with Saveable {
41
+ with Saveable with PMMLExportable {
41
42
42
43
private var threshold : Option [Double ] = Some (0.0 )
43
44
Original file line number Diff line number Diff line change @@ -21,11 +21,12 @@ import org.apache.spark.api.java.JavaRDD
21
21
import org .apache .spark .rdd .RDD
22
22
import org .apache .spark .SparkContext ._
23
23
import org .apache .spark .mllib .linalg .Vector
24
+ import org .apache .spark .mllib .pmml .PMMLExportable
24
25
25
26
/**
26
27
* A clustering model for K-means. Each point belongs to the cluster with the closest center.
27
28
*/
28
- class KMeansModel (val clusterCenters : Array [Vector ]) extends Serializable {
29
+ class KMeansModel (val clusterCenters : Array [Vector ]) extends Serializable with PMMLExportable {
29
30
30
31
/** Total number of clusters. */
31
32
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
20
20
import org .apache .spark .SparkContext
21
21
import org .apache .spark .mllib .linalg .Vector
22
22
import org .apache .spark .mllib .optimization ._
23
+ import org .apache .spark .mllib .pmml .PMMLExportable
23
24
import org .apache .spark .mllib .regression .impl .GLMRegressionModel
24
25
import org .apache .spark .mllib .util .{Saveable , Loader }
25
26
import org .apache .spark .rdd .RDD
@@ -34,7 +35,7 @@ class LassoModel (
34
35
override val weights : Vector ,
35
36
override val intercept : Double )
36
37
extends GeneralizedLinearModel (weights, intercept)
37
- with RegressionModel with Serializable with Saveable {
38
+ with RegressionModel with Serializable with Saveable with PMMLExportable {
38
39
39
40
override protected def predictPoint (
40
41
dataMatrix : Vector ,
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ package org.apache.spark.mllib.regression
20
20
import org .apache .spark .SparkContext
21
21
import org .apache .spark .mllib .linalg .Vector
22
22
import org .apache .spark .mllib .optimization ._
23
+ import org .apache .spark .mllib .pmml .PMMLExportable
23
24
import org .apache .spark .mllib .regression .impl .GLMRegressionModel
24
25
import org .apache .spark .mllib .util .{Saveable , Loader }
25
26
import org .apache .spark .rdd .RDD
@@ -34,7 +35,7 @@ class LinearRegressionModel (
34
35
override val weights : Vector ,
35
36
override val intercept : Double )
36
37
extends GeneralizedLinearModel (weights, intercept) with RegressionModel with Serializable
37
- with Saveable {
38
+ with Saveable with PMMLExportable {
38
39
39
40
override protected def predictPoint (
40
41
dataMatrix : Vector ,
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ package org.apache.spark.mllib.regression
20
20
import org .apache .spark .SparkContext
21
21
import org .apache .spark .mllib .linalg .Vector
22
22
import org .apache .spark .mllib .optimization ._
23
+ import org .apache .spark .mllib .pmml .PMMLExportable
23
24
import org .apache .spark .mllib .regression .impl .GLMRegressionModel
24
25
import org .apache .spark .mllib .util .{Loader , Saveable }
25
26
import org .apache .spark .rdd .RDD
@@ -35,7 +36,7 @@ class RidgeRegressionModel (
35
36
override val weights : Vector ,
36
37
override val intercept : Double )
37
38
extends GeneralizedLinearModel (weights, intercept)
38
- with RegressionModel with Serializable with Saveable {
39
+ with RegressionModel with Serializable with Saveable with PMMLExportable {
39
40
40
41
override protected def predictPoint (
41
42
dataMatrix : Vector ,
You can’t perform that action at this time.
0 commit comments