all_estimators#
- all_estimators(estimator_types=None, filter_tags=None, exclude_estimators=None, return_names=True, as_dataframe=False, return_tags=None, suppress_import_stdout=True)[source]#
List all estimators or objects in sktime, by scitype or tag.
This function crawls the module and gets all classes that inherit from sktime’s and sklearn’s base classes.
The retrieved objects can be filtered by type, tags, and excluded by name.
Not included are: the base classes themselves, classes defined in test modules.
- Parameters:
- estimator_types: str, list of str, optional (default=None)
Which kind of objects should be returned.
if None, no filter is applied and all estimators are returned.
if str or list of str, strings define scitypes specified in search only estimators that are of (at least) one of the scitypes are returned possible str values are the object type tags in the
object_typetag, all possible values are inspectable in registry.BASE_CLASS_REGISTER (first col) for instance'classifier','regressor','transformer','forecaster'
- return_names: bool, optional (default=True)
Whether to include the class name strings in the returned objects.
If True, estimator class name is included in the
all_estimatorsreturn in the order: name, estimator class, optional tags, either as a tuple or aspandas.DataFramecolumns in theall_estimatorsreturn.If False, estimator class name is removed from the
all_estimatorsreturn.
- filter_tags: dict of str, re.Pattern, str, or list thereof,optional (default=None)
Filter condition to filter returned objects based on their tags. The filter condition is used to determine which objects are returned.
For a list of valid tag strings, use the registry.all_tags utility, or consult the tags API reference.
If str, equivalent to
{filter_tags: True}, i.e., returns estimators where the specified tag is True.If list of str, equivalent to
{x: True for x in filter_tags}, i.e., returns estimators where all specified tags are True.If dict,
filter_tagssubsets the returned estimators as follows:each key/value pair is statement in “and” / conjunction
key is tag name to sub-set on
value str or list of string are tag values
condition is “key must be equal to value, or in set(value)”
In detail, the return will be filtered to keep exactly the classes where tags satisfy all the filter conditions specified by
filter_tags. Filter conditions are as follows, fortag_name: search_valuepairs in thefilter_tagsdict, applied to a classklass:If
klassdoes not have a tag with nametag_name, it is excluded. Otherwise, lettag_valuebe the value of the tag with nametag_name.If
search_valueis a string, andtag_valueis a string, the filter condition is thatsearch_valuemust match the tag value.If
search_valueis a string, andtag_valueis a list, the filter condition is thatsearch_valueis contained intag_value.If
search_valueis are.Pattern, andtag_valueis a string, the filter condition is thatsearch_value.fullmatch(tag_value)is true, i.e., the regex matches the tag value.If
search_valueis are.Pattern, andtag_valueis a list, the filter condition is that at least one element oftag_valuematches the regex.If
search_valueis iterable, then the filter condition is that at least one element ofsearch_valuesatisfies the above conditions, applied totag_value.
- exclude_estimators: str, list of str, optional (default=None)
Names of estimators to exclude.
- as_dataframe: bool, optional (default=False)
Whether to return the results as a pandas DataFrame or as a list.
If False,
all_estimatorswill return a list - either a list ofscikit-basecompatible classes or a list of tuples, see Returns.If True,
all_estimatorswill return apandas.DataFramewith named columns for all of the attributes being returned. this requires soft dependencypandasto be installed.
- return_tags: str or list of str, optional (default=None)
Names of tags to fetch and return each estimator’s value of. For a list of valid tag strings, use the
registry.all_tagsutility. if str or list of str, the tag values named in return_tags will be fetched for each estimator and will be appended as either columns or tuple entries.- suppress_import_stdoutbool, optional. Default=True
whether to suppress stdout printout upon import.
- Returns:
all_estimatorswill return one of the following:list of estimators, if
return_names=False, andreturn_tagsis None
2. list of tuples (optional estimator name, class, ~ptional estimator tags), if
return_names=Trueorreturn_tagsis notNone.pandas.DataFrameifas_dataframe = True
For all cases, the results are filtered according to the specified estimator types, filter tags, and exclude estimators.
Return structure depends on the input parameters:
if list of estimators: entries are estimators matching the query, in alphabetical order of estimator name
if list of tuples: list of (optional estimator name, estimator, optional estimator tags) matching the query, in alphabetical order of estimator name, where:
nameis the estimator name as string, and is an optional returnestimatoris the actual estimatortagsare the estimator’s values for each tag in return_tags and is an optional return.
if
DataFrame: column names represent the attributes contained in each column. “estimators” will be the name of the column of estimators, “names” will be the name of the column of estimator class names and the string(s) passed in return_tags will serve as column names for all columns of tags that were optionally requested.
References
Modified version of
scikit-learn’sall_estimators.Examples
>>> from sktime.registry import all_estimators >>> # return a complete list of estimators as pd.Dataframe >>> all_estimators(as_dataframe=True) >>> # return all forecasters by filtering for estimator type >>> all_estimators("forecaster") >>> # return all forecasters which handle missing data in the input by tag filtering >>> all_estimators( ... "forecaster", ... filter_tags={"capability:missing_values": True} ... )