zoo.automl.common package¶
Submodules¶
zoo.automl.common.metrics module¶
zoo.automl.common.parameters module¶
zoo.automl.common.util module¶
-
class
zoo.automl.common.util.NumpyEncoder(*, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, sort_keys=False, indent=None, separators=None, default=None)[source]¶ Bases:
json.encoder.JSONEncoderconvert numpy array to list for JSON serialize
-
default(obj)[source]¶ Implement this method in a subclass such that it returns a serializable object for
o, or calls the base implementation (to raise aTypeError).For example, to support arbitrary iterators, you could implement default like this:
def default(self, o): try: iterable = iter(o) except TypeError: pass else: return list(iterable) # Let the base class default method raise the TypeError return JSONEncoder.default(self, o)
-
-
zoo.automl.common.util.restore_hdfs(model_path, remote_dir, feature_transformers=None, model=None, config=None)[source]¶
-
zoo.automl.common.util.restore_zip(file, feature_transformers=None, model=None, config=None)[source]¶
-
zoo.automl.common.util.save_config(file_path, config, replace=False)[source]¶ Parameters: - file_path – the file path of config to be saved.
- config – dict. The config to be saved
- replace – whether to replace if the config file already existed.
Returns:
-
zoo.automl.common.util.train_val_test_split(df, val_ratio=0, test_ratio=0.1, look_back=0, horizon=1)[source]¶ split input dataframe into train_df, val_df and test_df according to split ratio. The dataframe is splitted in its originally order in timeline. e.g. |......... train_df(80%) ........ | ... val_df(10%) ...| …test_df(10%)…| :param df: dataframe to be splitted :param val_ratio: validation ratio :param test_ratio: test ratio :param look_back: the length to look back :param horizon: num of steps to look forward :return: