当前位置: 首页>>代码示例>>Java>>正文


Java ModelConfig.setProperty方法代码示例

本文整理汇总了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());
}
 
开发者ID:feedzai,项目名称:fos-weka,代码行数:12,代码来源:WekaClassifierFactoryTest.java

示例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());
}
 
开发者ID:feedzai,项目名称:fos-weka,代码行数:9,代码来源:WekaClassifierFactoryTest.java

示例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());
}
 
开发者ID:feedzai,项目名称:fos-weka,代码行数:10,代码来源:WekaClassifierFactoryTest.java

示例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);
    }
}
 
开发者ID:feedzai,项目名称:fos-r,代码行数:16,代码来源:RManager.java

示例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;
}
 
开发者ID:feedzai,项目名称:fos-r,代码行数:13,代码来源:RandomForestPMMLProducerConsumerTest.java


注:本文中的com.feedzai.fos.api.ModelConfig.setProperty方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。