def __init__(self, version_str, start_date, end_date, model_name, mock_flag, test_flag): self.start_date = start_date self.end_date = end_date self.version_str = version_str # type:haito, win etc. self.model_name = model_name #race or raceuma self._set_folder_path(version_str, model_name, test_flag) self._set_index_list(model_name) self._set_obj_column_list(version_str) mu.create_folder(self.model_folder) self.ld = self._get_load_object(version_str, start_date, end_date, mock_flag, test_flag) self.skmodel = self._get_skmodel_object(model_name, version_str, start_date, end_date, test_flag) self.test_flag = test_flag
def __init__(self, version_str, start_date, end_date, model_name, mock_flag, test_flag, obj_column_list): self.start_date = start_date self.end_date = end_date self.model_name = model_name self.dict_path = mc.return_base_path(test_flag) self._set_folder_path(version_str) self.model_folder = self.model_path + model_name + '/' mu.create_folder(self.model_folder) self.ld = self._get_load_object(version_str, start_date, end_date, mock_flag, test_flag) self.mock_flag = mock_flag self.test_flag = test_flag self.obj_column_list = obj_column_list
def run(self): """ 渡されたexp_data_nameに基づいてSK_DATA_MODELから説明変数のデータを取得する処理を実施。pickelファイル形式でデータを保存 """ print("----" + __class__.__name__ + ": run") mu.create_folder(self.intermediate_folder) if not self.test_flag: slack = OperationSlack() slack.post_slack_text(dt.now().strftime("%Y/%m/%d %H:%M:%S") + " start predict job:" + self.skmodel.version_str) with self.output().open("w") as target: predict_df = self.skmodel.create_predict_data() if not predict_df.empty: print("Sub_get_exp_data run: predict_df", predict_df.shape) predict_df.to_pickle(self.intermediate_folder + mu.convert_date_to_str(self.end_date) + '_exp_data.pkl') print(__class__.__name__ + " says: task finished".format(task=self.__class__.__name__))
def run(self): # SkModelを読んで学習データを作成する。すべてのデータを作成後、競馬場毎のデータを作成する print("----" + __class__.__name__ + ": run") mu.create_folder(self.intermediate_folder) if not self.test_flag: slack = OperationSlack() slack.post_slack_text(dt.now().strftime("%Y/%m/%d %H:%M:%S") + " start Sub_get_learning_data job:" + self.skmodel.version_str) with self.output().open("w") as target: print("------ learning_dfを作成") self.skmodel.create_learning_data() print("------ 学習用のデータを保存") self.skmodel.learning_df.to_pickle(self.intermediate_folder + '_learning_df.pkl') if not self.test_flag: slack.post_slack_text(dt.now().strftime("%Y/%m/%d %H:%M:%S") + " finish Sub_get_learning_data job:" + self.skmodel.version_str) print(__class__.__name__ + " says: task finished".format(task=self.__class__.__name__))
def _set_folder_path(self, mode): self.model_path = self.dict_path + 'model/' + self.version_str + '/' self.dict_folder = self.dict_path + 'dict/' + self.version_str + '/' self.pred_folder = self.dict_path + 'pred/' + self.version_str + '/' mu.create_folder(self.model_path) mu.create_folder(self.dict_folder) mu.create_folder(self.pred_folder)
def _set_folder_path(self, version_str): self.dict_folder = self.dict_path + 'dict/' + version_str + '/' self.model_path = self.dict_path + 'model/' + version_str + '/' self.ens_folder_path = self.dict_path + 'model/' + version_str + '/' mu.create_folder(self.dict_folder) mu.create_folder(self.model_path) mu.create_folder(self.ens_folder_path)
def _set_folder_path(self, version_str, model_name, test_flag): self.dict_path = mc.return_base_path(test_flag) self.dict_folder = self.dict_path + 'dict/' + version_str + '/' self.model_folder = self.dict_path + 'model/' + version_str + '/' self.pred_folder =self.dict_path + 'pred/' + version_str + '/' mu.create_folder(self.dict_folder) mu.create_folder(self.model_folder) mu.create_folder(self.pred_folder)