Search in sources :

Example 1 with GuaguaMRUnitDriver

use of ml.shifu.guagua.hadoop.GuaguaMRUnitDriver in project shifu by ShifuML.

the class DTTest method testCamDtApp.

// @Test
public void testCamDtApp() throws IOException {
    Properties props = new Properties();
    props.setProperty(GuaguaConstants.MASTER_COMPUTABLE_CLASS, DTMaster.class.getName());
    props.setProperty(GuaguaConstants.WORKER_COMPUTABLE_CLASS, DTWorker.class.getName());
    props.setProperty(GuaguaConstants.GUAGUA_ITERATION_COUNT, "20");
    props.setProperty(GuaguaConstants.GUAGUA_MASTER_RESULT_CLASS, DTMasterParams.class.getName());
    props.setProperty(GuaguaConstants.GUAGUA_WORKER_RESULT_CLASS, DTWorkerParams.class.getName());
    props.setProperty(CommonConstants.MODELSET_SOURCE_TYPE, "LOCAL");
    props.setProperty(CommonConstants.SHIFU_MODEL_CONFIG, getClass().getResource("/test/config/ModelConfig.json").toString());
    props.setProperty(CommonConstants.SHIFU_COLUMN_CONFIG, getClass().getResource("/test/config/ColumnConfig.json").toString());
    props.setProperty(GuaguaConstants.GUAGUA_INPUT_DIR, getClass().getResource("/test/data/").toString());
    GuaguaUnitDriver<DTMasterParams, DTWorkerParams> driver = new GuaguaMRUnitDriver<DTMasterParams, DTWorkerParams>(props);
    driver.run();
}
Also used : GuaguaMRUnitDriver(ml.shifu.guagua.hadoop.GuaguaMRUnitDriver) DTMasterParams(ml.shifu.shifu.core.dtrain.dt.DTMasterParams) DTWorkerParams(ml.shifu.shifu.core.dtrain.dt.DTWorkerParams) Properties(java.util.Properties) DTWorker(ml.shifu.shifu.core.dtrain.dt.DTWorker) DTMaster(ml.shifu.shifu.core.dtrain.dt.DTMaster)

Example 2 with GuaguaMRUnitDriver

use of ml.shifu.guagua.hadoop.GuaguaMRUnitDriver in project shifu by ShifuML.

the class DTTest method testDtApp.

// @Test
public void testDtApp() throws IOException {
    Properties props = new Properties();
    props.setProperty(GuaguaConstants.MASTER_COMPUTABLE_CLASS, DTMaster.class.getName());
    props.setProperty(GuaguaConstants.WORKER_COMPUTABLE_CLASS, DTWorker.class.getName());
    props.setProperty(GuaguaConstants.GUAGUA_ITERATION_COUNT, "20");
    props.setProperty(GuaguaConstants.GUAGUA_MASTER_RESULT_CLASS, DTMasterParams.class.getName());
    props.setProperty(GuaguaConstants.GUAGUA_WORKER_RESULT_CLASS, DTWorkerParams.class.getName());
    props.setProperty(CommonConstants.MODELSET_SOURCE_TYPE, "LOCAL");
    props.setProperty(CommonConstants.SHIFU_MODEL_CONFIG, getClass().getResource("/test/config/ModelConfig.json").toString());
    props.setProperty(CommonConstants.SHIFU_COLUMN_CONFIG, getClass().getResource("/test/config/ColumnConfig.json").toString());
    props.setProperty(GuaguaConstants.GUAGUA_INPUT_DIR, getClass().getResource("/test/data/").toString());
    GuaguaUnitDriver<DTMasterParams, DTWorkerParams> driver = new GuaguaMRUnitDriver<DTMasterParams, DTWorkerParams>(props);
    driver.run();
}
Also used : GuaguaMRUnitDriver(ml.shifu.guagua.hadoop.GuaguaMRUnitDriver) DTMasterParams(ml.shifu.shifu.core.dtrain.dt.DTMasterParams) DTWorkerParams(ml.shifu.shifu.core.dtrain.dt.DTWorkerParams) Properties(java.util.Properties) DTWorker(ml.shifu.shifu.core.dtrain.dt.DTWorker) DTMaster(ml.shifu.shifu.core.dtrain.dt.DTMaster)

Example 3 with GuaguaMRUnitDriver

use of ml.shifu.guagua.hadoop.GuaguaMRUnitDriver in project shifu by ShifuML.

the class VotedVarSelTest method testLrApp.

// @Test
public void testLrApp() throws IOException {
    Properties props = new Properties();
    props.setProperty(GuaguaConstants.MASTER_COMPUTABLE_CLASS, VarSelWorker.class.getName());
    props.setProperty(GuaguaConstants.WORKER_COMPUTABLE_CLASS, VarSelMaster.class.getName());
    props.setProperty(GuaguaConstants.GUAGUA_ITERATION_COUNT, "20");
    props.setProperty(GuaguaConstants.GUAGUA_MASTER_RESULT_CLASS, VarSelMasterResult.class.getName());
    props.setProperty(GuaguaConstants.GUAGUA_WORKER_RESULT_CLASS, VarSelWorkerResult.class.getName());
    props.setProperty(GuaguaConstants.GUAGUA_INPUT_DIR, getClass().getResource("/example/cancer-judgement/DataStore/DataSet1/part-00").toString());
    GuaguaUnitDriver<VarSelMasterResult, VarSelWorkerResult> driver = new GuaguaMRUnitDriver<VarSelMasterResult, VarSelWorkerResult>(props);
    driver.run();
}
Also used : GuaguaMRUnitDriver(ml.shifu.guagua.hadoop.GuaguaMRUnitDriver) VarSelMaster(ml.shifu.shifu.core.dvarsel.VarSelMaster) VarSelMasterResult(ml.shifu.shifu.core.dvarsel.VarSelMasterResult) VarSelWorker(ml.shifu.shifu.core.dvarsel.VarSelWorker) VarSelWorkerResult(ml.shifu.shifu.core.dvarsel.VarSelWorkerResult) Properties(java.util.Properties)

Aggregations

Properties (java.util.Properties)3 GuaguaMRUnitDriver (ml.shifu.guagua.hadoop.GuaguaMRUnitDriver)3 DTMaster (ml.shifu.shifu.core.dtrain.dt.DTMaster)2 DTMasterParams (ml.shifu.shifu.core.dtrain.dt.DTMasterParams)2 DTWorker (ml.shifu.shifu.core.dtrain.dt.DTWorker)2 DTWorkerParams (ml.shifu.shifu.core.dtrain.dt.DTWorkerParams)2 VarSelMaster (ml.shifu.shifu.core.dvarsel.VarSelMaster)1 VarSelMasterResult (ml.shifu.shifu.core.dvarsel.VarSelMasterResult)1 VarSelWorker (ml.shifu.shifu.core.dvarsel.VarSelWorker)1 VarSelWorkerResult (ml.shifu.shifu.core.dvarsel.VarSelWorkerResult)1