SequentialFeatureSelection

class museotoolbox.ai.SequentialFeatureSelection(classifier, param_grid, path_to_save_models=False, n_comp=1, verbose=False)[source]

Sequential Feature Selection

Parameters
  • classifier (class.) – Classifier from scikit-learn.

  • param_grid (np.ndarray.) – param_grid for hyperparameters of the classifier.

  • path_to_save_models (False or str, optional (default=False)) – If False, will store best model per combination in memory. If str, must be path to save each model and accuracy per feature.

  • n_comp (int, optional (default=1)) – The number of component per feature. If 4, each feature has 4 columns.

  • verbose (bool or int, optional (default=False)) – The higher it is the more sequential will show progression.

Methods

__init__(classifier, param_grid[, …])

Initialize self.

customize_array(xFunction, **kwargs)

fit(X, y[, group, cv, scoring, standardize, …])

param X

shape of np.ndarray is (n_size,n_bands).

get_best_model([clone])

predict(X, idx)

Predict in raster using the best features.

predict_best_combination(in_image, out_image)

Predict in raster using the best features.

predict_images(in_image, out_image_prefix[, …])

Predict each best found features with SFFS.fit(X,y).

transform(X[, idx, customizeX])

param idx

The idx to return X array

Examples using museotoolbox.ai.SequentialFeatureSelection