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
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 149 150 151 152 153 154 155 156 157 158 159 160 | |
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
113 114 115 116 117 118 | |
inference_capability(state, *, engine)
staticmethod
Retain conservative whole-request scope for fitted power transforms.
Source code in skyulf-core/skyulf/preprocessing/transformations/general.py
102 103 104 105 106 107 108 109 110 111 | |
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
91 92 93 94 95 96 97 98 99 100 | |
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
230 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 | |
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
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 | |
infer_output_schema(input_schema, config)
Return updated dtypes for transformed numeric columns.
Source code in skyulf-core/skyulf/preprocessing/transformations/general.py
249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 | |
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
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 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 | |
apply(X, _y, params)
Transform valid rows with stored lambdas and align y by position.
Invalid numeric rows are excluded and counted in a warning. Missing values remain missing for later imputers. Valid neighbours keep their fitted transform. Missing fitted columns are warned about; malformed state and unexpected implementation errors raise.
Source code in skyulf-core/skyulf/preprocessing/transformations/power.py
216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 | |
inference_capability(state, *, engine)
staticmethod
Declare row-local filtering of invalid selected values and transformed outputs.
Source code in skyulf-core/skyulf/preprocessing/transformations/power.py
206 207 208 209 210 211 212 213 214 | |
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
191 192 193 194 195 196 197 198 199 200 201 202 203 204 | |
PowerTransformerCalculator
Bases: BaseCalculator
Fit one shared PowerTransformer across the selected columns.
Source code in skyulf-core/skyulf/preprocessing/transformations/power.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 | |
fit(X, _y, config)
Fit selected columns on valid rows, excluding invalid rows from learned statistics.
Source code in skyulf-core/skyulf/preprocessing/transformations/power.py
286 287 288 289 290 291 292 293 294 295 296 297 298 | |
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
280 281 282 283 284 | |
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 154 155 156 157 158 159 160 161 162 163 | |
fit(df, config)
Validate requested math methods and save the ordered rules without fitting.
Source code in skyulf-core/skyulf/preprocessing/transformations/simple.py
143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 | |
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 | |