Skip to content

Commit e29dfb9

Browse files
committed
removed version, by default is set to 4.2 (latest from jpmml)
removed copyright
1 parent ae8b993 commit e29dfb9

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

mllib/src/main/scala/org/apache/spark/mllib/export/pmml/KMeansPMMLModelExport.scala

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,11 @@ private[mllib] class KMeansPMMLModelExport(model : KMeansModel) extends PMMLMode
4646
/**
4747
* Export the input KMeansModel model to PMML format
4848
*/
49-
populateKMeansPMML(model);
49+
populateKMeansPMML(model)
5050

5151
private def populateKMeansPMML(model : KMeansModel): Unit = {
5252

53-
pmml.getHeader().setDescription("k-means clustering");
53+
pmml.getHeader().setDescription("k-means clustering")
5454

5555
if(model.clusterCenters.length > 0){
5656

@@ -65,11 +65,11 @@ private[mllib] class KMeansPMMLModelExport(model : KMeansModel) extends PMMLMode
6565
val comparisonMeasure = new ComparisonMeasure()
6666
.withKind(Kind.DISTANCE)
6767
.withMeasure(new SquaredEuclidean()
68-
);
68+
)
6969

7070
val clusteringModel = new ClusteringModel(miningSchema, comparisonMeasure,
7171
MiningFunctionType.CLUSTERING, ModelClass.CENTER_BASED, model.clusterCenters.length)
72-
.withModelName("k-means");
72+
.withModelName("k-means")
7373

7474
for ( i <- 0 to (clusterCenter.size - 1)) {
7575
fields(i) = FieldName.create("field_" + i)
@@ -83,7 +83,7 @@ private[mllib] class KMeansPMMLModelExport(model : KMeansModel) extends PMMLMode
8383
)
8484
}
8585

86-
dataDictionary.withNumberOfFields((dataDictionary.getDataFields()).size());
86+
dataDictionary.withNumberOfFields((dataDictionary.getDataFields()).size())
8787

8888
for ( i <- 0 until model.clusterCenters.size ) {
8989
val cluster = new Cluster()
@@ -97,8 +97,8 @@ private[mllib] class KMeansPMMLModelExport(model : KMeansModel) extends PMMLMode
9797
clusteringModel.withClusters(cluster)
9898
}
9999

100-
pmml.setDataDictionary(dataDictionary);
101-
pmml.withModels(clusteringModel);
100+
pmml.setDataDictionary(dataDictionary)
101+
pmml.withModels(clusteringModel)
102102

103103
}
104104

mllib/src/main/scala/org/apache/spark/mllib/export/pmml/PMMLModelExport.scala

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,9 @@ private[mllib] trait PMMLModelExport extends ModelExport{
4545
val timestamp = new Timestamp()
4646
.withContent(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss").format(new Date()))
4747
val header = new Header()
48-
.withCopyright("Apache Spark MLlib")
4948
.withApplication(app)
50-
.withTimestamp(timestamp);
51-
pmml.setHeader(header);
52-
pmml.setVersion("4.2")
49+
.withTimestamp(timestamp)
50+
pmml.setHeader(header)
5351
}
5452

5553
}

0 commit comments

Comments
 (0)