@@ -46,11 +46,11 @@ private[mllib] class KMeansPMMLModelExport(model : KMeansModel) extends PMMLMode
46
46
/**
47
47
* Export the input KMeansModel model to PMML format
48
48
*/
49
- populateKMeansPMML(model);
49
+ populateKMeansPMML(model)
50
50
51
51
private def populateKMeansPMML (model : KMeansModel ): Unit = {
52
52
53
- pmml.getHeader().setDescription(" k-means clustering" );
53
+ pmml.getHeader().setDescription(" k-means clustering" )
54
54
55
55
if (model.clusterCenters.length > 0 ){
56
56
@@ -65,11 +65,11 @@ private[mllib] class KMeansPMMLModelExport(model : KMeansModel) extends PMMLMode
65
65
val comparisonMeasure = new ComparisonMeasure ()
66
66
.withKind(Kind .DISTANCE )
67
67
.withMeasure(new SquaredEuclidean ()
68
- );
68
+ )
69
69
70
70
val clusteringModel = new ClusteringModel (miningSchema, comparisonMeasure,
71
71
MiningFunctionType .CLUSTERING , ModelClass .CENTER_BASED , model.clusterCenters.length)
72
- .withModelName(" k-means" );
72
+ .withModelName(" k-means" )
73
73
74
74
for ( i <- 0 to (clusterCenter.size - 1 )) {
75
75
fields(i) = FieldName .create(" field_" + i)
@@ -83,7 +83,7 @@ private[mllib] class KMeansPMMLModelExport(model : KMeansModel) extends PMMLMode
83
83
)
84
84
}
85
85
86
- dataDictionary.withNumberOfFields((dataDictionary.getDataFields()).size());
86
+ dataDictionary.withNumberOfFields((dataDictionary.getDataFields()).size())
87
87
88
88
for ( i <- 0 until model.clusterCenters.size ) {
89
89
val cluster = new Cluster ()
@@ -97,8 +97,8 @@ private[mllib] class KMeansPMMLModelExport(model : KMeansModel) extends PMMLMode
97
97
clusteringModel.withClusters(cluster)
98
98
}
99
99
100
- pmml.setDataDictionary(dataDictionary);
101
- pmml.withModels(clusteringModel);
100
+ pmml.setDataDictionary(dataDictionary)
101
+ pmml.withModels(clusteringModel)
102
102
103
103
}
104
104
0 commit comments