How to use the hyperactive.memory.util.get_hash function in hyperactive

To help you get started, we’ve selected a few hyperactive examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github SimonBlanke / Hyperactive / hyperactive / memory / memory_helper.py View on Github external
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")
github SimonBlanke / Hyperactive / hyperactive / memory / memory_helper.py View on Github external
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")
github SimonBlanke / Hyperactive / hyperactive / memory / memory_dump.py View on Github external
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
github SimonBlanke / Hyperactive / hyperactive / memory / paths.py View on Github external
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"
github SimonBlanke / Hyperactive / hyperactive / memory / paths.py View on Github external
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"