Skip to content

Commit

Permalink
Refactored ObjectiveFunction class
Browse files Browse the repository at this point in the history
  • Loading branch information
vruusmann committed Jul 14, 2024
1 parent 6de0be4 commit cfed33f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import org.jpmml.converter.CategoricalLabel;
import org.jpmml.converter.Label;
import org.jpmml.converter.LabelUtil;
import org.jpmml.converter.PMMLEncoder;
import org.jpmml.converter.ModelEncoder;

abstract
public class Classification extends ObjectiveFunction {
Expand All @@ -41,7 +41,7 @@ public Classification(Section config){
}

@Override
public Label encodeLabel(String targetName, List<?> targetCategories, PMMLEncoder encoder){
public Label encodeLabel(String targetName, List<?> targetCategories, ModelEncoder encoder){
DataField dataField;

if(targetCategories == null){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
import org.dmg.pmml.tree.TreeModel;
import org.jpmml.converter.ContinuousLabel;
import org.jpmml.converter.Label;
import org.jpmml.converter.ModelEncoder;
import org.jpmml.converter.ModelUtil;
import org.jpmml.converter.PMMLEncoder;
import org.jpmml.converter.PredicateManager;
import org.jpmml.converter.Schema;
import org.jpmml.converter.mining.MiningModelUtil;
Expand All @@ -47,7 +47,7 @@ public ObjectiveFunction(Section config){
}

abstract
public Label encodeLabel(String targetName, List<?> targetCategories, PMMLEncoder encoder);
public Label encodeLabel(String targetName, List<?> targetCategories, ModelEncoder encoder);

abstract
public MiningModel encodeModel(List<Tree> trees, Integer numIteration, Schema schema);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import org.dmg.pmml.mining.MiningModel;
import org.jpmml.converter.ContinuousLabel;
import org.jpmml.converter.Label;
import org.jpmml.converter.PMMLEncoder;
import org.jpmml.converter.ModelEncoder;
import org.jpmml.converter.Schema;

public class Regression extends ObjectiveFunction {
Expand All @@ -36,7 +36,7 @@ public Regression(Section config){
}

@Override
public Label encodeLabel(String targetName, List<?> targetCategories, PMMLEncoder encoder){
public Label encodeLabel(String targetName, List<?> targetCategories, ModelEncoder encoder){

if(targetCategories != null && targetCategories.size() > 0){
throw new IllegalArgumentException("Regression requires zero target categories");
Expand Down

0 comments on commit cfed33f

Please sign in to comment.