API: preprocessing.transformations
skyulf.preprocessing.transformations
Transformation nodes package.
Importing this package registers PowerTransformer / SimpleTransformation / GeneralTransformation with the node registry and re-exports their public classes.
GeneralTransformationApplier
Bases: BaseApplier
Apply per-column simple ops or fitted Box-Cox/Yeo-Johnson transforms.
Source code in skyulf-core/skyulf/preprocessing/transformations/general.py
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 149 150 151 152 153 154 155 156 157 158 159 160 161 | |
apply(X, _y, params)
Run each configured transformation on the active engine; y passes through.
Source code in skyulf-core/skyulf/preprocessing/transformations/general.py
114 115 116 117 118 119 | |
inference_capability(state, *, engine)
staticmethod
Separate pointwise formulas from batch-dependent power failure fallback.
Source code in skyulf-core/skyulf/preprocessing/transformations/general.py
103 104 105 106 107 108 109 110 111 112 | |
validate_inference_state(raw)
staticmethod
Inspect ordered saved rules while retaining the existing simple-rule checks.
Source code in skyulf-core/skyulf/preprocessing/transformations/general.py
92 93 94 95 96 97 98 99 100 101 | |
GeneralTransformationCalculator
Bases: BaseCalculator
Resolve configured transformations, fitting lambdas for the power methods.
Rules run in list order. Each power rule is fitted on the training values
produced by earlier rules on the same column, matching artifact replay.
Each power rule accepts standardize (default True). Set it to
False to apply only the fitted Box-Cox or Yeo-Johnson transform.
The artifact retains the choice for subsequent transforms.
Source code in skyulf-core/skyulf/preprocessing/transformations/general.py
231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 | |
fit(X, _y, config)
Fit power lambdas in rule order; retain simple ops in the artifact.
Box-Cox is skipped (with a warning) for non-positive values at that point in the rule sequence. A fit failure logs and skips that rule.
Source code in skyulf-core/skyulf/preprocessing/transformations/general.py
268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 | |
infer_output_schema(input_schema, config)
Return updated dtypes for transformed numeric columns.
Source code in skyulf-core/skyulf/preprocessing/transformations/general.py
250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 | |
PowerTransformerApplier
Bases: BaseApplier
Apply the fitted Box-Cox / Yeo-Johnson transform to the selected columns.
Source code in skyulf-core/skyulf/preprocessing/transformations/power.py
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 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 | |
apply(X, _y, params)
Rebuild the transformer from stored lambdas and transform X; y untouched.
Fails open, like every applier in preprocessing/transformations/: a
failed transform is logged at ERROR with its traceback and leaves the data
unchanged, so a degraded frame beats a hard failure at inference time.
Every path that leaves data untransformed logs — including the one that
used not to, a frame missing columns the transformer was fitted on, which
is train/serve skew rather than a no-op and is warned about by name.
Source code in skyulf-core/skyulf/preprocessing/transformations/power.py
121 122 123 124 125 126 127 128 129 130 131 132 133 134 | |
inference_capability(state, *, engine)
staticmethod
Expose whole-request fallback when any value prevents a power transform.
Source code in skyulf-core/skyulf/preprocessing/transformations/power.py
112 113 114 115 116 117 118 119 | |
validate_inference_state(raw)
staticmethod
Inspect the saved lambdas and scaler without normalizing or relearning them.
Source code in skyulf-core/skyulf/preprocessing/transformations/power.py
97 98 99 100 101 102 103 104 105 106 107 108 109 110 | |
PowerTransformerCalculator
Bases: BaseCalculator
Fit one shared PowerTransformer across the selected columns.
Source code in skyulf-core/skyulf/preprocessing/transformations/power.py
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 | |
fit(X, _y, config)
Fit per-column lambdas, dropping columns Box-Cox cannot accept.
Source code in skyulf-core/skyulf/preprocessing/transformations/power.py
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 | |
infer_output_schema(input_schema, config)
Return a schema with transformed columns promoted to float64.
Source code in skyulf-core/skyulf/preprocessing/transformations/power.py
192 193 194 195 196 | |
SimpleTransformationApplier
Bases: BaseApplier
Apply the configured per-column math transformations (log, sqrt, ...).
Source code in skyulf-core/skyulf/preprocessing/transformations/simple.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 | |
apply(X, _y, params)
Run each configured transformation on the active engine; y passes through.
Source code in skyulf-core/skyulf/preprocessing/transformations/simple.py
58 59 60 61 62 63 | |
inference_capability(state, *, engine)
staticmethod
Describe native pointwise math as local row-preserving inference.
Source code in skyulf-core/skyulf/preprocessing/transformations/simple.py
50 51 52 53 54 55 56 | |
validate_inference_state(raw)
staticmethod
Inspect ordered native rules without consuming iterators or normalizing state.
Source code in skyulf-core/skyulf/preprocessing/transformations/simple.py
37 38 39 40 41 42 43 44 45 46 47 48 | |
SimpleTransformationCalculator
Bases: BaseCalculator
Package the configured transformations into an artifact without reading the data.
Source code in skyulf-core/skyulf/preprocessing/transformations/simple.py
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 | |
fit(df, config)
Return the transformations config as-is; nothing is fitted.
Source code in skyulf-core/skyulf/preprocessing/transformations/simple.py
143 144 145 146 147 148 149 150 151 152 153 | |
infer_output_schema(input_schema, config)
Return updated dtypes for transformed numeric columns.
Source code in skyulf-core/skyulf/preprocessing/transformations/simple.py
125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 | |