Skip to content

Commit f1fc85c

Browse files
committed
Fixed the serializability of GeneralRegressionModelEvaluator instances
1 parent b34a0ca commit f1fc85c

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

pmml-evaluator/src/main/java/org/jpmml/evaluator/general_regression/GeneralRegressionModelEvaluator.java

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
*/
1919
package org.jpmml.evaluator.general_regression;
2020

21+
import java.io.Serializable;
2122
import java.util.ArrayList;
2223
import java.util.Collection;
2324
import java.util.Collections;
@@ -1021,7 +1022,7 @@ private <K, C extends ParameterCell> ListMultimap<K, C> groupCells(List<C> cells
10211022
}
10221023

10231024
static
1024-
private class Row {
1025+
private class Row implements Serializable {
10251026

10261027
private List<FactorHandler> factorHandlers = new ArrayList<>();
10271028

@@ -1110,11 +1111,15 @@ public List<CovariateHandler> getCovariateHandlers(){
11101111
}
11111112

11121113
abstract
1113-
private class PredictorHandler {
1114+
static
1115+
private class PredictorHandler implements Serializable {
11141116

11151117
private PPCell ppCell = null;
11161118

11171119

1120+
private PredictorHandler(){
1121+
}
1122+
11181123
private PredictorHandler(PPCell ppCell){
11191124
setPPCell(ppCell);
11201125

@@ -1142,11 +1147,15 @@ private void setPPCell(PPCell ppCell){
11421147
}
11431148
}
11441149

1150+
static
11451151
private class FactorHandler extends PredictorHandler {
11461152

11471153
private Object category = null;
11481154

11491155

1156+
private FactorHandler(){
1157+
}
1158+
11501159
private FactorHandler(PPCell ppCell){
11511160
super(ppCell);
11521161

@@ -1176,6 +1185,7 @@ private void setCategory(Object category){
11761185
}
11771186
}
11781187

1188+
static
11791189
private class ContrastMatrixHandler extends FactorHandler {
11801190

11811191
private Matrix matrix = null;
@@ -1185,6 +1195,9 @@ private class ContrastMatrixHandler extends FactorHandler {
11851195
private List<FieldValue> parsedCategories = null;
11861196

11871197

1198+
private ContrastMatrixHandler(){
1199+
}
1200+
11881201
private ContrastMatrixHandler(PPCell ppCell, Matrix matrix, List<Object> categories){
11891202
super(ppCell);
11901203

@@ -1250,11 +1263,15 @@ private void setCategories(List<Object> categories){
12501263
}
12511264
}
12521265

1266+
static
12531267
private class CovariateHandler extends PredictorHandler {
12541268

12551269
private Number exponent = null;
12561270

12571271

1272+
private CovariateHandler(){
1273+
}
1274+
12581275
private CovariateHandler(PPCell ppCell){
12591276
super(ppCell);
12601277

0 commit comments

Comments
 (0)