consensuscluster.TemplateEstimator

class consensuscluster.TemplateEstimator(demo_param='demo_param')[source]

A template estimator to be used as a reference implementation.

For more information regarding how to build your own estimator, read more in the User Guide.

Parameters
demo_paramstr, default=’demo_param’

A parameter used for demonstation of how to pass and store paramters.

__init__(self, demo_param='demo_param')[source]

Initialize self. See help(type(self)) for accurate signature.

fit(self, X, y)[source]

A reference implementation of a fitting function.

Parameters
X{array-like, sparse matrix}, shape (n_samples, n_features)

The training input samples.

yarray-like, shape (n_samples,) or (n_samples, n_outputs)

The target values (class labels in classification, real numbers in regression).

Returns
selfobject

Returns self.

get_params(self, deep=True)

Get parameters for this estimator.

Parameters
deepboolean, optional

If True, will return the parameters for this estimator and contained subobjects that are estimators.

Returns
paramsmapping of string to any

Parameter names mapped to their values.

predict(self, X)[source]

A reference implementation of a predicting function.

Parameters
X{array-like, sparse matrix}, shape (n_samples, n_features)

The training input samples.

Returns
yndarray, shape (n_samples,)

Returns an array of ones.

set_params(self, **params)

Set the parameters of this estimator.

The method works on simple estimators as well as on nested objects (such as pipelines). The latter have parameters of the form <component>__<parameter> so that it’s possible to update each component of a nested object.

Returns
self

Examples using consensuscluster.TemplateEstimator