random_output_trees.transformer.FixedStateTransformer

class random_output_trees.transformer.FixedStateTransformer(transformer, random_seed=0)

Fixe the random_state of the transformer

This meta-transformer is usefull when you want to fix the random_state of a transformer, which is modified by some meta-estimator.

Parameters:

transformer : scikit-learn transformer

random_seed : int, RandomState instance, optional (default=0)

If int, random_state is the seed used by the random number generator; If RandomState instance, random_state is the random number generator;

Attributes

transformer_ transformer A clone of the fitted transformer

Methods

fit(X[, y]) Fit estimator.
fit_transform(X[, y]) Fit to data, then transform it.
get_params([deep]) Get parameters for this estimator.
set_params(**params) Set the parameters of this estimator.
transform(X) Transform dataset.
__init__(transformer, random_seed=0)
fit(X, y=None)

Fit estimator.

Parameters:

X : array-like, shape=(n_samples, n_features)

Input data used to build forests.

Returns:

self : object

Returns self.

fit_transform(X, y=None, **fit_params)

Fit to data, then transform it.

Fits transformer to X and y with optional parameters fit_params and returns a transformed version of X.

Parameters:

X : numpy array of shape [n_samples, n_features]

Training set.

y : numpy array of shape [n_samples]

Target values.

Returns:

X_new : numpy array of shape [n_samples, n_features_new]

Transformed array.

get_params(deep=True)

Get parameters for this estimator.

Parameters:

deep: boolean, optional :

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

Returns:

params : mapping of string to any

Parameter names mapped to their values.

set_params(**params)

Set the parameters of this estimator.

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

Returns:self :
transform(X)

Transform dataset.

Parameters:

X : array-like, shape=(n_samples, n_features)

Input data to be transformed.

Returns:

X_transformed: sparse matrix, shape=(n_samples, n_out) :

Transformed dataset.