:mod:`heat.base` ===================== .. py:module:: heat.core.base .. autoapi-nested-parse:: Provides mixins for high-level algorithms, e.g. classifiers or clustering algorithms. Module Contents --------------- .. py:class:: BaseEstimator Abstract base class for all estimators, i.e. parametrized analysis algorithms, in Heat. Can be used as mixin. .. role:: raw-html(raw) :format: html .. method:: _parameter_names() -> List[str] Get the names of all parameters that can be set inside the constructor of the estimator. .. method:: get_params(deep: bool = True) -> Dict[str, object] Get parameters for this estimator. :param deep: If ``True``, will return the parameters for this estimator and contained sub-objects that are estimators. :type deep: bool, default: True .. method:: __repr__(indent: int = 1) -> str Returns a printable representation of the object. :param indent: Indicates the indentation for the top-level output. :type indent: int, default: 1 .. method:: set_params(**params: Dict[str, object]) -> BaseEstimator.set_params.self Set the parameters of this estimator. The method works on simple estimators as well as on nested objects (such as pipelines). The latter have to be nested dictionaries. :param \*\*params: Estimator parameters to bet set. :type \*\*params: dict[str, object] .. py:class:: ClassificationMixin Mixin for all classifiers in Heat. .. role:: raw-html(raw) :format: html .. method:: fit(x: heat.core.dndarray.DNDarray, y: heat.core.dndarray.DNDarray) Fits the classification model. :param x: Training instances to train on. Shape = (n_samples, n_features) :type x: DNDarray :param y: Class values to fit. Shape = (n_samples, ) :type y: DNDarray .. method:: fit_predict(x: heat.core.dndarray.DNDarray, y: heat.core.dndarray.DNDarray) -> heat.core.dndarray.DNDarray Fits model and returns classes for each input sample Convenience method; equivalent to calling :func:`fit` followed by :func:`predict`. :param x: Input data to be predicted. Shape = (n_samples, n_features) :type x: DNDarray :param y: Class values to fit. Shape = (n_samples, ) :type y: DNDarray .. method:: predict(x: heat.core.dndarray.DNDarray) -> heat.core.dndarray.DNDarray Predicts the class labels for each sample. :param x: Values to predict the classes for. Shape = (n_samples, n_features) :type x: DNDarray .. py:class:: TransformMixin Mixin for all transformations in Heat. .. role:: raw-html(raw) :format: html .. method:: fit(x: heat.core.dndarray.DNDarray) Fits the transformation model. :param x: Training instances to train on. Shape = (n_samples, n_features) :type x: DNDarray .. method:: fit_transform(x: heat.core.dndarray.DNDarray) -> heat.core.dndarray.DNDarray Fits model and returns transformed data for each input sample Convenience method; equivalent to calling :func:`fit` followed by :func:`transform`. :param x: Input data to be transformed. Shape = (n_samples, n_features) :type x: DNDarray .. method:: transform(x: heat.core.dndarray.DNDarray) -> heat.core.dndarray.DNDarray Transforms the input data. :param x: Values to transform. Shape = (n_samples, n_features) :type x: DNDarray .. py:class:: ClusteringMixin Clustering mixin for all clusterers in Heat. .. role:: raw-html(raw) :format: html .. method:: fit(x: heat.core.dndarray.DNDarray) Computes the clustering. :param x: Training instances to cluster. Shape = (n_samples, n_features) :type x: DNDarray .. method:: fit_predict(x: heat.core.dndarray.DNDarray) -> heat.core.dndarray.DNDarray Compute clusters and returns the predicted cluster assignment for each sample. Returns index of the cluster each sample belongs to. Convenience method; equivalent to calling :func:`fit` followed by :func:`predict`. :param x: Input data to be clustered. Shape = (n_samples, n_features) :type x: DNDarray .. py:class:: RegressionMixin Mixin for all regression estimators in Heat. .. role:: raw-html(raw) :format: html .. method:: fit(x: heat.core.dndarray.DNDarray, y: heat.core.dndarray.DNDarray) Fits the regression model. :param x: Training instances to train on. Shape = (n_samples, n_features) :type x: DNDarray :param y: Continuous values to fit. Shape = (n_samples,) :type y: DNDarray .. method:: fit_predict(x: heat.core.dndarray.DNDarray, y: heat.core.dndarray.DNDarray) -> heat.core.dndarray.DNDarray Fits model and returns regression predictions for each input sample Convenience method; equivalent to calling :func:`fit` followed by :func:`predict`. :param x: Input data to be predicted. Shape = (n_samples, n_features) :type x: DNDarray :param y: Continuous values to fit. Shape = (n_samples,) :type y: DNDarray .. method:: predict(x: heat.core.dndarray.DNDarray) -> heat.core.dndarray.DNDarray Predicts the continuous labels for each sample. :param x: Values to let the model predict. Shape = (n_samples, n_features) :type x: DNDarray .. function:: is_classifier(estimator: object) -> bool Return ``True`` if the given estimator is a classifier, ``False`` otherwise. :param estimator: Estimator object to test. :type estimator: object .. function:: is_transformer(estimator: object) -> bool Return ``True`` if the given estimator is a transformer, ``False`` otherwise. :param estimator: Estimator object to test. :type estimator: object .. function:: is_estimator(estimator: object) -> bool Return ``True`` if the given estimator is an estimator, ``False`` otherwise. :param estimator: Estimator object to test. :type estimator: object .. function:: is_clusterer(estimator: object) -> bool Return ``True`` if the given estimator is a clusterer, ``False`` otherwise. :param estimator: Estimator object to test. :type estimator: object .. function:: is_regressor(estimator: object) -> bool Return ``True`` if the given estimator is a regressor, ``False`` otherwise. :param estimator: Estimator object to test. :type estimator: object