{"id":3799,"library":"scikit-base","title":"skbase","description":"skbase provides base classes for creating scikit-learn-like parametric objects, along with tools to make it easier to build custom packages that follow these design patterns. It is a foundational library, notably used by `sktime`. The current version is 0.13.1, and it has a frequent release cadence with minor and patch updates occurring roughly monthly or bi-monthly.","status":"active","version":"0.13.1","language":"en","source_language":"en","source_url":"https://github.com/sktime/skbase","tags":["machine-learning","scikit-learn","base-classes","framework-factory","object-oriented","sktime"],"install":[{"cmd":"pip install scikit-base","lang":"bash","label":"Install core package"},{"cmd":"pip install scikit-base[all_extras]","lang":"bash","label":"Install with all optional dependencies"}],"dependencies":[{"reason":"Required Python interpreter version range.","package":"python","version":">=3.10, <3.15","optional":false}],"imports":[{"note":"skbase provides its own BaseObject for creating scikit-learn-like classes; it is not the same as scikit-learn's BaseEstimator.","wrong":"from sklearn.base import BaseObject","symbol":"BaseObject","correct":"from skbase.base import BaseObject"},{"note":"Used to retrieve registered skbase objects, often filtered by tags.","symbol":"all_objects","correct":"from skbase.lookup import all_objects"}],"quickstart":{"code":"from skbase.base import BaseObject\n\nclass MyCustomObject(BaseObject):\n    \"\"\"A simple custom object demonstrating skbase.base.BaseObject.\"\"\"\n\n    def __init__(self, value_a=1, value_b=\"default_string\", random_state=None):\n        self.value_a = value_a\n        self.value_b = value_b\n        self.random_state = random_state\n        super().__init__()\n\n# Create an instance of our custom object\nmy_obj = MyCustomObject(value_a=10)\nprint(f\"Initial parameters: {my_obj.get_params()}\")\n\n# Modify parameters using set_params\nmy_obj.set_params(value_b=\"new_string_value\")\nprint(f\"Parameters after set_params: {my_obj.get_params()}\")\n\n# Demonstrate cloning (a common scikit-learn-like pattern)\ncloned_obj = my_obj.clone()\nprint(f\"Cloned object parameters: {cloned_obj.get_params()}\")\nprint(f\"Is cloned_obj the same instance as my_obj? {cloned_obj is my_obj}\")","lang":"python","description":"This quickstart demonstrates defining a custom object inheriting from `skbase.base.BaseObject`, illustrating how to initialize parameters, retrieve them with `get_params`, modify them with `set_params`, and create a deep copy using `clone()`."},"warnings":[{"fix":"To retain the old behavior (selecting objects with the tag of any value), pass a dictionary with the tag name as key and `re.Pattern('.*')` as value. For example, `from re import Pattern; all_objects(filter_tags={'tag_name': Pattern('.*')})`.","message":"The meaning of `filter_tags` arguments (type `str` or `iterable of str`) in `skbase.lookup.all_objects` changed. Previously, it selected objects possessing the tag(s) of any value. From version 0.9.0, it selects objects where the tag's value is explicitly `True` (boolean).","severity":"breaking","affected_versions":">=0.9.0"},{"fix":"Ensure all necessary dependencies for your project are explicitly listed in your `pyproject.toml` or `setup.py` and installed, rather than relying on `skbase` to pull them in indirectly.","message":"As of version 0.4.2, `skbase` explicitly removed all core external PyPI dependencies, intending to be a truly base module without implicit requirements beyond Python itself. Developers building on `skbase` should be aware of this and explicitly manage any dependencies their custom objects require.","severity":"gotcha","affected_versions":">=0.4.2"},{"fix":"If you intend to use existing machine learning algorithms, use `scikit-learn` (e.g., `from sklearn.ensemble import RandomForestClassifier`). If you are building new estimators that adhere to the `scikit-learn` API, use `skbase.base.BaseObject`.","message":"Users often confuse `skbase` with `scikit-learn`. `skbase` provides base classes for *creating* scikit-learn-like parametric objects and design patterns, but it is not `scikit-learn` itself and does not contain machine learning algorithms for direct use. Importing `sklearn.base.BaseEstimator` is for `scikit-learn`, not `skbase.base.BaseObject`.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}