public PMML encodePMML(FieldName targetField, List<String> targetCategories, FeatureMap featureMap, Map<String, ?> options){ XGBoostEncoder encoder = new XGBoostEncoder(); if(targetField == null){ targetField = FieldName.create("_target"); } Label label = this.obj.encodeLabel(targetField, targetCategories, encoder); List<Feature> features = featureMap.encodeFeatures(encoder); Schema schema = new Schema(label, features); MiningModel miningModel = encodeMiningModel(options, schema); PMML pmml = encoder.encodePMML(miningModel); return pmml; }
static public Learner loadLearner(InputStream is, ByteOrder byteOrder, String charset) throws IOException { XGBoostDataInput input = new XGBoostDataInput(is, byteOrder, charset); Learner learner = new Learner(); learner.load(input); int eof = is.read(); if(eof != -1){ throw new IOException(); } return learner; }
public void addEntry(String name, String type){ String value = null; if(("i").equals(type)){ int equals = name.indexOf('='); if(equals < 0){ throw new IllegalArgumentException(name); } value = name.substring(equals + 1); name = name.substring(0, equals); } Entry entry = new Entry(name, value, type); addEntry(entry); }
public void addMissingValue(String value){ addValue(Value.Property.MISSING, value); }
@Override public MiningModel encodeMiningModel(List<RegTree> regTrees, float base_score, Integer ntreeLimit, Schema schema){ MiningModel miningModel = createMiningModel(regTrees, base_score, ntreeLimit, schema); return miningModel; } }
public MiningModel encodeMiningModel(ObjFunction obj, float base_score, Integer ntreeLimit, Schema schema){ return obj.encodeMiningModel(this.trees, base_score, ntreeLimit, schema); }
public PMML encodePMML(FieldName targetField, List<String> targetCategories, FeatureMap featureMap, Map<String, ?> options){ XGBoostEncoder encoder = new XGBoostEncoder(); if(targetField == null){ targetField = FieldName.create("_target"); } Label label = this.obj.encodeLabel(targetField, targetCategories, encoder); List<Feature> features = featureMap.encodeFeatures(encoder); Schema schema = new Schema(label, features); MiningModel miningModel = encodeMiningModel(options, schema); PMML pmml = encoder.encodePMML(miningModel); return pmml; }
static public Learner loadLearner(InputStream is, ByteOrder byteOrder, String charset) throws IOException { XGBoostDataInput input = new XGBoostDataInput(is, byteOrder, charset); Learner learner = new Learner(); learner.load(input); int eof = is.read(); if(eof != -1){ throw new IOException(); } return learner; }
public void addValidValue(String value){ addValue(Value.Property.VALID, value); }
@Override public MiningModel encodeMiningModel(List<RegTree> regTrees, float base_score, Integer ntreeLimit, Schema schema){ MiningModel miningModel = createMiningModel(regTrees, base_score, ntreeLimit, schema); return miningModel; } }
public MiningModel encodeMiningModel(ObjFunction obj, float base_score, Integer ntreeLimit, Schema schema){ return obj.encodeMiningModel(this.trees, base_score, ntreeLimit, schema); }
public void addInvalidValue(String value){ addValue(Value.Property.INVALID, value); }
public void addInvalidValue(String value){ addValue(Value.Property.INVALID, value); }
public void addMissingValue(String value){ addValue(Value.Property.MISSING, value); }