pyoselm.layer.RBFRandomLayer

class pyoselm.layer.RBFRandomLayer(n_hidden=20, random_state=None, activation_func='gaussian', activation_args=None, centers=None, radii=None, rbf_width=1.0)[source]

Wrapper for RandomLayer with alpha (mixing coefficient) set to 0.0 for RBF activations only

__init__(n_hidden=20, random_state=None, activation_func='gaussian', activation_args=None, centers=None, radii=None, rbf_width=1.0)[source]

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

Methods

__init__([n_hidden, random_state, …])

Initialize self.

activation_func_names()

Get list of internal activation function names

fit(X[, y])

Generate a random hidden layer.

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[, y])

Generate the random hidden layer’s activations given X as input.

classmethod activation_func_names()

Get list of internal activation function names

fit(X, y=None)

Generate a random hidden layer.

Parameters
  • X ({array-like, sparse matrix} of shape [n_samples, n_features]) – Training set: only the shape is used to generate random component values for hidden units

  • y (not used: placeholder to allow for usage in a Pipeline.) –

Returns

Return type

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 (array-like of shape (n_samples, n_features)) – Input samples.

  • y (array-like of shape (n_samples,) or (n_samples, n_outputs), default=None) – Target values (None for unsupervised transformations).

  • **fit_params (dict) – Additional fit parameters.

Returns

X_new – Transformed array.

Return type

ndarray array of shape (n_samples, n_features_new)

get_params(deep=True)

Get parameters for this estimator.

Parameters

deep (bool, default=True) – If True, will return the parameters for this estimator and contained subobjects that are estimators.

Returns

params – Parameter names mapped to their values.

Return type

dict

set_params(**params)

Set the parameters of this estimator.

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

Parameters

**params (dict) – Estimator parameters.

Returns

self – Estimator instance.

Return type

estimator instance

transform(X, y=None)

Generate the random hidden layer’s activations given X as input.

Parameters
  • X ({array-like, sparse matrix}, shape [n_samples, n_features]) – Data to transform

  • y (not used: placeholder to allow for usage in a Pipeline.) –

Returns

X_new

Return type

numpy array of shape [n_samples, n_components]