本文整理汇总了Java中com.feedzai.fos.api.ModelConfig.setProperty方法的典型用法代码示例。如果您正苦于以下问题:Java ModelConfig.setProperty方法的具体用法?Java ModelConfig.setProperty怎么用?Java ModelConfig.setProperty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.feedzai.fos.api.ModelConfig
的用法示例。
在下文中一共展示了ModelConfig.setProperty方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testMultipleModels
import com.feedzai.fos.api.ModelConfig; //导入方法依赖的package包/类
@Test
public void testMultipleModels() throws FOSException {
ModelConfig modelConfig = new ModelConfig();
modelConfig.setProperty(WekaModelConfig.CLASSIFIER_IMPL, Vote.class.getName());
modelConfig.setProperty(WekaModelConfig.CLASSIFIER_CONFIG, "-R MAX -B \""+J48.class.getName()+"\" -B \"" + NaiveBayes.class.getName() + "\"");
MultipleClassifiersCombiner classifier = (MultipleClassifiersCombiner)WekaClassifierFactory.create(modelConfig);
Assert.assertEquals(2,classifier.getClassifiers().length);
Assert.assertEquals(J48.class,classifier.getClassifiers()[0].getClass());
Assert.assertEquals(NaiveBayes.class,classifier.getClassifiers()[1].getClass());
}
示例2: testOneModel
import com.feedzai.fos.api.ModelConfig; //导入方法依赖的package包/类
@Test
public void testOneModel() throws FOSException {
ModelConfig modelConfig = new ModelConfig();
modelConfig.setProperty(WekaModelConfig.CLASSIFIER_IMPL, J48.class.getName());
Classifier classifier = WekaClassifierFactory.create(modelConfig);
Assert.assertEquals(J48.class, classifier.getClass());
}
示例3: testFastRandomForestModel
import com.feedzai.fos.api.ModelConfig; //导入方法依赖的package包/类
@Test
public void testFastRandomForestModel() throws FOSException {
ModelConfig modelConfig = new ModelConfig();
modelConfig.setProperty(WekaModelConfig.CLASSIFIER_IMPL, "hr.irb.fastRandomForest.FastRandomForest");
Classifier classifier = WekaClassifierFactory.create(modelConfig);
Assert.assertEquals("A FastRandomForest model was created", FastRandomForest.class, classifier.getClass());
}
示例4: trainAndAdd
import com.feedzai.fos.api.ModelConfig; //导入方法依赖的package包/类
@Override
public synchronized UUID trainAndAdd(ModelConfig config, List<Object[]> instances) throws FOSException {
try {
File instanceFile = writeInstancesToTempFile(instances, config.getAttributes());
config.setProperty(RModelConfig.MODEL_SAVE_PATH, instanceFile.getParent());
trainFile(config, instanceFile.getAbsolutePath());
String trainedModelPath = new File(instanceFile.getParent(), instanceFile.getName() + "." + RModelConfig.MODEL_FILE_EXTENSION).getAbsolutePath();
ModelDescriptor trainedModelDescriptor = new ModelDescriptor(ModelDescriptor.Format.BINARY, trainedModelPath);
return addModel(config, trainedModelDescriptor);
} catch (IOException e) {
throw new FOSException(e);
}
}
示例5: setupConfig
import com.feedzai.fos.api.ModelConfig; //导入方法依赖的package包/类
private ModelConfig setupConfig() {
Map<String, String> properties = new HashMap<>();
List<Attribute> attributes = RIntegrationTest.getAttributes();
ModelConfig modelConfig = new ModelConfig(attributes, properties);
modelConfig.setProperty(RModelConfig.LIBRARIES, "randomForest, foreign");
modelConfig.setProperty(RModelConfig.TRAIN_FUNCTION, "randomForest");
modelConfig.setProperty(RModelConfig.TRAIN_FUNCTION_ARGUMENTS, "na.action = na.roughfix");
modelConfig.setProperty(RModelConfig.CLASS_INDEX, Integer.valueOf(attributes.size() - 1).toString());
return modelConfig;
}