autoflow.utils package

Submodules

autoflow.utils.array module

autoflow.utils.concurrence module

autoflow.utils.concurrence.get_chunks(iterable, chunks=1)[source]
autoflow.utils.concurrence.parse_n_jobs(n_jobs)[source]

autoflow.utils.config_space module

class autoflow.utils.config_space.ConfigSpaceGrid(configuration_space: ConfigSpace.configuration_space.ConfigurationSpace)[source]

Bases: object

generate_grid(num_steps_dict: Union[None, Dict[str, int]] = None) → List[ConfigSpace.configuration_space.Configuration][source]

Generates a grid of Configurations for a given ConfigurationSpace. Can be used, for example, for grid search.

Parameters
  • configuration_space (ConfigurationSpace) – The Configuration space over which to create a grid of HyperParameter Configuration values. It knows the types for all parameter values.

  • num_steps_dict (dict) – A dict containing the number of points to divide the grid side formed by Hyperparameters which are either of type UniformFloatHyperparameter or type UniformIntegerHyperparameter. The keys in the dict should be the names of the corresponding Hyperparameters and the values should be the number of points to divide the grid side formed by the corresponding Hyperparameter in to.

Returns

List containing Configurations. It is a cartesian product of tuples of HyperParameter values. Each tuple lists the possible values taken by the corresponding HyperParameter. Within the cartesian product, in each element, the ordering of HyperParameters is the same for the OrderedDict within the ConfigurationSpace.

Return type

list

get_cartesian_product(value_sets, hp_names)[source]
get_value_set(num_steps_dict, hp_name)[source]
autoflow.utils.config_space.estimate_config_space_numbers(cs: ConfigSpace.configuration_space.ConfigurationSpace)[source]
autoflow.utils.config_space.get_grid_initial_configs(shps: ConfigSpace.configuration_space.ConfigurationSpace, n_configs=- 1, random_state=42)[source]
autoflow.utils.config_space.get_random_initial_configs(shps: ConfigSpace.configuration_space.ConfigurationSpace, n_configs, random_state=42) → List[ConfigSpace.configuration_space.Configuration][source]
autoflow.utils.config_space.replace_phps(shps: ConfigSpace.configuration_space.ConfigurationSpace, key, value)[source]

autoflow.utils.data module

autoflow.utils.data.convert_to_bin(Ycont, nval, verbose=True)[source]
autoflow.utils.data.convert_to_num(Ybin)[source]

Convert binary targets to numeric vector typically classification target values :param Ybin: :return:

autoflow.utils.data.densify(X)[source]
autoflow.utils.data.finite_array(array)[source]

Replace NaN and Inf (there should not be any!) :param array: :return:

autoflow.utils.data.is_cat(s: Union[pandas.core.series.Series, numpy.ndarray], consider_ordinal_as_cat)[source]
autoflow.utils.data.is_date(s, cat_been_checked=False)[source]
autoflow.utils.data.is_highC_cat(s: pandas.core.series.Series, threshold)[source]
autoflow.utils.data.is_highR_nan(s: pandas.core.series.Series, threshold)[source]
autoflow.utils.data.is_nan(s: pandas.core.series.Series)[source]
autoflow.utils.data.is_target_need_label_encode(target_col)[source]
autoflow.utils.data.is_text(s, cat_been_checked=False)[source]
autoflow.utils.data.predict_RAM_usage(X, categorical)[source]
autoflow.utils.data.softmax(df)[source]
autoflow.utils.data.to_array(X)[source]

autoflow.utils.dataframe module

class autoflow.utils.dataframe.DataFrameValuesWrapper(X: Union[pandas.core.frame.DataFrame, pandas.core.series.Series, numpy.ndarray])[source]

Bases: object

wrap_to_dataframe(array)[source]
autoflow.utils.dataframe.get_object_columns(df_: pandas.core.frame.DataFrame) → List[str][source]
autoflow.utils.dataframe.get_unique_col_name(columns: Union[pandas.core.indexes.base.Index, pandas.core.series.Series], wanted: str)[source]
autoflow.utils.dataframe.inverse_dict(dict_: dict)[source]
autoflow.utils.dataframe.process_dataframe(X: Union[pandas.core.frame.DataFrame, numpy.ndarray], copy=True) → pandas.core.frame.DataFrame[source]
autoflow.utils.dataframe.process_duplicated_columns(columns: pandas.core.indexes.base.Index) → Tuple[pandas.core.indexes.base.Index, Dict[str, str]][source]
autoflow.utils.dataframe.rectify_dtypes(df: pandas.core.frame.DataFrame)[source]
autoflow.utils.dataframe.replace_dict(dict_: dict, from_, to_)[source]
autoflow.utils.dataframe.replace_dicts(dicts, from_, to_)[source]
autoflow.utils.dataframe.replace_nan_to_None(df: pandas.core.frame.DataFrame) → pandas.core.frame.DataFrame[source]

autoflow.utils.dict module

autoflow.utils.graphviz module

class autoflow.utils.graphviz.ColorSelector(colors, colorful)[source]

Bases: autoflow.utils.klass.StrSignatureMixin

autoflow.utils.hash module

autoflow.utils.hash.get_hash_decimal_of_str(x, m=None)[source]
autoflow.utils.hash.get_hash_of_Xy(X: Union[pandas.core.frame.DataFrame, numpy.ndarray, None], y: Union[pandas.core.frame.DataFrame, numpy.ndarray, pandas.core.series.Series, None] = None, m=None)[source]
autoflow.utils.hash.get_hash_of_array(X, m=None)[source]
autoflow.utils.hash.get_hash_of_config(config: Union[ConfigSpace.configuration_space.Configuration, Dict[str, Any]], m=None)[source]
autoflow.utils.hash.get_hash_of_dataframe(df: pandas.core.frame.DataFrame, m=None, L=500)[source]
autoflow.utils.hash.get_hash_of_dataframe_csv(df: pandas.core.frame.DataFrame, m=None, L=500)[source]
autoflow.utils.hash.get_hash_of_dataframe_deprecated(df: pandas.core.frame.DataFrame, m=None)[source]
autoflow.utils.hash.get_hash_of_dict(dict_, m=None)[source]
autoflow.utils.hash.get_hash_of_file(fname)[source]
autoflow.utils.hash.get_hash_of_str(s: Union[str, bytes], m=None)[source]

autoflow.utils.klass module

class autoflow.utils.klass.StrSignatureMixin[source]

Bases: object

autoflow.utils.klass.gather_kwargs_from_signature_and_attributes(klass, instance)[source]
autoflow.utils.klass.get_class_full_name(klass: Type)str[source]
autoflow.utils.klass.get_valid_params_in_kwargs(func, kwargs: Dict[str, Any])[source]
autoflow.utils.klass.instancing(variable, klass, kwargs)[source]
autoflow.utils.klass.sequencing(variable, klass)[source]
autoflow.utils.klass.set_if_not_None(obj, variable_name, value)[source]

autoflow.utils.list module

autoflow.utils.logging_ module

class autoflow.utils.logging_.PickableLoggerAdapter(name)[source]

Bases: object

critical(msg, *args, **kwargs)[source]
debug(msg, *args, **kwargs)[source]
error(msg, *args, **kwargs)[source]
exception(msg, *args, **kwargs)[source]
info(msg, *args, **kwargs)[source]
isEnabledFor(level)[source]
log(level, msg, *args, **kwargs)[source]
warning(msg, *args, **kwargs)[source]
autoflow.utils.logging_.get_logger(name)[source]
autoflow.utils.logging_.setup_logger(output_file=None, logging_config=None)[source]

autoflow.utils.math_ module

autoflow.utils.math_.float_gcd(a, b)[source]
autoflow.utils.math_.get_int_length(number)[source]

autoflow.utils.ml_task module

class autoflow.utils.ml_task.MLTask[source]

Bases: autoflow.utils.ml_task.Task

Create new instance of Task(mainTask, subTask, role)

autoflow.utils.ml_task.get_ml_task_from_y(y)[source]

autoflow.utils.packages module

autoflow.utils.packages.find_components(package, directory, base_class)[source]
autoflow.utils.packages.get_class_name_of_module(input_module)[source]
autoflow.utils.packages.get_class_object_in_pipeline_components(key1, key2, model_registry)[source]
autoflow.utils.packages.import_by_package_url(package_url: str)[source]

autoflow.utils.pipeline module

autoflow.utils.pipeline.concat_pipeline(*args) → Optional[autoflow.workflow.ml_workflow.ML_Workflow][source]
autoflow.utils.pipeline.purify_node(node)[source]
autoflow.utils.pipeline.union_pipeline(preprocessors: Dict) → Optional[sklearn.pipeline.Pipeline][source]

autoflow.utils.sys module

autoflow.utils.typing_ module

class autoflow.utils.typing_.GenericEstimator(*args, **kwargs)[source]

Bases: typing_extensions.Protocol

fit(X, y)[source]
predict(X)[source]
predict_proba(X)[source]

Module contents