![]() Parameters : X array-like of shape (n_samples, n_features) Get a mask, or integer index, of the features selected.įit the SelectFromModel meta-transformer only once.įit ( X, y = None, ** fit_params ) ¶įit the SelectFromModel meta-transformer. Mask feature names according to selected features. max_features_ 2įit the SelectFromModel meta-transformer. max_features = half_callable ) > _ = half_selector. return round ( len ( X ) / 2 ) > half_selector = SelectFromModel ( estimator = LogisticRegression (). To only select based on max_features, set threshold=-np.inf. ![]() If a callable, then it specifies how to calculate the maximum number ofįeatures allowed by using the output of max_features(X). If an integer, then it specifies the maximum number of features to The maximum number of features to select. Threshold in the case where the coef_ attribute of theĮstimator is of dimension 2. Order of the norm used to filter the vectors of coefficients below norm_order non-zero int, inf, -inf, default=1 If False, estimator is fitted and updated by callingįit and partial_fit, respectively. If True, estimator must be a fitted estimator. Whether a prefit model is expected to be passed into the constructor Or implicitly (e.g, Lasso), the threshold used is 1e-5. If None and if theĮstimator has a parameter penalty set to l1, either explicitly A scalingįactor (e.g., “1.25*mean”) may also be used. Features whoseĪbsolute importance value is greater or equal are kept while the othersĪre discarded. The threshold value to use for feature selection. Otherwise, the importance_getter parameter should be used. The estimator should have aįeature_importances_ or coef_ attribute after fitting. This can be both a fitted (if prefit is set to True) The base estimator from which the transformer is built.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |