yobx.sklearn.feature_selection.select_from_model#
- yobx.sklearn.feature_selection.select_from_model.sklearn_select_from_model(g: GraphBuilderExtendedProtocol, sts: Dict, outputs: List[str], estimator: SelectFromModel, X: str, name: str = 'select_from_model') str[source]#
Converts a
sklearn.feature_selection.SelectFromModelinto ONNX.After fitting, the meta-transformer selects features whose importance (as reported by the wrapped estimator’s
feature_importances_orcoef_attribute) exceeds the configured threshold. The selected column indices are fixed at conversion time viaestimator.get_support(indices=True), so the ONNX graph contains a singleGathernode that selects those columns from the input matrix:X ──Gather(axis=1, indices)──► output
- Parameters:
g – the graph builder to add nodes to
sts – shapes defined by scikit-learn
estimator – a fitted
SelectFromModeloutputs – desired output names
X – input name (shape
(N, F))name – prefix name for the added nodes
- Returns:
output name