Search in sources :

Example 1 with SVMRunner

use of com.tencent.angel.ml.classification.svm.SVMRunner in project angel by Tencent.

the class SVMTest method incLearnTest.

private void incLearnTest() throws Exception {
    try {
        String inputPath = "./src/test/data/lr/a9a.train";
        String logPath = "./src/test/log";
        // Set trainning data path
        conf.set(AngelConf.ANGEL_TRAIN_DATA_PATH, inputPath);
        // Set load model path
        conf.set(AngelConf.ANGEL_LOAD_MODEL_PATH, LOCAL_FS + TMP_PATH + "/SVMModel");
        // Set save model path
        conf.set(AngelConf.ANGEL_SAVE_MODEL_PATH, LOCAL_FS + TMP_PATH + "/newSVMModel");
        // Set actionType incremental train
        conf.set(AngelConf.ANGEL_ACTION_TYPE, MLConf.ANGEL_ML_INC_TRAIN());
        // Set log path
        conf.set(AngelConf.ANGEL_LOG_PATH, logPath);
        SVMRunner runner = new SVMRunner();
        runner.train(conf);
        AngelClient angelClient = AngelClientFactory.get(conf);
        angelClient.stop();
    } catch (Exception x) {
        LOG.error("run incLearnTest failed ", x);
        throw x;
    }
}
Also used : AngelClient(com.tencent.angel.client.AngelClient) SVMRunner(com.tencent.angel.ml.classification.svm.SVMRunner)

Example 2 with SVMRunner

use of com.tencent.angel.ml.classification.svm.SVMRunner in project angel by Tencent.

the class SVMTest method trainOnLocalClusterTest.

private void trainOnLocalClusterTest() throws Exception {
    try {
        // set input, output path
        String inputPath = "./src/test/data/lr/a9a.train";
        String logPath = "./src/test/log";
        conf.set(AngelConf.ANGEL_TRAIN_DATA_PATH, inputPath);
        // Set save model path
        conf.set(AngelConf.ANGEL_SAVE_MODEL_PATH, LOCAL_FS + TMP_PATH + "/SVMModel");
        // Set actionType train
        conf.set(AngelConf.ANGEL_ACTION_TYPE, MLConf.ANGEL_ML_TRAIN());
        // Set log path
        conf.set(AngelConf.ANGEL_LOG_PATH, logPath);
        // Submit LR Train Task
        SVMRunner runner = new SVMRunner();
        runner.train(conf);
    } catch (Exception x) {
        LOG.error("run trainOnLocalClusterTest failed ", x);
        throw x;
    }
}
Also used : SVMRunner(com.tencent.angel.ml.classification.svm.SVMRunner)

Aggregations

SVMRunner (com.tencent.angel.ml.classification.svm.SVMRunner)2 AngelClient (com.tencent.angel.client.AngelClient)1