utils

Module Contents

Functions

detect_problem_type

Determine the type of problem is being solved based on the targets (binary vs multiclass classification, regression)

handle_problem_types

Handles problem_type by either returning the ProblemTypes or converting from a str.

is_binary

Determines if the provided problem_type is a binary classification problem type

is_classification

Determines if the provided problem_type is a classification problem type

is_multiclass

Determines if the provided problem_type is a multiclass classification problem type

is_regression

Determines if the provided problem_type is a regression problem type

is_time_series

Determines if the provided problem_type is a time series problem type

Contents

evalml.problem_types.utils.detect_problem_type(y)[source]
Determine the type of problem is being solved based on the targets (binary vs multiclass classification, regression)

Ignores missing and null data

Parameters

y (pd.Series) – the target labels to predict

Returns

ProblemType Enum

Return type

ProblemType

Example

>>> y = pd.Series([0, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1])
>>> problem_type = detect_problem_type(y)
>>> assert problem_type == ProblemTypes.BINARY
evalml.problem_types.utils.handle_problem_types(problem_type)[source]

Handles problem_type by either returning the ProblemTypes or converting from a str.

Parameters

problem_type (str or ProblemTypes) – Problem type that needs to be handled

Returns

ProblemTypes

evalml.problem_types.utils.is_binary(problem_type)[source]

Determines if the provided problem_type is a binary classification problem type

Parameters

problem_type (str or ProblemTypes) – type of supervised learning problem. See evalml.problem_types.ProblemType.all_problem_types for a full list.

Returns

Whether or not the provided problem_type is a binary classification problem type.

Return type

bool

evalml.problem_types.utils.is_classification(problem_type)[source]

Determines if the provided problem_type is a classification problem type

Parameters

problem_type (str or ProblemTypes) – type of supervised learning problem. See evalml.problem_types.ProblemType.all_problem_types for a full list.

Returns

Whether or not the provided problem_type is a classification problem type.

Return type

bool

evalml.problem_types.utils.is_multiclass(problem_type)[source]

Determines if the provided problem_type is a multiclass classification problem type

Parameters

problem_type (str or ProblemTypes) – type of supervised learning problem. See evalml.problem_types.ProblemType.all_problem_types for a full list.

Returns

Whether or not the provided problem_type is a multiclass classification problem type.

Return type

bool

evalml.problem_types.utils.is_regression(problem_type)[source]

Determines if the provided problem_type is a regression problem type

Parameters

problem_type (str or ProblemTypes) – type of supervised learning problem. See evalml.problem_types.ProblemType.all_problem_types for a full list.

Returns

Whether or not the provided problem_type is a regression problem type.

Return type

bool

evalml.problem_types.utils.is_time_series(problem_type)[source]

Determines if the provided problem_type is a time series problem type

Parameters

problem_type (str or ProblemTypes) – type of supervised learning problem. See evalml.problem_types.ProblemType.all_problem_types for a full list.

Returns

Whether or not the provided problem_type is a time series problem type.

Return type

bool