heat.base
Provides mixins for high-level algorithms, e.g. classifiers or clustering algorithms.
Module Contents
- class BaseEstimator
Abstract base class for all estimators, i.e. parametrized analysis algorithms, in Heat. Can be used as mixin.
- _parameter_names() List[str]
Get the names of all parameters that can be set inside the constructor of the estimator.
- get_params(deep: bool = True) Dict[str, object]
Get parameters for this estimator.
- Parameters:
deep (bool, default: True) – If
True
, will return the parameters for this estimator and contained sub-objects that are estimators.
- __repr__(indent: int = 1) str
Returns a printable representation of the object.
- Parameters:
indent (int, default: 1) – Indicates the indentation for the top-level output.
- 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.
- Parameters:
**params (dict[str, object]) – Estimator parameters to bet set.
- class ClassificationMixin
Mixin for all classifiers in Heat.
- fit(x: heat.core.dndarray.DNDarray, y: heat.core.dndarray.DNDarray)
Fits the classification model.
- 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
fit()
followed bypredict()
.
- predict(x: heat.core.dndarray.DNDarray) heat.core.dndarray.DNDarray
Predicts the class labels for each sample.
- Parameters:
x (DNDarray) – Values to predict the classes for. Shape = (n_samples, n_features)
- class TransformMixin
Mixin for all transformations in Heat.
- fit(x: heat.core.dndarray.DNDarray)
Fits the transformation model.
- Parameters:
x (DNDarray) – Training instances to train on. Shape = (n_samples, n_features)
- 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
fit()
followed bytransform()
.- Parameters:
x (DNDarray) – Input data to be transformed. Shape = (n_samples, n_features)
- transform(x: heat.core.dndarray.DNDarray) heat.core.dndarray.DNDarray
Transforms the input data.
- xDNDarray
Values to transform. Shape = (n_samples, n_features)
- class ClusteringMixin
Clustering mixin for all clusterers in Heat.
- fit(x: heat.core.dndarray.DNDarray)
Computes the clustering.
- Parameters:
x (DNDarray) – Training instances to cluster. Shape = (n_samples, n_features)
- 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
fit()
followed bypredict()
.- Parameters:
x (DNDarray) – Input data to be clustered. Shape = (n_samples, n_features)
- class RegressionMixin
Mixin for all regression estimators in Heat.
- fit(x: heat.core.dndarray.DNDarray, y: heat.core.dndarray.DNDarray)
Fits the regression model.
- 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
fit()
followed bypredict()
.
- predict(x: heat.core.dndarray.DNDarray) heat.core.dndarray.DNDarray
Predicts the continuous labels for each sample.
- Parameters:
x (DNDarray) – Values to let the model predict. Shape = (n_samples, n_features)
- is_classifier(estimator: object) bool
Return
True
if the given estimator is a classifier,False
otherwise.- Parameters:
estimator (object) – Estimator object to test.
- is_transformer(estimator: object) bool
Return
True
if the given estimator is a transformer,False
otherwise.- Parameters:
estimator (object) – Estimator object to test.
- is_estimator(estimator: object) bool
Return
True
if the given estimator is an estimator,False
otherwise.- Parameters:
estimator (object) – Estimator object to test.