lale.lib.sklearn.rfe module

class lale.lib.sklearn.rfe.RFE(*, estimator, n_features_to_select=None, step=1, verbose=0, importance_getter='auto')

Bases: PlannedIndividualOp

Recursive feature elimination transformer from scikit-learn.

This documentation is auto-generated from JSON schemas.

Parameters
  • estimator (operator, not for optimizer) – A supervised learning estimator with a fit method that provides information about feature importance either through a coef_ attribute or through a feature_importances_ attribute.

  • n_features_to_select (union type, not for optimizer, default None) –

    • None

      Half of the features are selected.

    • or integer, >=1, <=’X/items/maxItems’, not for optimizer

      Absolute number of features to select.

    • or float, >0.0, <1.0

      Fraction of features to select

  • step (union type, not for optimizer, default 1) –

    If greater than or equal to 1, then step corresponds to the (integer) number of features to remove at each iteration. If within (0.0, 1.0), then step corresponds to the percentage (rounded down) of features to remove at each iteration.

    • integer, >=1, not for optimizer

    • or float, >0, <1, <=0.5 for optimizer

  • verbose (union type, not for optimizer, default 0) –

    Controls verbosity of output.

    • boolean

    • or integer

  • importance_getter (union type, optional, not for optimizer, default 'auto') –

    • ‘auto’

      Use the feature importance either through a coef_ or feature_importances_ attributes of estimator.

    • or string

      Attribute name/path for extracting feature importance (implemented with attrgetter).

    • or callable

      The callable is passed with the fitted estimator and it should return importance for each feature.

decision_function(X)

Confidence scores for all classes.

Note: The decision_function method is not available until this operator is trained.

Once this method is available, it will have the following signature:

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

Train the operator.

Note: The fit method is not available until this operator is trainable.

Once this method is available, it will have the following signature:

Parameters
  • X (array of items : array of items : float) – Features; the outer array is over samples.

  • y (array of items : float) – Target class labels; the array is over samples.

predict(X, **predict_params)

Make predictions.

Note: The predict method is not available until this operator is trained.

Once this method is available, it will have the following signature:

predict_proba(X)

Probability estimates for all classes.

Note: The predict_proba method is not available until this operator is trained.

Once this method is available, it will have the following signature:

transform(X, y=None)

Transform the data.

Note: The transform method is not available until this operator is trained.

Once this method is available, it will have the following signature:

Parameters

X (array, optional of items : array of items : float) – The input samples.

Returns

result

Return type

array of items : array of items : float