API: preprocessing.scaling
skyulf.preprocessing.scaling
Scaling nodes package.
Split from a single 496-LOC module into per-scaler files
_common.py — shared subset-selection helpers standard.py — StandardScaler minmax.py — MinMaxScaler robust.py — RobustScaler maxabs.py — MaxAbsScaler
All public names are re-exported here so existing imports such as
from skyulf.preprocessing.scaling import StandardScalerCalculator
continue to work unchanged.
MaxAbsScalerApplier
Bases: BaseApplier
Divide the selected columns by their fitted maximum absolute value.
Source code in skyulf-core/skyulf/preprocessing/scaling/maxabs.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 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 | |
apply(X, _y, params)
Scale X by the fitted max-abs values; y passes through.
Source code in skyulf-core/skyulf/preprocessing/scaling/maxabs.py
55 56 57 58 59 60 | |
inference_capability(state, *, engine)
staticmethod
Describe local saved apply context without granting worker execution.
Source code in skyulf-core/skyulf/preprocessing/scaling/maxabs.py
47 48 49 50 51 52 53 | |
validate_inference_state(raw)
staticmethod
Inspect saved local statistics without changing them or fitting data.
Source code in skyulf-core/skyulf/preprocessing/scaling/maxabs.py
36 37 38 39 40 41 42 43 44 45 | |
MaxAbsScalerCalculator
Bases: BaseCalculator
Fit per-column maximum-absolute-value statistics via sklearn's MaxAbsScaler.
Source code in skyulf-core/skyulf/preprocessing/scaling/maxabs.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 130 131 132 133 134 135 136 137 138 139 | |
fit(X, _y, config)
Dispatch the fit to the active engine and return the max-abs statistics artifact.
Source code in skyulf-core/skyulf/preprocessing/scaling/maxabs.py
117 118 119 120 121 122 123 124 125 | |
infer_output_schema(input_schema, config)
Return a schema with transformed columns promoted to float64.
Source code in skyulf-core/skyulf/preprocessing/scaling/maxabs.py
111 112 113 114 115 | |
MinMaxScalerApplier
Bases: BaseApplier
Rescale selected columns or replay an explicit empty selection unchanged.
Empty artifacts declare identity only with an explicit empty column recipe. Automatic selections and non-finite learned coefficients remain unreviewed.
Source code in skyulf-core/skyulf/preprocessing/scaling/minmax.py
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 82 83 84 | |
apply(X, _y, params)
Apply the fitted affine scale/shift to X; y passes through.
Source code in skyulf-core/skyulf/preprocessing/scaling/minmax.py
48 49 50 51 52 53 | |
resolve_fitted_config(raw, state)
staticmethod
Bind inference configuration to this node's inspected fitted artifact.
Source code in skyulf-core/skyulf/preprocessing/scaling/minmax.py
41 42 43 44 45 46 | |
validate_fitted_state(raw)
staticmethod
Inspect this node's supported saved state without fitting or applying data.
Source code in skyulf-core/skyulf/preprocessing/scaling/minmax.py
36 37 38 39 | |
MinMaxScalerCalculator
Bases: BaseCalculator
Fit scale/offset statistics that map the data into feature_range.
Source code in skyulf-core/skyulf/preprocessing/scaling/minmax.py
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 | |
fit(X, _y, config)
Dispatch the fit to the active engine and return the scaler-statistics artifact.
Source code in skyulf-core/skyulf/preprocessing/scaling/minmax.py
112 113 114 115 116 117 118 119 120 | |
infer_output_schema(input_schema, config)
Return a schema with transformed columns promoted to float64.
Source code in skyulf-core/skyulf/preprocessing/scaling/minmax.py
106 107 108 109 110 | |
RobustScalerApplier
Bases: BaseApplier
Center on the fitted median and scale by the fitted quantile spread.
Honors with_centering/with_scaling; y is never modified.
Source code in skyulf-core/skyulf/preprocessing/scaling/robust.py
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 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 | |
apply(X, _y, params)
Apply the fitted robust center/scale to X on the active engine.
Source code in skyulf-core/skyulf/preprocessing/scaling/robust.py
74 75 76 77 78 79 | |
inference_capability(state, *, engine)
staticmethod
Describe local saved apply context without granting worker execution.
Source code in skyulf-core/skyulf/preprocessing/scaling/robust.py
66 67 68 69 70 71 72 | |
validate_inference_state(raw)
staticmethod
Inspect saved local flags and statistics without recalculating quantiles.
Source code in skyulf-core/skyulf/preprocessing/scaling/robust.py
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 | |
RobustScalerCalculator
Bases: BaseCalculator
Fit outlier-robust median/quantile-range statistics via sklearn's RobustScaler.
Source code in skyulf-core/skyulf/preprocessing/scaling/robust.py
144 145 146 147 148 149 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 185 186 187 188 189 190 191 | |
fit(X, _y, config)
Dispatch the fit to the active engine and return the robust-statistics artifact.
Source code in skyulf-core/skyulf/preprocessing/scaling/robust.py
169 170 171 172 173 174 175 176 177 | |
infer_output_schema(input_schema, config)
Return a schema with transformed columns promoted to float64.
Source code in skyulf-core/skyulf/preprocessing/scaling/robust.py
161 162 163 164 165 166 167 | |
StandardScalerApplier
Bases: BaseApplier
Standardize the selected columns using the fitted mean and scale.
Honors with_mean/with_std; X passes through unchanged when the
enabled flags have no fitted statistics, and y is never modified.
Spark validates portable state and applies native expressions without a
data action. Its selected numeric columns become double when scaling is enabled.
Source code in skyulf-core/skyulf/preprocessing/scaling/standard.py
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 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 | |
apply(X, _y, params)
Center and scale X with the fitted statistics on the active engine.
Source code in skyulf-core/skyulf/preprocessing/scaling/standard.py
70 71 72 73 74 75 76 77 78 79 80 81 | |
resolve_fitted_config(raw, state)
staticmethod
Bind inference configuration to this node's inspected fitted artifact.
Source code in skyulf-core/skyulf/preprocessing/scaling/standard.py
65 66 67 68 | |
validate_fitted_state(raw)
staticmethod
Inspect this node's supported saved state without fitting or applying data.
Source code in skyulf-core/skyulf/preprocessing/scaling/standard.py
60 61 62 63 | |
StandardScalerCalculator
Bases: BaseCalculator
Fit per-column statistics using sklearn locally or native Spark aggregates.
Spark uses population variance (ddof=0), ignores null/NaN observations,
and returns at most two statistics rows to the driver. Both options default
to True. Empty explicit training selections produce a no-op artifact;
selected features with zero training rows cannot be fitted.
Source code in skyulf-core/skyulf/preprocessing/scaling/standard.py
149 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 185 186 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 | |
fit(X, _y, config)
Dispatch the fit to the active engine and return the scaler-statistics artifact.
Source code in skyulf-core/skyulf/preprocessing/scaling/standard.py
206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 | |
infer_output_schema(input_schema, config)
Return a schema with touched numeric columns promoted to float64.
Source code in skyulf-core/skyulf/preprocessing/scaling/standard.py
198 199 200 201 202 203 204 | |