Search in sources :

Example 1 with DTMasterParams

use of ml.shifu.shifu.core.dtrain.dt.DTMasterParams 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 DTMasterParams

use of ml.shifu.shifu.core.dtrain.dt.DTMasterParams 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)

Aggregations

Properties (java.util.Properties)2 GuaguaMRUnitDriver (ml.shifu.guagua.hadoop.GuaguaMRUnitDriver)2 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