本文整理汇总了Java中org.jpmml.model.visitors.MiningSchemaCleaner类的典型用法代码示例。如果您正苦于以下问题:Java MiningSchemaCleaner类的具体用法?Java MiningSchemaCleaner怎么用?Java MiningSchemaCleaner使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
MiningSchemaCleaner类属于org.jpmml.model.visitors包,在下文中一共展示了MiningSchemaCleaner类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: encodePMML
import org.jpmml.model.visitors.MiningSchemaCleaner; //导入依赖的package包/类
public PMML encodePMML(Model model){
PMML pmml = encodePMML();
pmml.addModels(model);
List<? extends Visitor> visitors = Arrays.asList(new MiningSchemaCleaner(), new TransformationDictionaryCleaner(), new DataDictionaryCleaner());
for(Visitor visitor : visitors){
visitor.applyTo(pmml);
}
MiningSchema miningSchema = model.getMiningSchema();
List<MiningField> miningFields = miningSchema.getMiningFields();
for(MiningField miningField : miningFields){
FieldName name = miningField.getName();
List<Decorator> decorators = getDecorators(name);
if(decorators == null){
continue;
}
DataField dataField = getDataField(name);
if(dataField == null){
throw new IllegalArgumentException();
}
for(Decorator decorator : decorators){
decorator.decorate(dataField, miningField);
}
}
Collection<Map.Entry<FieldName, FieldName>> entries = this.renamedFields.entrySet();
for(Map.Entry<FieldName, FieldName> entry : entries){
FieldRenamer renamer = new FieldRenamer(entry.getKey(), entry.getValue());
renamer.applyTo(pmml);
}
return pmml;
}