API: preprocessing.feature_selection
skyulf.preprocessing.feature_selection
Feature-selection nodes package.
Importing this package registers all feature-selection nodes (variance, correlation, univariate, model-based, and the unified facade) and re-exports their public classes.
CorrelationThresholdApplier
Bases: BaseApplier
Remove the columns a fitted correlation threshold marked redundant.
Source code in skyulf-core/skyulf/preprocessing/feature_selection/correlation.py
150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 | |
apply(X, _y, params)
Drop the artifact's precomputed columns_to_drop from X.
The list is resolved at fit time, so apply never recomputes a correlation
matrix; drop_columns=False leaves the frame untouched.
Source code in skyulf-core/skyulf/preprocessing/feature_selection/correlation.py
175 176 177 178 179 180 181 182 183 184 | |
inference_capability(state, *, engine)
staticmethod
Describe existing local saved apply without admitting partition workers.
Source code in skyulf-core/skyulf/preprocessing/feature_selection/correlation.py
167 168 169 170 171 172 173 | |
validate_inference_state(raw)
staticmethod
Inspect saved drop decisions without evaluating fit-only metadata.
Fewer than two fitted candidates produce an empty no-op artifact. Threshold and method are unused at apply, including callable methods.
Source code in skyulf-core/skyulf/preprocessing/feature_selection/correlation.py
153 154 155 156 157 158 159 160 161 162 163 164 165 | |
CorrelationThresholdCalculator
Bases: BaseCalculator
Fit a pairwise-correlation threshold over numeric columns.
Source code in skyulf-core/skyulf/preprocessing/feature_selection/correlation.py
187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 | |
fit(X, _y, config)
Return columns whose correlation with an earlier one exceeds the threshold.
Within each over-threshold pair the later column is the one dropped. The native Polars path is used only where it can honour the same contract; Kendall and callable methods fall back to pandas. Returns an empty artifact — a no-op passthrough — when fewer than two columns resolve.
Source code in skyulf-core/skyulf/preprocessing/feature_selection/correlation.py
199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 | |
FeatureSelectionApplier
Bases: BaseApplier
Route a fitted selection artifact to the applier that produced it.
Source code in skyulf-core/skyulf/preprocessing/feature_selection/facade.py
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 | |
apply(df, params)
Apply whichever concrete selection applier the artifact's type names.
An unrecognized type — including the empty artifact an unknown method
produces at fit time — is an identity passthrough, so this facade can
never drop data on its own.
Source code in skyulf-core/skyulf/preprocessing/feature_selection/facade.py
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 | |
inference_capability(state, *, engine)
staticmethod
Reuse the selected owner's context; unmatched saved types remain passthroughs.
Source code in skyulf-core/skyulf/preprocessing/feature_selection/facade.py
42 43 44 45 46 47 48 49 50 51 | |
validate_inference_state(raw)
staticmethod
Delegate inspection to the same saved discriminator used by local apply.
Source code in skyulf-core/skyulf/preprocessing/feature_selection/facade.py
29 30 31 32 33 34 35 36 37 38 39 40 | |
FeatureSelectionCalculator
Bases: BaseCalculator
Resolve config["method"] to one of the four concrete selection nodes.
Source code in skyulf-core/skyulf/preprocessing/feature_selection/facade.py
99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 | |
fit(df, config)
Fit the concrete calculator the method alias maps to and return its artifact.
_FS_CALCULATORS collapses eleven aliases — node ids such as
variance alongside sklearn-style names such as select_k_best and
rfe — onto four calculators, so several spellings reach the same fit.
An unknown method logs a warning and returns an empty artifact rather
than raising, which degrades the node to a passthrough.
Source code in skyulf-core/skyulf/preprocessing/feature_selection/facade.py
111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 | |
ModelBasedSelectionApplier
Bases: BaseApplier
Remove the columns an estimator's importances rejected.
Source code in skyulf-core/skyulf/preprocessing/feature_selection/model_based.py
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 | |
apply(X, _y, params)
Drop candidate_columns - selected_columns from X.
Honours the artifact's drop_columns flag; the recorded
feature_importances are reporting metadata and take no part in the
transform.
Source code in skyulf-core/skyulf/preprocessing/feature_selection/model_based.py
63 64 65 66 67 68 69 70 71 72 73 | |
inference_capability(state, *, engine)
staticmethod
Describe saved column selection without rerunning the training estimator.
Source code in skyulf-core/skyulf/preprocessing/feature_selection/model_based.py
55 56 57 58 59 60 61 | |
validate_inference_state(raw)
staticmethod
Inspect saved membership while leaving unused fit reports unchanged.
Source code in skyulf-core/skyulf/preprocessing/feature_selection/model_based.py
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | |
ModelBasedSelectionCalculator
Bases: BaseCalculator
Fit a SelectFromModel or RFE selector around a resolved estimator.
Source code in skyulf-core/skyulf/preprocessing/feature_selection/model_based.py
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 | |
fit(X, y, config)
Return the features the fitted estimator's support keeps.
This selector is supervised: with no target there is nothing to score
against, so a missing target is treated as an error. Every failure mode
returns an empty artifact instead of raising, which degrades the node to
a passthrough — though an unsupported method does so silently,
without the log line the other branches emit.
Source code in skyulf-core/skyulf/preprocessing/feature_selection/model_based.py
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 | |
UnivariateSelectionApplier
Bases: BaseApplier
Remove the columns a univariate statistical test rejected.
Source code in skyulf-core/skyulf/preprocessing/feature_selection/univariate.py
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 | |
apply(X, _y, params)
Drop candidate_columns - selected_columns from X.
Honours the artifact's drop_columns flag; the recorded
feature_scores and p_values are reporting metadata only.
Source code in skyulf-core/skyulf/preprocessing/feature_selection/univariate.py
79 80 81 82 83 84 85 86 87 88 | |
inference_capability(state, *, engine)
staticmethod
Describe existing local saved apply without admitting partition workers.
Source code in skyulf-core/skyulf/preprocessing/feature_selection/univariate.py
71 72 73 74 75 76 77 | |
validate_inference_state(raw)
staticmethod
Inspect saved selection membership while preserving both fitted schemas.
A no-target fit uses scores/pvalues reporting fields; a scored
fit uses feature_scores/p_values. Reports and the fitted method
are unused by apply and remain untouched, including nonfinite scores.
Source code in skyulf-core/skyulf/preprocessing/feature_selection/univariate.py
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 | |
UnivariateSelectionCalculator
Bases: BaseCalculator
Fit a univariate statistical selector over numeric candidate columns.
Source code in skyulf-core/skyulf/preprocessing/feature_selection/univariate.py
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 | |
fit(X, y, config)
Return the features the score function's support keeps.
A missing target is normally an error, but allow_missing_target
downgrades it to a keep-everything artifact so unsupervised pipelines
can still run this node. The scoring inputs are adjusted first — missing
values become 0, and chi2 features are MinMax-rescaled when any value is
negative — because both shift the resulting scores.
Source code in skyulf-core/skyulf/preprocessing/feature_selection/univariate.py
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 | |
VarianceThresholdApplier
Bases: BaseApplier
Remove the columns a fitted variance threshold rejected.
Source code in skyulf-core/skyulf/preprocessing/feature_selection/variance.py
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 | |
apply(X, _y, params)
Drop candidate_columns - selected_columns from X.
Honours the artifact's drop_columns flag; when it is false the frame
passes through untouched.
Source code in skyulf-core/skyulf/preprocessing/feature_selection/variance.py
60 61 62 63 64 65 66 67 68 69 | |
inference_capability(state, *, engine)
staticmethod
Describe existing local saved apply without admitting partition workers.
Source code in skyulf-core/skyulf/preprocessing/feature_selection/variance.py
52 53 54 55 56 57 58 | |
validate_inference_state(raw)
staticmethod
Inspect saved selection membership without recomputing variances.
Empty fitted artifacts and selections are valid. The fit-only threshold and variances remain untouched, including undefined all-missing variance.
Source code in skyulf-core/skyulf/preprocessing/feature_selection/variance.py
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | |
VarianceThresholdCalculator
Bases: BaseCalculator
Fit sklearn.feature_selection.VarianceThreshold on numeric columns.
Source code in skyulf-core/skyulf/preprocessing/feature_selection/variance.py
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 | |
fit(X, _y, config)
Record which numeric columns clear config["threshold"] variance.
Binary and constant columns are kept as candidates rather than excluded up front, so the threshold itself decides their fate. Returns an empty artifact — a no-op passthrough — when no numeric column is resolved. If no candidate clears the threshold, records an empty selection so apply can remove all candidates while preserving other columns.
Source code in skyulf-core/skyulf/preprocessing/feature_selection/variance.py
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 | |