skpro.registry.all_objects#

skpro.registry.all_objects(object_types=None, filter_tags=None, exclude_objects=None, return_names=True, as_dataframe=False, return_tags=None, suppress_import_stdout=True)[source]#

Get a list of all objects from skpro.

This function crawls the module and gets all classes that inherit from skpro’s and sklearn’s base classes.

Not included are: the base classes themselves, classes defined in test modules.

Parameters:
object_types: str, list of str, optional (default=None)

Which kind of objects should be returned. if None, no filter is applied and all objects are returned. if str or list of str, strings define scitypes specified in search only objects that are of (at least) one of the scitypes are returned possible str values are entries of registry.BASE_CLASS_REGISTER (first col) for instance ‘regrssor_proba’, ‘distribution, ‘metric’

return_names: bool, optional (default=True)

if True, estimator class name is included in the all_objects return in the order: name, estimator class, optional tags, either as a tuple or as pandas.DataFrame columns

if False, estimator class name is removed from the all_objects return.

filter_tags: dict of (str or list of str), optional (default=None)

For a list of valid tag strings, use the registry.all_tags utility.

filter_tags subsets 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)”

exclude_estimators: str, list of str, optional (default=None)

Names of estimators to exclude.

as_dataframe: bool, optional (default=False)

True: all_objects will return a pandas.DataFrame with named columns for all of the attributes being returned.

False: all_objects will return a list (either a list of estimators or a list of tuples, see Returns)

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_tags utility. 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_objects will return one of the following:
  1. list of objects, if return_names=False, and return_tags is None

  2. list of tuples (optional object name, class, ~optional object

tags), if return_names=True or return_tags is not None.

3. pandas.DataFrame if as_dataframe = True if list of objects:

entries are objects matching the query, in alphabetical order of object name

if list of tuples:

list of (optional object name, object, optional object tags) matching the query, in alphabetical order of object name, where name is the object name as string, and is an

optional return

object is the actual object tags are the object’s values for each tag in return_tags

and is an optional return.

if dataframe:

all_objects will return a pandas.DataFrame. column names represent the attributes contained in each column. “objects” will be the name of the column of objects, “names” will be the name of the column of object 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

Adapted version of sktime’s all_estimators, which is an evolution of scikit-learn’s all_estimators

Examples

>>> from skpro.registry import all_objects
>>> # return a complete list of objects as pd.Dataframe
>>> all_objects(as_dataframe=True)
>>> # return all probabilistic regressors by filtering for object type
>>> all_objects("regressor_proba", as_dataframe=True)
>>> # return all regressors which handle missing data in the input by tag filtering
>>> all_objects(
...     "regressor_proba",
...     filter_tags={"capability:missing": True},
...     as_dataframe=True
... )