Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _get_file_path(model, X, y):
func_path_ = "model_id:" + get_model_id(model) + "/"
func_path = meta_path + func_path_
feature_hash = get_hash(X)
label_hash = get_hash(y)
return func_path + (feature_hash + "_" + label_hash + "_.csv")
def _get_file_path(model, X, y):
func_path_ = "model_id:" + get_model_id(model) + "/"
func_path = meta_path + func_path_
feature_hash = get_hash(X)
label_hash = get_hash(y)
return func_path + (feature_hash + "_" + label_hash + "_.csv")
return None
for key in memory_dict.keys():
pos = np.fromstring(key, dtype=int)
para = self._space_.pos2para(pos)
score = memory_dict[key]
for key in para.keys():
if (
not isinstance(para[key], int)
and not isinstance(para[key], float)
and not isinstance(para[key], str)
):
para_dill = dill.dumps(para[key])
para_hash = get_hash(para_dill)
with open(
self.model_path + str(para_hash) + ".pkl", "wb"
) as pickle_file:
dill.dump(para_dill, pickle_file)
para[key] = para_hash
if score != 0:
para_list.append(para)
score_list.append(score)
results_dict["params"] = para_list
results_dict["_score_"] = score_list
return results_dict
def get_meta_data_name(X, y):
feature_hash = get_hash(X)
label_hash = get_hash(y)
return "dataset_id:" + feature_hash + "_" + label_hash + "_.csv"
def get_meta_data_name(X, y):
feature_hash = get_hash(X)
label_hash = get_hash(y)
return "dataset_id:" + feature_hash + "_" + label_hash + "_.csv"