Problem Types¶
The supported types of machine learning problems.
Submodules¶
Package Contents¶
Classes Summary¶
Enum defining the supported types of machine learning problems. |
Functions¶
Determine the type of problem is being solved based on the targets (binary vs multiclass classification, regression). Ignores missing and null data. |
|
Handles problem_type by either returning the ProblemTypes or converting from a str. |
|
Determines if the provided problem_type is a binary classification problem type. |
|
Determines if the provided problem_type is a classification problem type. |
|
Determines if the provided problem_type is a multiclass classification problem type. |
|
Determines if the provided problem_type is a regression problem type. |
|
Determines if the provided problem_type is a time series problem type. |
Contents¶
-
evalml.problem_types.
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
- Raises
ValueError – If the input has less than two classes.
-
evalml.problem_types.
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 enum
- Raises
KeyError – If input is not a valid ProblemTypes enum value.
ValueError – If input is not a string or ProblemTypes object.
-
evalml.problem_types.
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.
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.
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.
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.
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
-
class
evalml.problem_types.
ProblemTypes
[source]¶ Enum defining the supported types of machine learning problems.
Attributes
BINARY
Binary classification problem.
MULTICLASS
Multiclass classification problem.
REGRESSION
Regression problem.
TIME_SERIES_BINARY
Time series binary classification problem.
TIME_SERIES_MULTICLASS
Time series multiclass classification problem.
TIME_SERIES_REGRESSION
Time series regression problem.
Methods
Get a list of all defined problem types.
The name of the Enum member.
The value of the Enum member.
-
all_problem_types
(cls)¶ Get a list of all defined problem types.
- Returns
List of all defined problem types.
- Return type
list(ProblemTypes)
-
name
(self)¶ The name of the Enum member.
-
value
(self)¶ The value of the Enum member.
-