predictionio随机森林-古蔺大橙子建站
RELATEED CONSULTING
相关咨询
选择下列产品马上在线沟通
服务时间:8:30-17:00
你可能遇到了下面的问题
关闭右侧工具栏

新闻中心

这里有您想知道的互联网营销解决方案
predictionio随机森林

其实predictionio 也是支持随机森林算法的,可惜官方的例子没有出现,我简单写了一点,您也可以参考这个地址:
https://github.com/runapal5/PredictionIO-DefectPrediction/blob/master/engine.json

员工经过长期磨合与沉淀,具备了协作精神,得以通过团队的力量开发出优质的产品。成都创新互联公司坚持“专注、创新、易用”的产品理念,因为“专注所以专业、创新互联网站所以易用所以简单”。公司专注于为企业提供成都做网站、成都网站建设、微信公众号开发、电商网站开发,微信小程序定制开发,软件定制网站开发等一站式互联网企业服务。

public class RandomForestAlgorithm extends P2LJavaAlgorithm {

    /**
     * 
     */
    private static final long serialVersionUID = 1L;

    private final RandomForestAlgorithmParams ap;

    public RandomForestAlgorithm(RandomForestAlgorithmParams ap) {
        this.ap = ap;
    }

    @Override
    public RandomForestModel train(SparkContext sc, PreparedData preparedData) {
        String datapath = "/root/whk/company.txt";
        JavaRDD treedata = MLUtils.loadLibSVMFile(sc, datapath).toJavaRDD();
        Map categoricalFeaturesInfo = new HashMap();
        return RandomForest.trainClassifier(treedata, ap.getNumClasses(), categoricalFeaturesInfo, ap.getNumTrees(),
                                     ap.getFeatureSubsetStrategy(),ap.getImpurity(),ap.getMaxDepth(),ap.getMaxBins(),12345);
    }

    @Override
    public PredictedResult predict(RandomForestModel model, final Query query) {
        double[] b={12,0,0};
        model.predict(Vectors.dense(b));                                  
        return null;
    }
}

本文题目:predictionio随机森林
网页链接:http://scgulin.cn/article/gophpj.html