def predict(self): self.set_conf() input_path = "../data/exampledata/LinearRegression/LinearReg100.train" LOCAL_FS = LocalFileSystem.DEFAULT_FS TMP_PATH = tempfile.gettempdir() # Set trainning data path self.conf.set(AngelConf.ANGEL_TRAIN_DATA_PATH, inputPath) # Set load model path self.conf.set(AngelConf.ANGEL_LOAD_MODEL_PATH, LOCAL_FS + TMP_PATH + "/model") # Set predict result path self.conf.set(AngelConf.ANGEL_PREDICT_PATH, LOCAL_FS + TMP_PATH + "/predict") # Set actionType prediction self.conf.set(AngelConf.ANGEL_ACTION_TYPE, MLConf.ANGEL_ML_PREDICT()) runner = LinearRegRunner() runner.predict(self.conf)
def predict(self): self.set_conf() input_path = "data/exampledata/LinearRegression/LinearReg100.train" LOCAL_FS = LocalFileSystem.DEFAULT_FS TMP_PATH = tempfile.gettempdir() # Set trainning data path self.conf[AngelConf.ANGEL_TRAIN_DATA_PATH] = input_path # Set load model path self.conf[AngelConf.ANGEL_LOAD_MODEL_PATH] = LOCAL_FS + TMP_PATH + "/model" # Set predict result path self.conf[AngelConf.ANGEL_PREDICT_PATH] = LOCAL_FS + TMP_PATH + "/predict" # Set actionType prediction self.conf[AngelConf.ANGEL_ACTION_TYPE] = MLConf.ANGEL_ML_PREDICT runner = LinearRegRunner() runner.predict(self.conf)
def train_on_local_cluster(self): """ Train model on local cluster """ self.set_conf() input_path = 'data/exampledata/LinearRegression' LOCAL_FS = LocalFileSystem.DEFAULT_FS TMP_PATH = tempfile.gettempdir() log_path = ".src/test/log" model_path = 'file:///tmp/angel/model' self.conf[AngelConf.ANGEL_TRAIN_DATA_PATH] = input_path self.conf[AngelConf.ANGEL_SAVE_MODEL_PATH] = model_path self.conf[AngelConf.ANGEL_LOG_PATH] = log_path self.conf[AngelConf.ANGEL_ACTION_TYPE] = MLConf.ANGEL_ML_TRAIN self.conf['fs.defaultFS'] = LOCAL_FS + TMP_PATH runner = LinearRegRunner() runner.train(self.conf)
def train_on_local_cluster(self): """ Train model on local cluster """ self.set_conf() input_path = '../data/exampledata/LinearRegression' LOCAL_FS = LocalFileSystem.DEFAULT_FS TMP_PATH = tempfile.gettempdir() log_path = ".src/test/log" model_path = 'file:///tmp/angel/model' self.conf.set(AngelConf.ANGEL_TRAIN_DATA_PATH, input_path) self.conf.set(AngelConf.ANGEL_SAVE_MODEL_PATH, model_path) self.conf.set(AngelConf.ANGEL_LOG_PATH, log_path) self.conf.set(AngelConf.ANGEL_ACTION_TYPE, MLConf.ANGEL_ML_TRAIN) self.conf.set("fs.defaultFS", LOCAL_FS + TMP_PATH) runner = LinearRegRunner() runner.train(self.conf)
def inc_train(self): self.set_conf() input_path = "../data/exampledata/LinearRegression/LinearReg100.train" LOCAL_FS = LocalFileSystem.DEFAULT_FS TMP_PATH = tempfile.gettempdir() log_path = "./src/test/log" # Set trainning data path self.conf.set(AngelConf.ANGEL_TRAIN_DATA_PATH, inputPath) # Set load model path self.conf.set(AngelConf.ANGEL_LOAD_MODEL_PATH, LOCAL_FS + TMP_PATH + "/model") # Set save model path self.conf.set(AngelConf.ANGEL_SAVE_MODEL_PATH, LOCAL_FS + TMP_PATH + "/newmodel") # Set actionType incremental train self.conf.set(AngelConf.ANGEL_ACTION_TYPE, MLConf.ANGEL_ML_INC_TRAIN()) # Set log path self.conf.set(AngelConf.ANGEL_LOG_PATH, logPath) runner = LinearRegRunner() runner.incTrain(self.conf)
def inc_train(self): self.set_conf() input_path = "data/exampledata/LinearRegression/LinearReg100.train" LOCAL_FS = LocalFileSystem.DEFAULT_FS TMP_PATH = tempfile.gettempdir() log_path = "./src/test/log" # Set trainning data path self.conf[AngelConf.ANGEL_TRAIN_DATA_PATH] = inputPath # Set load model path self.conf[AngelConf.ANGEL_LOAD_MODEL_PATH] = LOCAL_FS + TMP_PATH + "/model" # Set save model path self.conf[AngelConf.ANGEL_SAVE_MODEL_PATH] = LOCAL_FS + TMP_PATH + "/newmodel" # Set actionType incremental train self.conf[AngelConf.ANGEL_ACTION_TYPE] = MLConf.ANGEL_ML_INC_TRAIN # Set log path self.conf[AngelConf.ANGEL_LOG_PATH] = logPath runner = LinearRegRunner() runner.incTrain(self.conf)