API: preprocessing
The preprocessing package contains Calculator/Applier nodes and the FeatureEngineer orchestrator.
skyulf.preprocessing
Preprocessing nodes: one Calculator/Applier pair per pipeline step.
Importing this package re-exports the public node surface listed in __all__
and, as a side effect, runs every @NodeRegistry.register decorator — which
is why the imports below are explicit rather than auto-discovered.
AuditedFoldPreprocessor
Decorates a :class:FoldPreprocessor to record per-fold row counts.
Every fit_transform/transform call records the number of input
rows it received. The isolation invariant a leak-free run must satisfy is
max(fit_rows) <= train_rows — a leaked fit would see the train split
plus held-out rows. Exposed via :meth:summary so the app can log it and
persist it in node metrics for post-hoc audit (findings 2026-08-26 §3/B).
Source code in skyulf-core/skyulf/preprocessing/fold_adapter.py
376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 | |
inner
property
Return the wrapped preprocessor.
__init__(inner)
Wrap inner and start both row-count logs empty.
changes_row_count is mirrored from inner when it declares one
and defaults to False, keeping the decorator transparent to callers
that inspect the flag.
Source code in skyulf-core/skyulf/preprocessing/fold_adapter.py
386 387 388 389 390 391 392 393 394 395 396 | |
fit_transform(X, y, *, sample_weight=None)
Log the fit-time input row count, then delegate to inner.
Source code in skyulf-core/skyulf/preprocessing/fold_adapter.py
403 404 405 406 407 408 | |
original_target_labels(labels)
Forward optional fitted target decoding without inferring label identities.
Source code in skyulf-core/skyulf/preprocessing/fold_adapter.py
419 420 421 422 | |
summary(train_rows=None)
Return per-fold call counts and the largest fit payload seen.
isolation_ok appears only when train_rows is supplied; omitting
it leaves the invariant unevaluated rather than assumed satisfied.
Source code in skyulf-core/skyulf/preprocessing/fold_adapter.py
433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 | |
transform(X, y)
Log the transform-time input row count, then delegate to inner.
Source code in skyulf-core/skyulf/preprocessing/fold_adapter.py
410 411 412 413 414 415 416 417 | |
transform_tracking_order(X)
Record prediction transforms while retaining optional positional lineage.
Source code in skyulf-core/skyulf/preprocessing/fold_adapter.py
424 425 426 427 428 429 430 431 | |
BaseApplier
Bases: ABC
Transforming half of a node pair: applies a fitted artifact to data.
Subclasses implement :meth:apply, taking everything they need from
params so the same applier instance can be reused across splits and
datasets without carrying state.
Source code in skyulf-core/skyulf/preprocessing/base.py
144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 | |
apply(df, params)
abstractmethod
Applies the transformation using fitted parameters.
The return type is intentionally Any because the concrete shape
depends on the input: passing a DataFrame returns a DataFrame;
passing an (X, y) tuple returns a tuple; splitters return
SplitDataset. Encoding every case as a union forces callers to
defensively narrow on every use, which is worse than Any here.
Source code in skyulf-core/skyulf/preprocessing/base.py
152 153 154 155 156 157 158 159 160 161 | |
BaseCalculator
Bases: ABC
Learning half of a node pair: derives parameters and returns them as an artifact.
Subclasses implement :meth:fit and hand back a plain mapping that the
matching :class:BaseApplier consumes. Calculators never transform data
and hold no state between calls.
Source code in skyulf-core/skyulf/preprocessing/base.py
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 | |
fit(df, config)
abstractmethod
Calculates parameters from the training data.
Returns a Mapping of fitted parameters (typically a TypedDict
*Artifact declared in preprocessing._artifacts). The return
type is Mapping rather than Dict so concrete TypedDict
subclasses are valid LSP-substitutable returns.
Source code in skyulf-core/skyulf/preprocessing/base.py
112 113 114 115 116 117 118 119 120 121 122 | |
infer_output_schema(input_schema, config)
Best-effort prediction of the output schema from config alone.
Override this in concrete Calculators when the output columns/dtypes
can be derived purely from input_schema and config (i.e.
without seeing data). Examples:
- Scalers — preserve column names and predict output dtype promotion.
- Drop columns by name — drop the configured names.
- One-hot — adds K columns per categorical (K is data-dependent →
return
None).
Default returns None to signal "unknown / data-dependent";
callers should fall back to runtime introspection.
Source code in skyulf-core/skyulf/preprocessing/base.py
124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 | |
CastingApplier
Bases: BaseApplier
Cast each column named in type_map to its target dtype on the active engine.
coerce_on_error=True (the default) is best-effort per column: the pandas
path swallows any cast failure and leaves that column untouched, the polars
path casts with strict=False. With it off, both engines raise. The
awkward families are hand-written on each path because the native casts
disagree — polars truncates fractional floats where pandas masks them, and
pandas' astype clamps out-of-range integers where polars nulls or raises.
Boolean targets additionally go through the shared alias table so
"yes"/"no"-style strings coerce the same way on both engines in best-effort
mode, including Polars Categorical and Enum labels. Text-to-datetime casts
share the pandas mixed-format parser and retain the resolved engine dtype.
Columns missing from the frame are skipped. New categorical artifacts
freeze the training vocabulary; unseen values become missing. Older
artifacts without a vocabulary retain their original casting behavior.
Source code in skyulf-core/skyulf/preprocessing/casting.py
531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 | |
apply(X, _y, params)
Dispatch through the mapping-keyed dual-engine path; y passes through.
Source code in skyulf-core/skyulf/preprocessing/casting.py
570 571 572 573 574 575 | |
inference_capability(state, *, engine)
staticmethod
Describe local casts, including request-derived legacy pandas vocabularies.
Source code in skyulf-core/skyulf/preprocessing/casting.py
561 562 563 564 565 566 567 568 | |
validate_inference_state(raw)
staticmethod
Inspect local dtype/vocabulary state without converting or relearning it.
Source code in skyulf-core/skyulf/preprocessing/casting.py
549 550 551 552 553 554 555 556 557 558 559 | |
CastingCalculator
Bases: BaseCalculator
Normalise either accepted config shape into one canonical type_map.
Ordinary casts resolve dtype aliases through TYPE_ALIASES. Category
casts additionally learn the observed training vocabulary so applying a
held-out batch cannot change the accepted categories or pandas codes.
Source code in skyulf-core/skyulf/preprocessing/casting.py
578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 | |
fit(X, _y, config)
Merge the two config shapes into a type_map of columns present on X.
Absent columns are dropped rather than erroring, so a config written
against a wider frame degrades to a partial cast; when both shapes name
the same column, target_type overwrites the column_types entry.
Source code in skyulf-core/skyulf/preprocessing/casting.py
616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 | |
infer_output_schema(input_schema, config)
Rewrite the dtype labels of input_schema for every column the config targets.
The shared target_type overrides per-column choices, matching fit.
Columns absent from the input schema are skipped, as they are at runtime.
Source code in skyulf-core/skyulf/preprocessing/casting.py
595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 | |
ClipValuesApplier
Bases: BaseApplier
Set values below lower to lower and above upper to upper.
Nulls stay null, other columns are untouched and every row is kept, so unlike ManualBounds this step also runs on scoring rows.
Source code in skyulf-core/skyulf/preprocessing/outliers/clip_values.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 | |
apply(X, y, params)
Clip the configured columns on the active engine; y passes through.
Source code in skyulf-core/skyulf/preprocessing/outliers/clip_values.py
108 109 110 111 112 113 114 | |
resolve_fitted_config(raw, state)
staticmethod
Bind inference configuration to this node's inspected fitted artifact.
Source code in skyulf-core/skyulf/preprocessing/outliers/clip_values.py
96 97 98 99 100 101 102 103 104 105 106 | |
validate_fitted_state(raw)
staticmethod
Inspect this node's supported saved state without fitting or applying data.
Source code in skyulf-core/skyulf/preprocessing/outliers/clip_values.py
91 92 93 94 | |
ClipValuesCalculator
Bases: BaseCalculator
Validate the configured bounds; nothing is learned from the data.
bounds maps a column to {"lower": ..., "upper": ...}; either side
may be omitted. Use Winsorize for bounds learned from percentiles.
Source code in skyulf-core/skyulf/preprocessing/outliers/clip_values.py
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 178 179 180 181 | |
fit(X, _y, config)
Return the validated bounds as the artifact.
Source code in skyulf-core/skyulf/preprocessing/outliers/clip_values.py
174 175 176 177 178 179 180 181 | |
infer_output_schema(input_schema, config)
Promote fractionally bounded columns to match both runtime engines.
Source code in skyulf-core/skyulf/preprocessing/outliers/clip_values.py
164 165 166 167 168 169 170 171 172 | |
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 | |
CountVectorizerApplier
Bases: BaseApplier
Attach one token-count column per vocabulary term to the frame.
The configured text columns are joined into a single corpus string before
transforming, the dense result is concatenated on, and the source columns
survive unless drop_original is set. This node uses the text-specific
dispatcher: the polars path runs natively, so only the text payload crosses
into sklearn, and it falls back to a full pandas round-trip when a text
column is not String dtype.
Source code in skyulf-core/skyulf/preprocessing/vectorization/count_vectorizer.py
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 | |
apply(X, _y, params)
Dispatch through the text-specific dual-engine path; y passes through.
Source code in skyulf-core/skyulf/preprocessing/vectorization/count_vectorizer.py
86 87 88 89 90 91 | |
inference_capability(state, *, engine)
staticmethod
Describe fixed per-document counts without promising callback or memory safety.
Source code in skyulf-core/skyulf/preprocessing/vectorization/count_vectorizer.py
76 77 78 79 80 81 82 83 84 | |
validate_inference_state(raw)
staticmethod
Inspect saved vocabulary and binary settings without fitting or transforming.
Source code in skyulf-core/skyulf/preprocessing/vectorization/count_vectorizer.py
63 64 65 66 67 68 69 70 71 72 73 74 | |
CountVectorizerCalculator
Bases: BaseCalculator
Fit a CountVectorizer vocabulary on the joined text of the resolved columns.
The vocabulary — and therefore the output width — is learned from the
training corpus, so the artifact is not derivable from config alone. A
vocabulary over _LARGE_VOCAB_THRESHOLD columns is warned about rather
than raising, since a wide bag-of-words is a memory problem, not an error.
Schema inference inherits the base None result: the learned vocabulary
determines the output columns, so their schema is only known at runtime.
Source code in skyulf-core/skyulf/preprocessing/vectorization/count_vectorizer.py
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 | |
fit(X, _y, config)
Narrow to the configured text columns and fit the vocabulary on their joined text.
An empty or wholly-absent column selection yields an empty artifact so
the applier no-ops. An empty vocabulary also yields an empty artifact
with a warning; source columns are retained even with drop_original.
Source code in skyulf-core/skyulf/preprocessing/vectorization/count_vectorizer.py
188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 | |
CustomBinningApplier
Bases: GeneralBinningApplier
Describe fixed-edge inference while reusing the shared binning apply logic.
Source code in skyulf-core/skyulf/preprocessing/bucketing.py
722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 | |
inference_capability(state, *, engine)
staticmethod
Describe row dependencies; exact batch schema equivalence needs a real probe.
Source code in skyulf-core/skyulf/preprocessing/bucketing.py
730 731 732 733 734 735 736 | |
validate_inference_state(raw)
staticmethod
Inspect actual local fitted state unchanged, including the explicit empty no-op.
Source code in skyulf-core/skyulf/preprocessing/bucketing.py
725 726 727 728 | |
CustomBinningCalculator
Bases: BaseCalculator
Apply user-supplied bin edges to selected columns.
Source code in skyulf-core/skyulf/preprocessing/bucketing.py
739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 | |
fit(X, _y, config)
Attach one shared, sorted edge list from config["bins"] to every selected column.
Edges are fixed, but automatic column selection examines observed
values to exclude binary, constant, and all-missing columns.
Unlike :class:GeneralBinningCalculator
the same edges go to every column, so a multi-column selection spanning
different scales will push the out-of-scale columns' values outside the
outer bins, where both engines null them. An empty or absent bins
leaves bin_edges empty, which makes apply a no-op.
Source code in skyulf-core/skyulf/preprocessing/bucketing.py
751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 | |
DataSnapshotApplier
Bases: BaseApplier
Passthrough applier; the snapshot is produced entirely at fit time.
Source code in skyulf-core/skyulf/preprocessing/inspection.py
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(df, params)
Return df unchanged, ignoring the captured snapshot.
Source code in skyulf-core/skyulf/preprocessing/inspection.py
178 179 180 181 182 183 184 | |
inference_capability(state, *, engine)
staticmethod
Describe the existing passthrough without taking another snapshot.
Source code in skyulf-core/skyulf/preprocessing/inspection.py
170 171 172 173 174 175 176 | |
validate_inference_state(raw)
staticmethod
Check ownership without interpreting or recapturing training values.
Source code in skyulf-core/skyulf/preprocessing/inspection.py
164 165 166 167 168 | |
DataSnapshotCalculator
Bases: BaseCalculator
Capture the leading rows of the input as plain record dicts.
Source code in skyulf-core/skyulf/preprocessing/inspection.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 | |
fit(X, _y, config)
Return the first config["n_rows"] rows (default 5) as dicts.
Rows are serialised eagerly at fit time, so the snapshot is unaffected by later mutation of the source frame.
Source code in skyulf-core/skyulf/preprocessing/inspection.py
206 207 208 209 210 211 212 213 214 215 216 217 218 | |
infer_output_schema(input_schema, config)
Return input_schema untouched.
Source code in skyulf-core/skyulf/preprocessing/inspection.py
199 200 201 202 203 204 | |
DatasetProfileApplier
Bases: BaseApplier
Passthrough applier; the profile is produced entirely at fit time.
Source code in skyulf-core/skyulf/preprocessing/inspection.py
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 | |
apply(df, params)
Return df unchanged, ignoring the fitted profile.
Source code in skyulf-core/skyulf/preprocessing/inspection.py
95 96 97 98 99 100 101 102 | |
inference_capability(state, *, engine)
staticmethod
Describe the existing passthrough without collecting new statistics.
Source code in skyulf-core/skyulf/preprocessing/inspection.py
87 88 89 90 91 92 93 | |
validate_inference_state(raw)
staticmethod
Check ownership while leaving the unused training report untouched.
Source code in skyulf-core/skyulf/preprocessing/inspection.py
81 82 83 84 85 | |
DatasetProfileCalculator
Bases: BaseCalculator
Summarise shape, dtypes, missingness and numeric statistics.
Numeric statistics include supported integer, unsigned integer, float and Decimal columns, even when binary, constant, entirely missing or empty. Boolean, categorical and temporal columns retain their dtype/missingness metadata but are not treated as numeric features.
Source code in skyulf-core/skyulf/preprocessing/inspection.py
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 | |
fit(X, _y, config)
Collect row/column counts, dtypes, missing counts and numeric stats.
Numeric statistics come from Polars describe() or pandas
describe() depending on the engine, so the per-column metric names
are not identical across engines.
Source code in skyulf-core/skyulf/preprocessing/inspection.py
130 131 132 133 134 135 136 137 138 139 140 141 142 143 | |
infer_output_schema(input_schema, config)
Return input_schema untouched.
Source code in skyulf-core/skyulf/preprocessing/inspection.py
123 124 125 126 127 128 | |
DateFeaturesApplier
Bases: BaseApplier
Append calendar-part columns extracted from the configured datetime columns.
Source code in skyulf-core/skyulf/preprocessing/time_series/date_features.py
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 | |
apply(X, _y, params)
Extract the configured calendar features on the active engine; y passes through.
Source code in skyulf-core/skyulf/preprocessing/time_series/date_features.py
251 252 253 254 | |
inference_capability(state, *, engine)
staticmethod
Describe saved UTC parsing without promising legacy mixed-timezone behavior.
Source code in skyulf-core/skyulf/preprocessing/time_series/date_features.py
241 242 243 244 245 246 247 248 249 | |
validate_inference_state(raw)
staticmethod
Inspect saved calendar settings without parsing data or changing legacy defaults.
Source code in skyulf-core/skyulf/preprocessing/time_series/date_features.py
223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 | |
DateFeaturesCalculator
Bases: BaseCalculator
Record calendar features using UTC for every newly fitted artifact.
Offset-aware timestamps are converted to UTC before extracting their
calendar parts; naive values are treated as UTC without shifting their
clock time. Unparseable values produce null features. Artifacts fitted
before this contract retain their original engine-specific interpretation
so an existing model's input features do not silently change on reload.
Refit the complete pipeline to adopt UTC for such models. Numeric epochs
require an explicit epoch_unit (s, ms, us or ns), including on replay
of legacy artifacts; units are never inferred from numeric magnitude.
Source code in skyulf-core/skyulf/preprocessing/time_series/date_features.py
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 310 311 312 313 314 315 316 317 318 319 320 | |
fit(df, config)
Record the columns and supported features, defaulting to year/month/day/dayofweek.
Source code in skyulf-core/skyulf/preprocessing/time_series/date_features.py
285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 | |
infer_output_schema(input_schema, config)
Add a nullable-int column per (column, feature); drop originals on request.
Source code in skyulf-core/skyulf/preprocessing/time_series/date_features.py
302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 | |
DeduplicateApplier
Bases: BaseApplier
Drop duplicate rows, keeping y aligned with the survivors.
Both engines must agree on which rows survive. y is filtered by kept
positions, never by label — a label-based .loc returns every row
matching a duplicated index label. On polars the dedup key has to be
resolved to the real columns before the tracking row index is added,
because unique(subset=None) would include that always-unique index and
defeat deduplication entirely. keep="none" drops every member of a
duplicate group and is spelled False for pandas but "none" for
polars.
Source code in skyulf-core/skyulf/preprocessing/drop_and_missing/deduplicate.py
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 | |
apply(X, y, params)
Dispatch to the engine-specific dedup, forwarding (X, y) only when y exists.
Source code in skyulf-core/skyulf/preprocessing/drop_and_missing/deduplicate.py
86 87 88 89 90 91 92 93 94 95 | |
inference_capability(state, *, engine)
staticmethod
Require complete duplicate groups before choosing which rows survive.
Source code in skyulf-core/skyulf/preprocessing/drop_and_missing/deduplicate.py
79 80 81 82 83 84 | |
DeduplicateCalculator
Bases: BaseCalculator
Resolve dedup config into an artifact.
The node is flagged learns_from_data because which rows survive depends
on the data, but fit itself only reads config.
Source code in skyulf-core/skyulf/preprocessing/drop_and_missing/deduplicate.py
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 | |
fit(df, config)
Carry the subset and keep policy into the artifact.
Source code in skyulf-core/skyulf/preprocessing/drop_and_missing/deduplicate.py
121 122 123 124 125 126 127 | |
infer_output_schema(input_schema, config)
Pass the input schema through: rows are dropped, columns are preserved.
Source code in skyulf-core/skyulf/preprocessing/drop_and_missing/deduplicate.py
114 115 116 117 118 119 | |
DropMissingColumnsApplier
Bases: BaseApplier
Drop the columns the calculator selected, skipping names no longer on the frame.
The selection is already baked into params; this half is a pure drop
and leaves y alone, so both engine paths are identical by construction.
Source code in skyulf-core/skyulf/preprocessing/drop_and_missing/drop_columns.py
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 | |
apply(X, _y, params)
Dispatch the column drop to the pandas or polars path; y passes through.
Source code in skyulf-core/skyulf/preprocessing/drop_and_missing/drop_columns.py
50 51 52 53 54 55 56 57 | |
inference_capability(state, *, engine)
staticmethod
Describe local saved apply context without granting worker execution.
Source code in skyulf-core/skyulf/preprocessing/drop_and_missing/drop_columns.py
42 43 44 45 46 47 48 | |
validate_inference_state(raw)
staticmethod
Inspect the saved drop set; threshold metadata no longer controls apply.
Source code in skyulf-core/skyulf/preprocessing/drop_and_missing/drop_columns.py
35 36 37 38 39 40 | |
DropMissingColumnsCalculator
Bases: BaseCalculator
Select columns to drop: an explicit list unioned with those over the missing-% threshold.
The threshold half is data-dependent, so fit runs an engine-specific
path and the two must agree on the missing count. They do not for free:
polars' null_count() ignores NaN where pandas' isna() counts it, so
float columns add an explicit NaN count on the polars side.
Source code in skyulf-core/skyulf/preprocessing/drop_and_missing/drop_columns.py
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 | |
fit(df, config)
Compute the drop set on the frame's own engine and return it as the artifact.
Source code in skyulf-core/skyulf/preprocessing/drop_and_missing/drop_columns.py
163 164 165 166 167 168 169 170 171 172 | |
infer_output_schema(input_schema, config)
Predict the surviving columns, or None when a threshold makes that data-dependent.
Without a positive threshold the result is exactly the input minus the explicit list; with one, which columns go depends on the data and callers must fall back to runtime introspection.
Source code in skyulf-core/skyulf/preprocessing/drop_and_missing/drop_columns.py
147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 | |
DropMissingRowsApplier
Bases: BaseApplier
Drop rows exceeding the configured missingness policy, keeping y in sync.
This node changes the row count, so the pandas and polars paths must drop
the same rows and filter y by the identical kept positions. The
pandas path therefore computes its keep mask positionally: label-based
.loc returns every row matching a duplicated index label, which
desynchronises y from the cleaned X. A subset that is empty or
names only nonexistent columns collapses to None, which both engines
read as "check every column" rather than as a no-op.
Source code in skyulf-core/skyulf/preprocessing/drop_and_missing/drop_rows.py
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 | |
apply(X, y, params)
Dispatch to the engine-specific dropna, forwarding (X, y) only when y exists.
Source code in skyulf-core/skyulf/preprocessing/drop_and_missing/drop_rows.py
155 156 157 158 159 160 161 162 163 | |
inference_capability(state, *, engine)
staticmethod
Describe native filtering; ordinary prediction skips this training policy.
Source code in skyulf-core/skyulf/preprocessing/drop_and_missing/drop_rows.py
138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 | |
validate_inference_state(raw)
staticmethod
Inspect the saved policy without filtering data or converting native values.
Source code in skyulf-core/skyulf/preprocessing/drop_and_missing/drop_rows.py
129 130 131 132 133 134 135 136 | |
DropMissingRowsCalculator
Bases: BaseCalculator
Resolve drop-missing-rows config into an artifact; nothing is learned from data.
Source code in skyulf-core/skyulf/preprocessing/drop_and_missing/drop_rows.py
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 | |
fit(df, config)
Carry the dropna policy into the artifact.
Reads only config, so it takes df directly and needs no
@fit_method unpacking of (X, y). Both engines apply the policy
in the same precedence: an absolute threshold outranks the
percentage missing_threshold, which outranks how.
Source code in skyulf-core/skyulf/preprocessing/drop_and_missing/drop_rows.py
185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 | |
infer_output_schema(input_schema, config)
Pass the input schema through: rows are dropped, columns are preserved.
Source code in skyulf-core/skyulf/preprocessing/drop_and_missing/drop_rows.py
178 179 180 181 182 183 | |
EllipticEnvelopeApplier
Bases: BaseApplier
Drop rows that any fitted per-column EllipticEnvelope model flags as an outlier.
Source code in skyulf-core/skyulf/preprocessing/outliers/elliptic.py
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 178 179 180 181 182 183 184 185 186 187 188 | |
apply(X, y, params)
Filter rows through the fitted per-column models on the active engine.
Source code in skyulf-core/skyulf/preprocessing/outliers/elliptic.py
161 162 163 164 165 166 167 168 169 170 171 | |
inference_capability(state, *, engine)
staticmethod
Describe fitted row filtering with nonfinite rows preserved by the native applier.
Source code in skyulf-core/skyulf/preprocessing/outliers/elliptic.py
152 153 154 155 156 157 158 159 | |
validate_inference_state(raw)
staticmethod
Inspect saved envelopes and skipped-column metadata without estimating covariance.
Source code in skyulf-core/skyulf/preprocessing/outliers/elliptic.py
134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 | |
EllipticEnvelopeCalculator
Bases: BaseCalculator
Fit one univariate EllipticEnvelope per numeric column at the configured contamination.
Source code in skyulf-core/skyulf/preprocessing/outliers/elliptic.py
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 | |
fit(X, _y, config)
Fit the per-column envelopes, skipping columns with fewer than five usable samples.
Source code in skyulf-core/skyulf/preprocessing/outliers/elliptic.py
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 | |
infer_output_schema(input_schema, config)
Return the input schema unchanged: row filtering preserves the column set.
Source code in skyulf-core/skyulf/preprocessing/outliers/elliptic.py
203 204 205 206 207 208 | |
FeatureEngineer
Orchestrates a sequence of feature engineering steps.
Examples:
>>> engineer = FeatureEngineer([])
>>> transformed, metrics = engineer.fit_transform(data)
Source code in skyulf-core/skyulf/preprocessing/pipeline.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 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 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 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 | |
__init__(steps_config, *, _validated=False, frame_spec=None, execution_options=None)
Store the ordered step configuration, validating it unless the caller already did.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
steps_config
|
Sequence[PreprocessingStepConfig | dict[str, Any]]
|
Pipeline steps in execution order, as dicts or
|
required |
_validated
|
bool
|
Skip |
False
|
frame_spec
|
FrameSpec | None
|
Explicit keys and optional target for a single Spark frame. |
None
|
execution_options
|
ExecutionOptions | None
|
Opt-in engine selection; must match the input engine. |
None
|
Source code in skyulf-core/skyulf/preprocessing/pipeline.py
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 | |
export_state()
Export supported fitted steps as bounded, versioned UTF-8 JSON bytes.
SimpleImputer mean/constant and StandardScaler are supported. Learned column selection is frozen; row keys, target and runtime objects are supplied again when loading. The complete payload must fit the execution state byte budget (8 MiB by default). Callers own storage and transport.
Source code in skyulf-core/skyulf/preprocessing/pipeline.py
148 149 150 151 152 153 154 155 156 | |
fit_transform(data, node_id_prefix='', *, target_column=None, on_split=None, sample_weight=None)
Runs the pipeline on data.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
DataFrame | SkyulfDataFrame | Any
|
Input frame, feature-target pair, or existing split dataset. |
required |
node_id_prefix
|
str
|
Prefix for the per-step transformer identifiers. |
''
|
target_column
|
str | None
|
Execution target excluded from automatic feature selection. |
None
|
sample_weight
|
Any
|
Optional raw positional weights, sliced by the actual splitter and stored in the resulting training split. |
None
|
on_split
|
Callable[[SplitDataset], None] | None
|
Optional synchronous callback receiving the first actual row split before later transformations run. Skipped splitters and feature-target separation do not invoke it. The callback is not retained; consumers must copy or persist the payload immediately if they need a snapshot. Callback errors propagate to the caller. |
None
|
Returns:
| Type | Description |
|---|---|
Any
|
A pair containing the transformed data and per-step metrics. |
Spark execution validates all capabilities before any data action. Key uniqueness and per-step identity checks run distributed queries with bounded results; local row counts and memory metrics remain unknown.
Source code in skyulf-core/skyulf/preprocessing/pipeline.py
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 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 | |
from_state(payload, *, frame_spec=None, execution_options=None)
classmethod
Restore supported fitted steps without fitting, I/O or creating a Spark session.
Spark requires explicit frame_spec and execution_options. Local callers may omit both and let input frames select pandas or Polars. Malformed, oversized, unsupported or corrupt envelopes are rejected before execution.
Source code in skyulf-core/skyulf/preprocessing/pipeline.py
158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 | |
transform(data, *, preserve_rows=False)
Apply transformations, optionally rejecting row-count changes and temporal sorting.
Local prediction callers set preserve_rows=True because their responses
have no input-row provenance. Each applied step is checked immediately;
a later step cannot conceal filtering, expansion, or a built-in temporal
permutation. Ordinary transform and fold scoring retain their configured
filtering and sorting behavior. Custom appliers receive count checks only.
Spark execution always preserves key identity and optional target values;
physical row order is not guaranteed. Consumers must align by row keys.
Source code in skyulf-core/skyulf/preprocessing/pipeline.py
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 237 238 239 240 241 242 | |
transform_tracking_order(data)
Transform local features and report each output row's original input position.
Only built-in temporal permutations are tracked. Row-count changes fail; ordinary serving continues to reject permutations via preserve_rows=True.
Source code in skyulf-core/skyulf/preprocessing/pipeline.py
256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 | |
FeatureEngineerFoldAdapter
Re-runs a preprocessing step chain inside each CV/tuning fold.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
steps_config
|
list[dict[str, Any]]
|
The upstream Feature-Engineering node's step list
(plain dicts, validated by |
required |
target_column
|
str
|
Name of the target, kept to reject payloads where X
still embeds it — target-aware steps (target encoders, resampling,
label encoding of the target) receive |
required |
Source code in skyulf-core/skyulf/preprocessing/fold_adapter.py
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 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 | |
temporal_history_columns
property
Report ordering/entity columns needed until carry features are computed.
__init__(steps_config, target_column)
Store the chain minus any splitter steps and validate it eagerly.
Splitter steps are filtered out because they already ran upstream of the
fold boundary. Unlike :class:MergedBranchFoldAdapter, row-changing
steps are accepted here and changes_row_count merely reports the
chain's nature: a single branch has no column-wise merge to
desynchronise.
Raises:
| Type | Description |
|---|---|
ValueError
|
If a step names a transformer absent from the registry,
or if the trial :class: |
Source code in skyulf-core/skyulf/preprocessing/fold_adapter.py
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 | |
fit_transform(X, y, *, sample_weight=None)
Fit a fresh engineer on this fold's (X, y) payload and return it.
A new :class:FeatureEngineer is built on every call, so nothing fitted
on one fold survives into the next.
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
Source code in skyulf-core/skyulf/preprocessing/fold_adapter.py
282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 | |
original_target_labels(labels)
Decode the recorded fitted target chain independently of row permutations.
Source code in skyulf-core/skyulf/preprocessing/fold_adapter.py
351 352 353 354 355 | |
retain_split_metadata(column)
Drop retained split metadata after preprocessing, including during serving.
Source code in skyulf-core/skyulf/preprocessing/fold_adapter.py
310 311 312 313 314 315 316 317 318 | |
transform(X, y)
Apply the engineer fitted by the last :meth:fit_transform.
Always returns an (X, y) pair, re-pairing when an applier handed
back a bare frame, so callers can rely on the FoldPreprocessor
protocol shape.
Raises:
| Type | Description |
|---|---|
RuntimeError
|
If called before :meth: |
ValueError
|
If |
Source code in skyulf-core/skyulf/preprocessing/fold_adapter.py
320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 | |
transform_tracking_order(X)
Expose temporal row lineage for searcher prediction and nested thresholds.
Source code in skyulf-core/skyulf/preprocessing/fold_adapter.py
357 358 359 360 361 362 | |
FeatureGenerationApplier
Bases: BaseApplier
Append the columns described by a feature-generation artifact.
Source code in skyulf-core/skyulf/preprocessing/feature_generation/generation.py
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 178 179 180 181 182 183 184 | |
apply(X, _y, params)
Evaluate each configured operation and append its output column to X.
Operations run in order, so a later one can read a column an earlier one
created. Unsupported operation types raise ValueError before any
operation runs. A failure inside a supported operation is logged and
skipped, and an output name that already exists is suffixed until
unique unless allow_overwrite says otherwise.
Datetime extraction uses output_column exactly for one configured
source and feature. With multiple features it produces name_feature;
with multiple sources it produces name_source_feature. Without an
explicit name, outputs remain source_feature, optionally preceded
by output_prefix. Every datetime output follows the collision policy.
Saved pipelines affected by formerly ignored names or overwritten
columns require refitting after upgrading.
Group aggregates require training-fitted mappings. Legacy artifacts lacking those mappings must be refitted before inference.
Source code in skyulf-core/skyulf/preprocessing/feature_generation/generation.py
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 | |
inference_capability(state, *, engine)
staticmethod
Describe saved feature replay without granting arbitrary partition execution.
Source code in skyulf-core/skyulf/preprocessing/feature_generation/generation.py
140 141 142 143 144 145 146 147 148 149 150 | |
validate_inference_state(raw)
staticmethod
Inspect saved operations, pinned similarity and learned group lookup shapes.
Source code in skyulf-core/skyulf/preprocessing/feature_generation/generation.py
119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 | |
FeatureGenerationCalculator
Bases: BaseCalculator
Record row-local operations and fit group aggregates from training rows.
Source code in skyulf-core/skyulf/preprocessing/feature_generation/generation.py
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 266 267 268 269 270 271 | |
fit(X, _y, config)
Fit aggregate mappings against the intermediate training feature frame.
Operations execute in order while fitting so an aggregate can consume
an earlier generated column. Its saved mapping supplies held-out rows;
unknown keys stay missing, and no inference values are aggregated.
Configurations containing only row-local operations need no data fit.
Unsupported operation types raise ValueError; polynomial expansion
belongs in the separate PolynomialFeatures node.
Source code in skyulf-core/skyulf/preprocessing/feature_generation/generation.py
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 | |
FeatureInteractionApplier
Bases: BaseApplier
Append the multiplicative interaction columns named by the artifact.
Source code in skyulf-core/skyulf/preprocessing/feature_generation/interaction.py
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 | |
apply(X, _y, params)
Compute each artifact combination as a column product and append it.
A combination whose columns are absent from X is skipped rather than
raising, so the node survives an upstream column drop; include_bias
adds a constant 1.0 interaction_bias column per existing row,
including zero rows when no input columns remain. When no column is
generated the frame is returned unchanged. Generated product names must
be unique and must not collide with existing columns. An existing bias
column retains its established passthrough behavior.
Source code in skyulf-core/skyulf/preprocessing/feature_generation/interaction.py
171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 | |
resolve_fitted_config(raw, state)
staticmethod
Bind inference configuration to this node's inspected fitted artifact.
Source code in skyulf-core/skyulf/preprocessing/feature_generation/interaction.py
166 167 168 169 | |
validate_fitted_state(raw)
staticmethod
Inspect this node's supported saved state without fitting or applying data.
Source code in skyulf-core/skyulf/preprocessing/feature_generation/interaction.py
161 162 163 164 | |
FeatureInteractionCalculator
Bases: BaseCalculator
Resolve which cross-products to generate, without computing them.
Source code in skyulf-core/skyulf/preprocessing/feature_generation/interaction.py
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 | |
fit(X, _y, config)
Validate the requested columns and degree, then enumerate the combinations.
Columns are sorted into the artifact so the generated names depend only
on the set of inputs, never on the order they were configured in.
With interaction_only=True, fewer columns than degree yields
no products. With False, one column is sufficient for self-products.
An empty selection yields no products; bias generation is independent.
Raises:
| Type | Description |
|---|---|
ValueError
|
If a configured column is missing or non-numeric, or if
|
Source code in skyulf-core/skyulf/preprocessing/feature_generation/interaction.py
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 | |
GeneralBinningApplier
Bases: BaseBinningApplier
Inspect fitted bin decisions while inheriting the existing shared apply.
Source code in skyulf-core/skyulf/preprocessing/bucketing.py
509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 | |
inference_capability(state, *, engine)
staticmethod
Describe saved bin application as local row-preserving inference.
Source code in skyulf-core/skyulf/preprocessing/bucketing.py
517 518 519 520 521 522 523 | |
validate_inference_state(raw)
staticmethod
Inspect saved edges, optional labels and display choices without fitting.
Source code in skyulf-core/skyulf/preprocessing/bucketing.py
512 513 514 515 | |
GeneralBinningCalculator
Bases: BaseCalculator
Master calculator that handles mixed strategies and per-column overrides.
Source code in skyulf-core/skyulf/preprocessing/bucketing.py
559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 | |
fit(X, _y, config)
Fit bin edges per column under each column's own strategy.
An explicitly empty columns list short-circuits to an empty artifact
(the user unchecked everything), whereas an absent one falls through to
:func:detect_numeric_columns. Only the selected columns are converted
to pandas, since the fits are pd.cut / pd.qcut / sklearn-bound.
Columns whose strategy cannot be fit are logged and skipped rather than
failing the node, so the artifact may cover fewer columns than requested.
Source code in skyulf-core/skyulf/preprocessing/bucketing.py
571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 | |
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 | |
GeoDistanceApplier
Bases: BaseApplier
Append the configured pairwise distance as a new numeric column.
Source code in skyulf-core/skyulf/preprocessing/geo/distance.py
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 | |
apply(X, _y, params)
Compute the distance column on the active engine; y passes through.
Source code in skyulf-core/skyulf/preprocessing/geo/distance.py
168 169 170 171 172 173 | |
inference_capability(state, *, engine)
staticmethod
Describe existing coordinate math as local row-preserving inference.
Source code in skyulf-core/skyulf/preprocessing/geo/distance.py
160 161 162 163 164 165 166 | |
validate_inference_state(raw)
staticmethod
Inspect saved coordinate names and distance choices without touching request data.
Source code in skyulf-core/skyulf/preprocessing/geo/distance.py
150 151 152 153 154 155 156 157 158 | |
GeoDistanceCalculator
Bases: BaseCalculator
Validate the coordinate columns, method, and unit for the distance computation.
Source code in skyulf-core/skyulf/preprocessing/geo/distance.py
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 237 238 239 240 241 242 243 244 245 246 | |
fit(X, _y, config)
Validate the distance config and resolve its output column name.
An omitted or empty output_column becomes geo_distance_km or
geo_distance_mi according to unit. Explicit names are retained
in the artifact and reused during inference.
Source code in skyulf-core/skyulf/preprocessing/geo/distance.py
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 | |
infer_output_schema(input_schema, config)
Expose the distance feature before execution when all coordinate inputs are known.
Source code in skyulf-core/skyulf/preprocessing/geo/distance.py
199 200 201 202 203 204 205 206 207 208 209 210 | |
GroupImputerApplier
Bases: BaseApplier
Fill gaps with the training value of each row's group, then with the global value.
Rows whose group was unseen in training, whose group key is null, or whose group had no observed value fall back to the column's global training value. The scoring batch's own values are never used to compute fills.
Source code in skyulf-core/skyulf/preprocessing/imputation/group.py
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 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 | |
apply(X, y, params)
Fill the learned columns on the active engine; y passes through.
Source code in skyulf-core/skyulf/preprocessing/imputation/group.py
165 166 167 168 169 170 171 172 173 174 | |
resolve_fitted_config(raw, state)
staticmethod
Bind inference configuration to this node's inspected fitted artifact.
Source code in skyulf-core/skyulf/preprocessing/imputation/group.py
160 161 162 163 | |
validate_fitted_state(raw)
staticmethod
Inspect this node's supported saved state without fitting or applying data.
Source code in skyulf-core/skyulf/preprocessing/imputation/group.py
155 156 157 158 | |
GroupImputerCalculator
Bases: BaseCalculator
Learn per-group and global fill values from training rows.
group_by names the column that defines the groups. strategy is
mean, median or most_frequent (mode is an alias). Leave
columns empty to fill every numeric column (mean/median) or every
column (most_frequent), excluding the group key and the target.
Source code in skyulf-core/skyulf/preprocessing/imputation/group.py
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 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 | |
fit(X, _y, config)
Compute [group, value] pairs and a global fallback for every filled column.
Source code in skyulf-core/skyulf/preprocessing/imputation/group.py
311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 | |
infer_output_schema(input_schema, config)
Promote filled columns to float64 for mean/median; keep the schema otherwise.
Source code in skyulf-core/skyulf/preprocessing/imputation/group.py
303 304 305 306 307 308 309 | |
H3IndexApplier
Bases: BaseApplier
Append each row's H3 hexagonal cell index as a new string column.
Source code in skyulf-core/skyulf/preprocessing/geo/h3_index.py
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 | |
apply(X, _y, params)
Compute the per-row cell indices on the active engine; y passes through.
Source code in skyulf-core/skyulf/preprocessing/geo/h3_index.py
146 147 148 149 150 151 | |
inference_capability(state, *, engine)
staticmethod
Describe saved cell indexing while retaining the optional runtime dependency.
Source code in skyulf-core/skyulf/preprocessing/geo/h3_index.py
138 139 140 141 142 143 144 | |
validate_inference_state(raw)
staticmethod
Inspect saved coordinate choices without importing H3 or computing cells.
Source code in skyulf-core/skyulf/preprocessing/geo/h3_index.py
125 126 127 128 129 130 131 132 133 134 135 136 | |
H3IndexCalculator
Bases: BaseCalculator
Validate the lat/lon columns and resolution for H3 cell indexing.
Source code in skyulf-core/skyulf/preprocessing/geo/h3_index.py
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 | |
fit(X, _y, config)
Import h3 eagerly to fail fast, then validate the columns and resolution.
Source code in skyulf-core/skyulf/preprocessing/geo/h3_index.py
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 | |
HashingVectorizerApplier
Bases: BaseApplier
Attach n_features hashed-token columns to the frame.
No vocabulary is consulted — tokens hash straight to column indices, so the
same artifact works on text never seen at fit time and the output width is
fixed by config. The trade-off is collisions, which the hashing trick
accepts by design. The configured text columns are joined first, the dense
result is concatenated on, and the sources survive unless drop_original
is set. The polars path runs natively and falls back to a pandas round-trip
when a text column is not String dtype.
Source code in skyulf-core/skyulf/preprocessing/vectorization/hashing_vectorizer.py
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 | |
apply(X, _y, params)
Dispatch through the text-specific dual-engine path; y passes through.
Source code in skyulf-core/skyulf/preprocessing/vectorization/hashing_vectorizer.py
86 87 88 89 90 91 | |
inference_capability(state, *, engine)
staticmethod
Describe stateless document hashing while retaining native callback limits.
Source code in skyulf-core/skyulf/preprocessing/vectorization/hashing_vectorizer.py
76 77 78 79 80 81 82 83 84 | |
validate_inference_state(raw)
staticmethod
Inspect fixed dense width without hashing tokens or allocating the output.
Source code in skyulf-core/skyulf/preprocessing/vectorization/hashing_vectorizer.py
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 | |
HashingVectorizerCalculator
Bases: BaseCalculator
Record the column list and build an unfitted HashingVectorizer from config.
Nothing is learned from the data (learns_from_data=False), so the artifact
is fully reproducible from config and identical across runs — the property that
makes it usable on streaming or very large corpora where building a vocabulary
would not fit in memory.
Normalization defaults to "l2"; "l1" selects L1 normalization.
The Canvas value "none" and Python None both disable normalization.
Schema inference conservatively inherits the base None result. A fixed
n_features does not describe the whole output: fitting resolves source
columns and excludes the target, including a separately supplied y.
Runtime introspection determines the retained and generated columns.
Source code in skyulf-core/skyulf/preprocessing/vectorization/hashing_vectorizer.py
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 178 179 180 181 182 183 184 185 186 187 188 189 190 | |
fit(X, _y, config)
Resolve the configured text columns and build the artifact without touching values.
Uses the column-names-only resolver rather than the data-narrowing sibling, so a polars input is never converted to pandas just to fit. An empty or wholly-absent selection yields an empty artifact so the applier no-ops.
Source code in skyulf-core/skyulf/preprocessing/vectorization/hashing_vectorizer.py
176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 | |
IQRApplier
Bases: BaseApplier
Drop rows outside the fitted per-column IQR bounds; null/NaN values are kept.
Source code in skyulf-core/skyulf/preprocessing/outliers/iqr.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 82 83 84 85 86 87 88 89 90 91 92 | |
apply(X, y, params)
Filter rows through the fitted per-column bounds on the active engine.
Source code in skyulf-core/skyulf/preprocessing/outliers/iqr.py
48 49 50 51 52 53 54 55 56 57 58 | |
inference_capability(state, *, engine)
staticmethod
Describe saved row filtering; prediction still rejects any removed rows.
Source code in skyulf-core/skyulf/preprocessing/outliers/iqr.py
39 40 41 42 43 44 45 46 | |
validate_inference_state(raw)
staticmethod
Inspect learned quartile limits without recomputing request statistics.
Source code in skyulf-core/skyulf/preprocessing/outliers/iqr.py
29 30 31 32 33 34 35 36 37 | |
IQRCalculator
Bases: BaseCalculator
Fit per-column bounds at the quartiles widened by multiplier times the IQR.
Source code in skyulf-core/skyulf/preprocessing/outliers/iqr.py
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 | |
fit(X, _y, config)
Compute quartile bounds per numeric column; warn on empty or non-numeric ones.
Source code in skyulf-core/skyulf/preprocessing/outliers/iqr.py
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 | |
infer_output_schema(input_schema, config)
Return the input schema unchanged: row filtering preserves the column set.
Source code in skyulf-core/skyulf/preprocessing/outliers/iqr.py
107 108 109 110 111 112 | |
IterativeImputerApplier
Bases: BaseApplier
Fill missing values from the fitted MICE (chained-equations) imputer.
Source code in skyulf-core/skyulf/preprocessing/imputation/iterative.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 136 137 | |
apply(X, _y, params)
Impute X with the stored sklearn imputer; y passes through.
Source code in skyulf-core/skyulf/preprocessing/imputation/iterative.py
116 117 118 119 120 121 | |
inference_capability(state, *, engine)
staticmethod
Retain the all-missing request shortcut and abstain from stochastic replay.
Source code in skyulf-core/skyulf/preprocessing/imputation/iterative.py
98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 | |
validate_inference_state(raw)
staticmethod
Inspect learned initial values and estimator sequence without executing them.
Source code in skyulf-core/skyulf/preprocessing/imputation/iterative.py
87 88 89 90 91 92 93 94 95 96 | |
IterativeImputerCalculator
Bases: BaseCalculator
Fit a sklearn IterativeImputer with the configured estimator.
Source code in skyulf-core/skyulf/preprocessing/imputation/iterative.py
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 178 179 180 181 182 183 184 185 186 187 188 189 190 191 | |
fit(X, _y, config)
Fit chained-equations imputation, dropping all-missing columns sklearn cannot impute.
Source code in skyulf-core/skyulf/preprocessing/imputation/iterative.py
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 | |
infer_output_schema(input_schema, config)
Return a schema with selected columns promoted to float64.
Source code in skyulf-core/skyulf/preprocessing/imputation/iterative.py
152 153 154 155 156 | |
KBinsDiscretizerApplier
Bases: GeneralBinningApplier
Inspect sklearn-selected edges while reusing the shared cut implementation.
Source code in skyulf-core/skyulf/preprocessing/bucketing.py
787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 | |
inference_capability(state, *, engine)
staticmethod
Describe fixed learned bins without granting distributed execution.
Source code in skyulf-core/skyulf/preprocessing/bucketing.py
795 796 797 798 799 800 801 | |
validate_inference_state(raw)
staticmethod
Inspect the same saved artifact produced by GeneralBinning's sklearn path.
Source code in skyulf-core/skyulf/preprocessing/bucketing.py
790 791 792 793 | |
KBinsDiscretizerCalculator
Bases: GeneralBinningCalculator
Thin wrapper around :class:GeneralBinningCalculator with kbins strategy.
Source code in skyulf-core/skyulf/preprocessing/bucketing.py
804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 | |
fit(df, config)
Translate this node's public params onto GeneralBinning's internal names, then delegate.
On a copy of config (the caller's dict is never mutated) it forces
strategy="kbins", moves n_bins to kbins_n_bins, and preserves
a user-chosen non-kbins strategy as kbins_strategy so
quantile / uniform / kmeans still reach sklearn. Written with
the raw (df, config) signature rather than @fit_method because it
only rewrites config and forwards — the parent's decorated fit does
the (X, y) unpack.
Source code in skyulf-core/skyulf/preprocessing/bucketing.py
816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 | |
KNNImputerApplier
Bases: BaseApplier
Fill missing values from the fitted k-nearest-neighbors imputer.
Source code in skyulf-core/skyulf/preprocessing/imputation/knn.py
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 | |
apply(X, _y, params)
Impute X with the stored sklearn imputer; y passes through.
Source code in skyulf-core/skyulf/preprocessing/imputation/knn.py
66 67 68 69 70 71 | |
inference_capability(state, *, engine)
staticmethod
Describe native neighbor replay; arbitrary metrics or weights stay undeclared.
Source code in skyulf-core/skyulf/preprocessing/imputation/knn.py
54 55 56 57 58 59 60 61 62 63 64 | |
validate_inference_state(raw)
staticmethod
Inspect the saved neighbor estimator without refitting or normalizing it.
Source code in skyulf-core/skyulf/preprocessing/imputation/knn.py
45 46 47 48 49 50 51 52 | |
KNNImputerCalculator
Bases: BaseCalculator
Fit a sklearn KNNImputer on the selected numeric columns.
Source code in skyulf-core/skyulf/preprocessing/imputation/knn.py
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 | |
fit(X, _y, config)
Fit the neighbor imputer, dropping all-missing columns sklearn cannot impute.
Source code in skyulf-core/skyulf/preprocessing/imputation/knn.py
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 | |
infer_output_schema(input_schema, config)
Return a schema with selected columns promoted to float64.
Source code in skyulf-core/skyulf/preprocessing/imputation/knn.py
102 103 104 105 106 | |
LabelEncoderApplier
Bases: BaseApplier
Replace categorical values in place with the integer ids their fitted encoder assigned.
New feature artifacts use typed scalar keys: integral floats match their
integer category without matching literal numeric strings. Legacy artifacts
retain their original string lookup. Values unseen at fit time map to
missing_code. Target encoders retain their existing string-label behavior.
Encoded targets are native Series for the feature engine; pandas Series keep
their index and all native Series keep their name. Unencoded targets pass
through unchanged, including lists and NumPy arrays.
Source code in skyulf-core/skyulf/preprocessing/encoding/label.py
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 | |
apply(X, y, params)
Dispatch to the engine-specific encode, forwarding (X, y) only when y exists.
Source code in skyulf-core/skyulf/preprocessing/encoding/label.py
212 213 214 215 216 217 218 219 220 | |
inference_capability(state, *, engine)
staticmethod
Declare fixed lookups while retaining legacy feature rendering dependencies.
Source code in skyulf-core/skyulf/preprocessing/encoding/label.py
202 203 204 205 206 207 208 209 210 | |
validate_inference_state(raw)
staticmethod
Inspect native learned classes without normalizing the fitted artifact.
Source code in skyulf-core/skyulf/preprocessing/encoding/label.py
189 190 191 192 193 194 195 196 197 198 199 200 | |
LabelEncoderCalculator
Bases: BaseCalculator
Fit one LabelEncoder per named column, plus one for the target when it qualifies.
Unlike its sibling encoders this node deliberately does not auto-detect
feature columns: an empty columns means "encode the target only",
mirroring sklearn's convention that LabelEncoder is a 1-D label
transformer and OrdinalEncoder is the tool for feature columns. Fitting
zero encoders logs a warning rather than passing a silent no-op downstream.
Source code in skyulf-core/skyulf/preprocessing/encoding/label.py
386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 | |
fit(X, y, config)
Fit the encoders on the frame's own engine, forwarding y when present.
Source code in skyulf-core/skyulf/preprocessing/encoding/label.py
413 414 415 416 417 418 419 420 421 422 423 424 | |
infer_output_schema(input_schema, config)
Pass the input schema through: encoded columns keep their name and position.
Source code in skyulf-core/skyulf/preprocessing/encoding/label.py
405 406 407 408 409 410 411 | |
LagFeaturesApplier
Bases: BaseApplier
Append lagged copies of the configured columns, optionally within groups.
Source code in skyulf-core/skyulf/preprocessing/time_series/lag.py
114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 | |
apply(X, _y, params)
Add lag columns; drop_na drops rows containing nulls or floating NaN.
Source code in skyulf-core/skyulf/preprocessing/time_series/lag.py
125 126 127 128 129 130 131 132 133 134 135 136 137 | |
inference_capability(state, *, engine)
staticmethod
Retain the window dependency even when training history was saved.
Source code in skyulf-core/skyulf/preprocessing/time_series/lag.py
117 118 119 120 121 122 123 | |
LagFeaturesCalculator
Bases: BaseCalculator
Save lag configuration and optional bounded training history.
Default batch mode uses only supplied rows. Explicit carry mode seeds future batches from training observations, without mutating the artifact on apply.
Source code in skyulf-core/skyulf/preprocessing/time_series/lag.py
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 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 | |
fit(df, config)
Record the columns, deduplicated positive lags, and sort/group/drop settings.
Source code in skyulf-core/skyulf/preprocessing/time_series/lag.py
157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 | |
fit_transform_train(df, config)
Save the training tail while computing training lags without future context.
Source code in skyulf-core/skyulf/preprocessing/time_series/lag.py
175 176 177 178 | |
infer_output_schema(input_schema, config)
Add one {col}_lag_{n} column per lag, as float64.
Source code in skyulf-core/skyulf/preprocessing/time_series/lag.py
180 181 182 183 184 185 186 187 188 189 190 191 192 | |
MergedBranchFoldAdapter
Re-runs fork-join preprocessing branches inside each CV/tuning fold.
Built for graphs where a shared trunk ends in a splitter (fork point) and N parallel transformer branches fan back into one training node. Per fold it re-runs every branch step list on the fold-train payload and merges the branch frames exactly like the engine's pure-strategy column-wise merge, so the fold sees the same columns the full run produces — without any pre-fit statistics leaking from outside the fold.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
branch_step_lists
|
list[list[dict[str, Any]]]
|
One unfitted step list per branch, in the engine's merge input order. |
required |
merge_strategy
|
str
|
|
required |
target_column
|
str
|
Target name, kept to reject payloads that still embed
it; target-aware branch steps receive |
required |
drop_columns
|
list[str] | tuple[str, ...]
|
Columns removed upstream (e.g. by Drop Columns nodes); stripped again after each merge so a branch cannot resurrect them. |
()
|
Source code in skyulf-core/skyulf/preprocessing/fold_adapter.py
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 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 237 | |
__init__(branch_step_lists, merge_strategy, target_column, drop_columns=())
Validate every branch against the positional merge's row contract.
Each step list is trial-built as a :class:FeatureEngineer, screened
for splitting, row filtering and configured sorting, and resolved
through the node registry. Configurations are copied in full so later
caller edits cannot bypass these checks.
Raises:
| Type | Description |
|---|---|
ValueError
|
If the merge strategy is unrecognized, if there is no branch step list or one is empty, or if a branch step splits the data, changes row counts or sorts rows. |
Source code in skyulf-core/skyulf/preprocessing/fold_adapter.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 | |
fit_transform(X, y, *, sample_weight=None)
Fit fresh branch engineers on this fold's payload and merge the results.
Every branch engineer is rebuilt from the stored step lists on each call rather than reused, so a statistic fitted on one fold cannot reach the next.
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
Source code in skyulf-core/skyulf/preprocessing/fold_adapter.py
146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 | |
original_target_labels(labels)
Decode the first branch, which supplies the merged fold's target.
Source code in skyulf-core/skyulf/preprocessing/fold_adapter.py
233 234 235 236 237 | |
transform(X, y)
Re-apply the branch engineers fitted by the last :meth:fit_transform.
Raises:
| Type | Description |
|---|---|
RuntimeError
|
If called before :meth: |
ValueError
|
If |
Source code in skyulf-core/skyulf/preprocessing/fold_adapter.py
164 165 166 167 168 169 170 171 172 173 174 175 176 | |
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 | |
MissingIndicatorApplier
Bases: BaseApplier
Add a binary <col><flag_suffix> column beside each configured column.
Additive, not replacing: the original columns survive. Both engines must
flag the same cells, which needs care on polars — it stores float NaN
distinctly from null where pandas' isna() treats both as missing, so
float columns get an explicit NaN test. Columns absent from the frame are
skipped. A generated flag name matching an existing column raises
ValueError; input values are never overwritten by flags.
Source code in skyulf-core/skyulf/preprocessing/drop_and_missing/missing_indicator.py
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 | |
apply(X, _y, params)
Dispatch the flag creation to the pandas or polars path; y passes through.
Source code in skyulf-core/skyulf/preprocessing/drop_and_missing/missing_indicator.py
98 99 100 101 102 103 104 105 | |
inference_capability(state, *, engine)
staticmethod
Describe local saved apply context without granting worker execution.
Source code in skyulf-core/skyulf/preprocessing/drop_and_missing/missing_indicator.py
90 91 92 93 94 95 96 | |
validate_inference_state(raw)
staticmethod
Inspect learned flag selection without detecting missing values again.
Source code in skyulf-core/skyulf/preprocessing/drop_and_missing/missing_indicator.py
76 77 78 79 80 81 82 83 84 85 86 87 88 | |
MissingIndicatorCalculator
Bases: BaseCalculator
Choose which columns get a missing flag, learning the set from data when none is named.
An explicit columns list is filtered down to names present on the
frame; without one, every column that actually contains a missing value is
flagged, so the artifact depends on the training data.
Source code in skyulf-core/skyulf/preprocessing/drop_and_missing/missing_indicator.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 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 | |
fit(df, config)
Compute the flagged column set on the frame's own engine and return it.
Source code in skyulf-core/skyulf/preprocessing/drop_and_missing/missing_indicator.py
191 192 193 194 195 196 197 198 199 200 | |
infer_output_schema(input_schema, config)
Predict the added flag columns, or None when the set is data-dependent.
With an explicit list the output is the input plus one int64
<col><flag_suffix> column for each source present in the input;
otherwise which columns hold missing values decides, and callers
must introspect at runtime.
Source code in skyulf-core/skyulf/preprocessing/drop_and_missing/missing_indicator.py
167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 | |
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 | |
OneHotEncoderApplier
Bases: BaseApplier
Expand each categorical column into its one-hot indicator columns.
Parity here comes from both engines transforming through the same fitted
sklearn encoder carried in the artifact, not from two parallel
implementations. Nulls are filled with the sentinel token before
transforming, which only lines up when include_missing was set at fit
time too — the encoder knows that level solely if it saw it. Indicator
columns are concatenated on and the originals dropped unless
drop_original is false. Generated names must be unique and must not
collide with retained input columns; conflicts raise ValueError.
New artifacts escape literal missing tokens and escape-prefixed strings;
unversioned artifacts retain their original missing-value transformation.
An empty artifact declares identity replay only for an explicit empty
column selection with a validated recipe.
Source code in skyulf-core/skyulf/preprocessing/encoding/one_hot.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 | |
apply(X, y, params)
Dispatch to the engine-specific transform, forwarding (X, y) only when present.
Source code in skyulf-core/skyulf/preprocessing/encoding/one_hot.py
209 210 211 212 213 214 215 216 | |
resolve_fitted_config(raw, state)
staticmethod
Bind inference configuration to this node's inspected fitted artifact.
Source code in skyulf-core/skyulf/preprocessing/encoding/one_hot.py
202 203 204 205 206 207 | |
validate_fitted_state(raw)
staticmethod
Inspect this node's supported saved state without fitting or applying data.
Source code in skyulf-core/skyulf/preprocessing/encoding/one_hot.py
197 198 199 200 | |
OneHotEncoderCalculator
Bases: BaseCalculator
Fit a sklearn OneHotEncoder on the resolved categorical columns.
The target column is excluded before fitting: one-hot replaces the column
it encodes with several derived ones, which would break a downstream
Feature/Target Split. An explicit columns: [], or auto-detection
finding no categorical columns, yields an empty artifact so the applier
no-ops. Degenerate columns (zero categories, or one category with
drop_first) are warned about rather than silently producing nothing.
Source code in skyulf-core/skyulf/preprocessing/encoding/one_hot.py
326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 | |
fit(X, y, config)
Short-circuit an explicit empty column selection, else fit on the frame's own engine.
Source code in skyulf-core/skyulf/preprocessing/encoding/one_hot.py
367 368 369 370 371 372 373 374 375 376 377 378 379 | |
OrdinalEncoderApplier
Bases: BaseApplier
Replace categorical values in place with fitted ordinal indices, target included.
Features use the shared encoder_object and versioned scalar keys; y
uses a separate __target__ encoder with its existing string-label rules.
Older feature artifacts retain their original string lookup. An unseen
value becomes unknown_value unless handle_unknown is "error".
Encoded output is float32, not integer.
Source code in skyulf-core/skyulf/preprocessing/encoding/ordinal.py
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 | |
apply(X, y, params)
Dispatch to the engine-specific encode, forwarding (X, y) only when y exists.
Source code in skyulf-core/skyulf/preprocessing/encoding/ordinal.py
288 289 290 291 292 293 294 295 296 | |
inference_capability(state, *, engine)
staticmethod
Describe saved ordinal lookups without enabling worker execution.
Source code in skyulf-core/skyulf/preprocessing/encoding/ordinal.py
275 276 277 278 279 280 281 282 283 284 285 286 | |
validate_inference_state(raw)
staticmethod
Inspect feature and optional target encoders without changing lookup provenance.
Source code in skyulf-core/skyulf/preprocessing/encoding/ordinal.py
247 248 249 250 251 252 253 254 255 256 257 258 | |
OrdinalEncoderCalculator
Bases: BaseCalculator
Fit an ordinal encoder for the features and, when split out, for the target.
Picking no feature columns is not a no-op here — unlike its sibling
encoders, this node still fits a target encoder when y is available.
The target is encoded only when y exists and the configured target name
is listed in columns but absent from X, i.e. it has already been
split away. categories_order supplies an explicit ordering, and the
target reads the last row of an n_features + 1 row table.
Source code in skyulf-core/skyulf/preprocessing/encoding/ordinal.py
487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 | |
fit(X, y, config)
Fit the encoders on the frame's own engine, forwarding y when present.
Source code in skyulf-core/skyulf/preprocessing/encoding/ordinal.py
520 521 522 523 524 525 526 527 528 529 530 531 | |
infer_output_schema(input_schema, config)
Pass the input schema through: encoded columns keep their name and position.
Source code in skyulf-core/skyulf/preprocessing/encoding/ordinal.py
512 513 514 515 516 517 518 | |
OversamplingApplier
Bases: BaseApplier
Grow the minority classes with the imblearn over-sampler named in the artifact.
Sees the training split only: :mod:.pipeline excludes the resampling nodes
from apply_on_test/apply_on_validation, so synthetic rows can never
reach a held-out split and inflate its metrics.
Source code in skyulf-core/skyulf/preprocessing/resampling.py
322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 | |
apply(X, y, params)
Resample (X, y) with the configured over-sampler.
y is lifted out of X via target_column when not supplied
separately; with no usable target the data passes through untouched, as
it does for a method no builder recognizes.
Raises:
| Type | Description |
|---|---|
ValueError
|
If any feature column is non-numeric, which imblearn cannot resample. Encode first. |
Source code in skyulf-core/skyulf/preprocessing/resampling.py
345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 | |
inference_capability(state, *, engine)
staticmethod
Require the full class distribution; mixed SMOTETomek effects stay unknown.
Source code in skyulf-core/skyulf/preprocessing/resampling.py
335 336 337 338 339 340 341 342 343 | |
validate_inference_state(raw)
staticmethod
Inspect the saved sampler configuration without fitting optional estimators.
Source code in skyulf-core/skyulf/preprocessing/resampling.py
330 331 332 333 | |
OversamplingCalculator
Bases: BaseCalculator
Configure class balancing by oversampling the minority class.
Source code in skyulf-core/skyulf/preprocessing/resampling.py
371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 | |
fit(_X, _y, config)
Snapshot the sampler settings from config into the artifact.
Neither _X nor _y is read: the artifact is pure configuration,
and the class imbalance it corrects is only observed when the applier
runs the sampler on the training split.
Source code in skyulf-core/skyulf/preprocessing/resampling.py
390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 | |
infer_output_schema(input_schema, config)
Return input_schema untouched.
Source code in skyulf-core/skyulf/preprocessing/resampling.py
383 384 385 386 387 388 | |
PolynomialFeaturesApplier
Bases: BaseApplier
Append the polynomial expansion described by the artifact.
Source code in skyulf-core/skyulf/preprocessing/feature_generation/polynomial.py
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 | |
apply(X, _y, params)
Recompute the expansion from X and append it as new columns.
PolynomialFeatures is refit here rather than persisted, so the
artifact only carries configuration. Artifact columns absent from X
are filtered out first, and the default include_input_features=False
drops the degree-1 terms so the originals are not duplicated. X is
returned unchanged when nothing survives. Emitted names must be unique
and must not collide with existing columns.
Source code in skyulf-core/skyulf/preprocessing/feature_generation/polynomial.py
154 155 156 157 158 159 160 161 162 163 164 165 166 167 | |
inference_capability(state, *, engine)
staticmethod
Describe local polynomial arithmetic without granting worker execution.
Source code in skyulf-core/skyulf/preprocessing/feature_generation/polynomial.py
146 147 148 149 150 151 152 | |
validate_inference_state(raw)
staticmethod
Inspect saved expansion configuration without rebuilding or fitting its terms.
Source code in skyulf-core/skyulf/preprocessing/feature_generation/polynomial.py
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 | |
PolynomialFeaturesCalculator
Bases: BaseCalculator
Resolve the polynomial configuration and the names it will emit.
Source code in skyulf-core/skyulf/preprocessing/feature_generation/polynomial.py
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 | |
fit(X, _y, config)
Record the expansion settings and the feature names they produce.
columns falls back to auto-detected numeric columns when
auto_detect is set. PolynomialFeatures is fitted here purely to
derive feature_names — the expansion itself is recomputed at apply
time. Returns an empty artifact, a no-op passthrough, when no column
resolves. Ambiguous generated names raise ValueError before replay.
Source code in skyulf-core/skyulf/preprocessing/feature_generation/polynomial.py
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 | |
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 | |
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 | |
RollingAggregateApplier
Bases: BaseApplier
Append rolling-window aggregate columns for the configured columns.
Source code in skyulf-core/skyulf/preprocessing/time_series/rolling.py
141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 | |
apply(X, _y, params)
Compute the rolling aggregates on the active engine; y passes through.
Source code in skyulf-core/skyulf/preprocessing/time_series/rolling.py
151 152 153 154 155 156 157 158 | |
inference_capability(state, *, engine)
staticmethod
Describe request-window dependence independently of fitted history seeds.
Source code in skyulf-core/skyulf/preprocessing/time_series/rolling.py
144 145 146 147 148 149 | |
RollingAggregateCalculator
Bases: BaseCalculator
Save rolling configuration and optional bounded training history.
Apply includes the current row; carry mode also sees saved earlier rows. Rolling the known target is rejected; other inputs must be available at prediction time.
Source code in skyulf-core/skyulf/preprocessing/time_series/rolling.py
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 | |
fit(df, config)
Record the window, recognized aggregations, and sort/group settings.
Source code in skyulf-core/skyulf/preprocessing/time_series/rolling.py
185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 | |
fit_transform_train(df, config)
Save the training tail without using it as context for the training rows.
Source code in skyulf-core/skyulf/preprocessing/time_series/rolling.py
205 206 207 208 209 210 | |
infer_output_schema(input_schema, config)
Add one float64 {col}_roll_{agg}_{window} column per (column, aggregation).
Source code in skyulf-core/skyulf/preprocessing/time_series/rolling.py
212 213 214 215 216 217 218 219 220 221 222 223 224 | |
SchemaMismatchError
Bases: ValueError
Raised when an actual frame schema violates an expected SkyulfSchema.
Carries structured details so callers can render a precise message instead
of a generic KeyError deep inside a transformer:
Attributes:
| Name | Type | Description |
|---|---|---|
missing |
Expected columns absent from the actual frame. |
|
unexpected |
Actual columns not present in the expected schema. |
|
dtype_mismatches |
|
|
order_mismatch |
|
Source code in skyulf-core/skyulf/core/schema.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 | |
__init__(message, *, missing=None, unexpected=None, dtype_mismatches=None, order_mismatch=False)
Set the ValueError message and capture the structured diff fields as attributes.
Source code in skyulf-core/skyulf/core/schema.py
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 | |
SentenceEmbedderApplier
Bases: BaseApplier
Encode the joined text of the configured columns into embedding_dim float columns.
All configured columns are concatenated into one corpus, so a multi-column
selection yields a single embedding whose name prefix joins the source names.
Width is set by the model, not by config, and is recorded in the artifact at
fit time. New artifacts cache loaded CPU encoders by their immutable saved
bytes, so models sharing a display name cannot select each other's weights.
normalize=True (the default)
yields unit-length vectors ready for cosine similarity. Because the optional
sentence-transformers import is lazy, a missing extra surfaces here as an
ImportError carrying the install hint rather than at skyulf import time.
The polars path keeps the frame native around the encode, but the encoding
itself always runs outside the dataframe engine.
Source code in skyulf-core/skyulf/preprocessing/vectorization/sentence_embedder.py
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 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 | |
apply(X, _y, params)
Dispatch through the text-specific dual-engine path; y passes through.
Source code in skyulf-core/skyulf/preprocessing/vectorization/sentence_embedder.py
282 283 284 285 | |
inference_capability(state, *, engine)
staticmethod
Describe packaged row-local encoding; name-only legacy state stays unknown.
Source code in skyulf-core/skyulf/preprocessing/vectorization/sentence_embedder.py
272 273 274 275 276 277 278 279 280 | |
validate_inference_state(raw)
staticmethod
Inspect saved schema and asset identity without loading or running the encoder.
Source code in skyulf-core/skyulf/preprocessing/vectorization/sentence_embedder.py
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 | |
SentenceEmbedderCalculator
Bases: BaseCalculator
Resolve text columns and capture the pretrained encoder used by subsequent applies.
learns_from_data=False — the weights come pretrained and are never
adjusted here — but fitting is not free: it performs the lazy
sentence-transformers import and, on a cold cache, downloads the model.
Native PyTorch serialization captures its weights, tokenizer and settings in
memory, with a SHA256 identity and exact optional dependency versions. The
existing local pipeline/model-set size budgets still apply to these bytes.
Schema inference inherits the base None result because the embedding
width is only known after loading the model. Previewing the schema therefore
does not load model weights and leaves the output unknown until runtime.
Source code in skyulf-core/skyulf/preprocessing/vectorization/sentence_embedder.py
314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 | |
fit(X, _y, config)
Resolve the configured text column names and record the model's embedding width.
Uses the column-names-only resolver rather than the data-narrowing sibling, so a polars input is never converted to pandas just to fit. An empty or wholly-absent selection yields an empty artifact so the applier no-ops — and, importantly, skips loading the model at all.
Source code in skyulf-core/skyulf/preprocessing/vectorization/sentence_embedder.py
348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 | |
SimpleImputerApplier
Bases: BaseApplier
Apply fitted Simple Imputer fill values to missing values in selected columns.
The calculator artifact records per-column values for mean, median,
most_frequent (also accepted as mode), or constant strategies.
Missing columns seen during fitting are restored with their stored value,
preserving the row count even when no input columns remain.
Empty saved artifacts declare identity replay only when the recipe explicitly
selects no columns; automatic or missing selections remain unreviewed.
Spark supports only mean and constant artifacts and applies them
with native expressions. All-missing means leave existing columns untouched.
Source code in skyulf-core/skyulf/preprocessing/imputation/simple.py
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 147 148 149 150 151 152 153 154 155 | |
apply(X, _y, params)
Fill nulls and NaNs with the fitted per-column values; y passes through.
Source code in skyulf-core/skyulf/preprocessing/imputation/simple.py
92 93 94 95 96 97 98 99 100 101 102 103 | |
resolve_fitted_config(raw, state)
staticmethod
Bind inference configuration to this node's inspected fitted artifact.
Source code in skyulf-core/skyulf/preprocessing/imputation/simple.py
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 | |
validate_fitted_state(raw)
staticmethod
Inspect this node's supported saved state without fitting or applying data.
Source code in skyulf-core/skyulf/preprocessing/imputation/simple.py
65 66 67 68 69 70 71 72 | |
SimpleImputerCalculator
Bases: BaseCalculator
Fit per-column values for filling missing data with sklearn-compatible strategies.
Supported strategy values are mean, median, most_frequent,
and constant; mode is normalized to most_frequent. Use
columns to select columns and fill_value with constant.
Mean and median auto-select numeric columns and reject explicitly selected
non-numeric columns. The other strategies can operate on all selected columns.
Spark supports only mean and constant through a native aggregate;
string and boolean constants require explicit compatible fill values.
Source code in skyulf-core/skyulf/preprocessing/imputation/simple.py
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 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 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 | |
fit(X, _y, config)
Resolve strategy and columns, then fit fill values on the active engine.
mode is accepted as an alias of most_frequent; mean/median are
restricted to numeric columns.
Source code in skyulf-core/skyulf/preprocessing/imputation/simple.py
241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 | |
infer_output_schema(input_schema, config)
Return input_schema and promote float-only imputation targets to float64.
Source code in skyulf-core/skyulf/preprocessing/imputation/simple.py
230 231 232 233 234 235 236 237 238 239 | |
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 | |
SkyulfSchema
dataclass
Immutable schema description.
Attributes:
| Name | Type | Description |
|---|---|---|
columns |
tuple[str, ...]
|
Ordered list of column names. |
dtypes |
dict[str, str]
|
Mapping of column name → string dtype label
(engine-agnostic; e.g. |
Source code in skyulf-core/skyulf/core/schema.py
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 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 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 | |
__contains__(item)
Support in: return True if item is a column name in this schema.
Source code in skyulf-core/skyulf/core/schema.py
173 174 175 | |
__len__()
Return the number of columns in this schema.
Source code in skyulf-core/skyulf/core/schema.py
177 178 179 | |
add(name, dtype='unknown')
Return a new schema with name added under dtype; unchanged if already present.
Source code in skyulf-core/skyulf/core/schema.py
124 125 126 127 128 129 130 | |
assert_compatible(actual, *, check_dtypes=False, check_order=False, where='input')
Validate that actual satisfies this (expected) schema.
self is the expected schema (e.g. what an Applier was fitted on);
actual is the schema observed at apply time. Raises
:class:SchemaMismatchError describing every discrepancy. Presence of
the expected columns is always checked; dtype and column-order checks
are opt-in to keep the default contract permissive and non-breaking.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
actual
|
SkyulfSchema
|
The schema observed at runtime. |
required |
check_dtypes
|
bool
|
Also compare dtype labels for shared columns. |
False
|
check_order
|
bool
|
Also require shared columns in the same relative order. |
False
|
where
|
str
|
Label used in the error message (e.g. |
'input'
|
Source code in skyulf-core/skyulf/core/schema.py
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 | |
column_list()
Return the column names as a plain list.
Source code in skyulf-core/skyulf/core/schema.py
169 170 171 | |
drop(names)
Return a new schema with the names columns (and their dtypes) removed.
Source code in skyulf-core/skyulf/core/schema.py
117 118 119 120 121 122 | |
from_columns(columns, dtypes=None)
classmethod
Build a schema from an iterable of columns and an optional dtypes mapping.
Source code in skyulf-core/skyulf/core/schema.py
77 78 79 80 81 82 83 | |
from_dataframe(df)
classmethod
Extract schema metadata from local or Spark frames without collecting rows.
Source code in skyulf-core/skyulf/core/schema.py
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 | |
has(name)
Return True if name is a column in this schema.
Source code in skyulf-core/skyulf/core/schema.py
165 166 167 | |
rename(mapping)
Return a new schema with columns renamed according to mapping.
Raises:
| Type | Description |
|---|---|
ValueError
|
If the rename would produce duplicate column names. |
Source code in skyulf-core/skyulf/core/schema.py
132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 | |
with_dtype(name, dtype)
Return a new schema with name's dtype set to dtype; unchanged if absent.
Source code in skyulf-core/skyulf/core/schema.py
155 156 157 158 159 160 161 | |
SplitApplier
Bases: BaseApplier
Route the input to the right :class:DataSplitter entry point.
Source code in skyulf-core/skyulf/preprocessing/split.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(df, params, *, sample_weight=None)
Split df into train/test and optional validation.
Routes three ways: an (X, y) tuple is split as a pair; a plain frame
carrying a configured target_column has that column lifted into y
first; anything else is split row-wise with the target left in place.
Source code in skyulf-core/skyulf/preprocessing/split.py
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 | |
SplitCalculator
Bases: BaseCalculator
Carry the split configuration into the artifact; splitting happens at apply time.
Source code in skyulf-core/skyulf/preprocessing/split.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 239 240 241 242 243 244 245 | |
fit(df, config)
Return a typed artifact and warn about ignored public configuration keys.
type and underscore-prefixed routing metadata are ignored quietly.
Use stratify=True with target_column to request stratification;
stratify_col belongs to DataSplitter, not this node's config.
Source code in skyulf-core/skyulf/preprocessing/split.py
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 | |
infer_output_schema(input_schema, config)
Return input_schema: every split frame keeps the full column set.
Source code in skyulf-core/skyulf/preprocessing/split.py
237 238 239 240 241 242 243 244 245 | |
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 | |
StatefulTransformer
Fits + applies one pipeline step.
Accepts anything satisfying :class:~skyulf.core.protocols.CalculatorProtocol /
:class:~skyulf.core.protocols.ApplierProtocol (structural typing) — a
BaseCalculator/BaseApplier subclass, or any duck-typed object
exposing matching fit/apply methods, works without subclassing.
Source code in skyulf-core/skyulf/preprocessing/base.py
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 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 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 | |
__init__(calculator, applier, node_id, apply_on_test=True, apply_on_validation=True)
Store the node pair and which held-out splits it should be applied to.
apply_on_test/apply_on_validation turn the transform of those
splits off without dropping them from the result. params starts
empty and is filled by the first :meth:fit_transform; the profiling
counters are zeroed here and overwritten on every run.
Source code in skyulf-core/skyulf/preprocessing/base.py
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 | |
fit_transform(dataset, config)
Fit on the training data, apply to the held-out splits, and profile the run.
Wall time, row counts and peak memory land on self rather than in
the return value, and are recorded in a finally so a failing node
still reports what it cost. tracemalloc is borrowed, not owned: if
the caller is already tracing, only the peak growth since entry can be
attributed to this step and tracing is left running; otherwise it is
started here and stopped again on exit.
Source code in skyulf-core/skyulf/preprocessing/base.py
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 | |
fit_transform_weighted(data, config, weights)
Fit on real targets and propagate weights through the actual row selection.
Source code in skyulf-core/skyulf/preprocessing/base.py
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 | |
transform(dataset)
Apply the params stored by the last fit, without refitting.
Input detection mirrors :meth:_fit_transform_inner so a bare frame or
an (X, y) tuple goes straight to the applier, while a
SplitDataset is applied split-by-split honouring
apply_on_test/apply_on_validation. Built-in resamplers leave
SplitDataset unchanged during replay, with or without weights.
Calling this before any
:meth:fit_transform hands the applier an empty params dict rather
than raising.
Source code in skyulf-core/skyulf/preprocessing/base.py
403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 | |
TargetEncoderApplier
Bases: BaseApplier
Replace categorical columns with the target statistics the fitted encoder learned.
Both engines transform through the same sklearn TargetEncoder carried in
the artifact, so parity comes from sharing it. The output shape follows the
target type: binary and regression targets are encoded in place, while a
multiclass target drops the originals and emits one {col}_cls{i} column
per class. Multiclass output names must not collide with retained columns;
conflicts raise ValueError before any input values are replaced.
Source code in skyulf-core/skyulf/preprocessing/encoding/target.py
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 | |
apply(X, y, params)
Dispatch to the engine-specific transform, forwarding (X, y) only when present.
Source code in skyulf-core/skyulf/preprocessing/encoding/target.py
211 212 213 214 215 216 217 218 | |
inference_capability(state, *, engine)
staticmethod
Describe saved target-statistic lookups without refitting or admitting workers.
Source code in skyulf-core/skyulf/preprocessing/encoding/target.py
203 204 205 206 207 208 209 | |
validate_inference_state(raw)
staticmethod
Inspect the saved full-data encoder while leaving cross-fitted training values alone.
Source code in skyulf-core/skyulf/preprocessing/encoding/target.py
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 | |
TargetEncoderCalculator
Bases: BaseCalculator
Fit a sklearn TargetEncoder against y, cross-fitting the training rows.
A target is mandatory: with no y the node logs a warning and returns an
empty artifact rather than failing. The target column is excluded from the
encoded set, since encoding it against itself is degenerate. This calculator
also satisfies TrainTransformCalculatorProtocol, so the training split
receives out-of-fold encodings — a row's own target never leaks into its
feature — with the fold count capped by the smallest class count, while
held-out splits go through the plain applier.
Source code in skyulf-core/skyulf/preprocessing/encoding/target.py
412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 | |
fit(X, y, config)
Short-circuit an explicit empty column selection, else fit on the frame's own engine.
Source code in skyulf-core/skyulf/preprocessing/encoding/target.py
433 434 435 436 437 438 439 440 441 442 443 444 445 | |
fit_transform_train(df, config)
Fit sklearn TargetEncoder and cross-fit the pipeline training rows.
Source code in skyulf-core/skyulf/preprocessing/encoding/target.py
447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 | |
infer_output_schema(input_schema, config)
Predict the schema only when target_type is explicitly binary or continuous.
Anything else — "auto" included — can resolve to multiclass at fit
time, which changes the column set in a data-dependent way, so None
is returned and callers fall back to runtime introspection.
Source code in skyulf-core/skyulf/preprocessing/encoding/target.py
467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 | |
TextCleaningApplier
Bases: BaseApplier
Apply an ordered chain of text operations to the resolved columns.
The pandas and polars paths must agree value-for-value. Each column is
coerced to string first, then every entry in operations is applied in
list order so later operations see earlier results. The pandas coercion
masks nulls back afterwards, otherwise astype(str) would turn them into
the literal "nan". Unrecognized operation names raise ValueError, and
an empty column set or empty operation list is a no-op.
Source code in skyulf-core/skyulf/preprocessing/cleaning/text.py
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 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 | |
apply(X, _y, params)
Dispatch the operation chain to the pandas or polars path; y passes through.
Source code in skyulf-core/skyulf/preprocessing/cleaning/text.py
214 215 216 217 218 219 | |
inference_capability(state, *, engine)
staticmethod
Describe local row operations while retaining engine-specific regex behavior.
Source code in skyulf-core/skyulf/preprocessing/cleaning/text.py
206 207 208 209 210 211 212 | |
validate_inference_state(raw)
staticmethod
Inspect saved operations without rewriting their order, defaults or no-ops.
Source code in skyulf-core/skyulf/preprocessing/cleaning/text.py
188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 | |
TextCleaningCalculator
Bases: BaseCalculator
Resolve text-cleaning config into an artifact; nothing is learned from data.
Source code in skyulf-core/skyulf/preprocessing/cleaning/text.py
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 | |
fit(X, _y, config)
Build the artifact, auto-detecting text columns when none are named.
Two cases short-circuit to an empty artifact: an explicit
columns: [] from the UI, and auto-detection finding no text columns
at all. Both make the applier a no-op rather than coercing numeric
columns to text.
Source code in skyulf-core/skyulf/preprocessing/cleaning/text.py
280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 | |
infer_output_schema(input_schema, config)
Pass the input schema through: string values are rewritten in place.
Source code in skyulf-core/skyulf/preprocessing/cleaning/text.py
273 274 275 276 277 278 | |
TfidfVectorizerApplier
Bases: BaseApplier
Attach one TF-IDF-weighted column per vocabulary term to the frame.
The configured text columns are joined into a single corpus string before
transforming, the dense result is concatenated on, and the source columns
survive unless drop_original is set. This node uses the text-specific
dispatcher: the polars path runs natively, so only the text payload crosses
into sklearn, and it falls back to a full pandas round-trip when a text
column is not String dtype.
Source code in skyulf-core/skyulf/preprocessing/vectorization/tfidf_vectorizer.py
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 | |
apply(X, _y, params)
Dispatch through the text-specific dual-engine path; y passes through.
Source code in skyulf-core/skyulf/preprocessing/vectorization/tfidf_vectorizer.py
98 99 100 101 102 103 | |
inference_capability(state, *, engine)
staticmethod
Describe fixed document weighting while leaving arbitrary analyzers undeclared.
Source code in skyulf-core/skyulf/preprocessing/vectorization/tfidf_vectorizer.py
88 89 90 91 92 93 94 95 96 | |
validate_inference_state(raw)
staticmethod
Inspect learned vocabulary and IDF weights without recomputing corpus statistics.
Source code in skyulf-core/skyulf/preprocessing/vectorization/tfidf_vectorizer.py
77 78 79 80 81 82 83 84 85 86 | |
TfidfVectorizerCalculator
Bases: BaseCalculator
Fit a TfidfVectorizer vocabulary and IDF weights on the joined text.
Both the vocabulary and the per-term IDF weights are learned from the training corpus and carried in the artifact, so the weights stay inspectable and serialisable. A very wide output is warned about rather than raising, since it is a memory problem, not an error.
Schema inference inherits the base None result: the learned vocabulary
determines the output columns, so their schema is only known at runtime.
Source code in skyulf-core/skyulf/preprocessing/vectorization/tfidf_vectorizer.py
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 | |
fit(X, _y, config)
Narrow to the configured text columns and fit the vocabulary on their joined text.
An empty or wholly-absent column selection yields an empty artifact so
the applier no-ops. An empty vocabulary also yields an empty artifact
with a warning; source columns are retained even with drop_original.
Source code in skyulf-core/skyulf/preprocessing/vectorization/tfidf_vectorizer.py
200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 | |
TokenizerApplier
Bases: BaseApplier
Emit one space-joined token string per source column, not one column per token.
Keeping the tokens in a single {col}__tokens string is deliberate: it
stays inspectable and can feed a downstream vectorizer, whereas exploding to
columns would make the output width data-dependent. add_token_count adds
a companion {col}__token_count integer column. Nulls are coerced to empty
strings before tokenizing, and sources survive unless drop_original is
set. The node is stateless — the sklearn analyzer is rebuilt from params
on every call. The polars path runs natively and falls back to pandas when a
text column is not String dtype.
Source code in skyulf-core/skyulf/preprocessing/vectorization/tokenizer.py
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 | |
apply(X, _y, params)
Dispatch through the text-specific dual-engine path; y passes through.
Source code in skyulf-core/skyulf/preprocessing/vectorization/tokenizer.py
164 165 166 167 | |
inference_capability(state, *, engine)
staticmethod
Describe per-document tokenization without promising arbitrary callback behavior.
Source code in skyulf-core/skyulf/preprocessing/vectorization/tokenizer.py
154 155 156 157 158 159 160 161 162 | |
validate_inference_state(raw)
staticmethod
Inspect saved analyzer configuration without constructing or executing it.
Source code in skyulf-core/skyulf/preprocessing/vectorization/tokenizer.py
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 | |
TokenizerCalculator
Bases: BaseCalculator
Record the resolved text columns and the tokenizer settings — nothing is fitted.
learns_from_data=False: the artifact is pure configuration, so it is
reproducible across runs and safe to reuse on data the calculator never saw.
Schema inference conservatively inherits the base None result. Fitting
resolves source columns and excludes the target, including a separately
supplied y; runtime introspection determines which source and token
columns remain after applying drop_original.
Source code in skyulf-core/skyulf/preprocessing/vectorization/tokenizer.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 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 | |
fit(X, _y, config)
Resolve the configured text column names and record them with the tokenizer settings.
Uses the column-names-only resolver rather than the data-narrowing sibling, so a polars input is never converted to pandas just to fit. An empty or wholly-absent selection yields an empty artifact so the applier no-ops.
Source code in skyulf-core/skyulf/preprocessing/vectorization/tokenizer.py
234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 | |
UndersamplingApplier
Bases: BaseApplier
Shrink the majority classes with the imblearn under-sampler named in the artifact.
Sees the training split only: :mod:.pipeline excludes the resampling nodes
from apply_on_test/apply_on_validation. That guard matters more here
than for oversampling, because these samplers delete real rows rather than
synthesise new ones.
Source code in skyulf-core/skyulf/preprocessing/resampling.py
480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 | |
apply(X, y, params)
Resample (X, y) with the configured under-sampler.
y is lifted out of X via target_column when not supplied
separately; with no usable target the data passes through untouched, as
it does for a method no builder recognizes.
Raises:
| Type | Description |
|---|---|
ValueError
|
If any feature column is non-numeric, which imblearn cannot resample. Encode first. |
Source code in skyulf-core/skyulf/preprocessing/resampling.py
504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 | |
inference_capability(state, *, engine)
staticmethod
Require full class context; prediction still skips every sampling method.
Source code in skyulf-core/skyulf/preprocessing/resampling.py
494 495 496 497 498 499 500 501 502 | |
validate_inference_state(raw)
staticmethod
Inspect saved selection settings without loading the optional sampler package.
Source code in skyulf-core/skyulf/preprocessing/resampling.py
489 490 491 492 | |
UndersamplingCalculator
Bases: BaseCalculator
Configure class balancing by undersampling the majority class.
Source code in skyulf-core/skyulf/preprocessing/resampling.py
530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 | |
fit(_X, _y, config)
Snapshot the sampler settings from config into the artifact.
Neither _X nor _y is read: the artifact is pure configuration.
Several of its keys are sampler-specific, so each method consumes only
the subset its imblearn class accepts.
Source code in skyulf-core/skyulf/preprocessing/resampling.py
553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 | |
infer_output_schema(input_schema, config)
Return input_schema untouched.
Source code in skyulf-core/skyulf/preprocessing/resampling.py
546 547 548 549 550 551 | |
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 | |
ValueReplacementApplier
Bases: BaseApplier
Replace configured values in the resolved columns, leaving other cells alone.
The pandas and polars paths must agree value-for-value. A mapping wins
over to_replace/value when both are configured, and may be flat
(one map applied to every column) or nested ({column: {old: new}}).
Mapping and to_replace keys are coerced to the column's dtype before
lookup. A list of keys can share one replacement or have a same-length
list of replacements. A column selection resolving to nothing is a no-op.
Numeric rules on integer columns must fit the existing integer dtype; fractional, infinite and out-of-range replacements require an explicit Casting step. Missing replacements use native nullable integers. These checks use configured rules before matching rows, including empty requests. Nonnumeric replacements retain their native engine behavior.
Source code in skyulf-core/skyulf/preprocessing/cleaning/value_replacement.py
381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 | |
apply(X, _y, params)
Dispatch the replacement to the pandas or polars path; y passes through.
Source code in skyulf-core/skyulf/preprocessing/cleaning/value_replacement.py
416 417 418 419 420 421 | |
inference_capability(state, *, engine)
staticmethod
Describe row dependency without claiming chunk-invariant dtype inference.
Source code in skyulf-core/skyulf/preprocessing/cleaning/value_replacement.py
408 409 410 411 412 413 414 | |
validate_inference_state(raw)
staticmethod
Inspect scalar, list, tuple and dictionary state without coercing saved rules.
Source code in skyulf-core/skyulf/preprocessing/cleaning/value_replacement.py
398 399 400 401 402 403 404 405 406 | |
ValueReplacementCalculator
Bases: BaseCalculator
Resolve value-replacement config into an artifact; nothing is learned from data.
Source code in skyulf-core/skyulf/preprocessing/cleaning/value_replacement.py
453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 | |
fit(X, _y, config)
Build the artifact, folding the UI's replacements pairs into a flat mapping.
A non-empty replacements list overrides any configured mapping.
to_replace/value are carried through untouched for the applier
to fall back on when no mapping survived.
Source code in skyulf-core/skyulf/preprocessing/cleaning/value_replacement.py
492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 | |
infer_output_schema(input_schema, config)
Preserve columns and report only output dtypes guaranteed by the active rules.
Integer null rules expose their native nullable type. Data-dependent or unsupported replacements omit the affected dtype; consumers can still validate column references and display the type as unknown.
Source code in skyulf-core/skyulf/preprocessing/cleaning/value_replacement.py
465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 | |
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 | |
WinsorizeApplier
Bases: BaseApplier
Clip values to the fitted percentile bounds; rows are never removed.
Source code in skyulf-core/skyulf/preprocessing/outliers/winsorize.py
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 | |
apply(X, y, params)
Clip X to the fitted per-column bounds; y passes through untouched.
Source code in skyulf-core/skyulf/preprocessing/outliers/winsorize.py
137 138 139 140 141 142 143 144 145 146 147 | |
inference_capability(state, *, engine)
staticmethod
Describe local row clipping with saved limits without admitting Spark workers.
Source code in skyulf-core/skyulf/preprocessing/outliers/winsorize.py
129 130 131 132 133 134 135 | |
validate_inference_state(raw)
staticmethod
Inspect learned bounds and metadata without recomputing request quantiles.
Source code in skyulf-core/skyulf/preprocessing/outliers/winsorize.py
108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 | |
WinsorizeCalculator
Bases: BaseCalculator
Fit per-column clip bounds at the configured lower/upper percentiles.
Source code in skyulf-core/skyulf/preprocessing/outliers/winsorize.py
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 | |
fit(X, _y, config)
Compute each column's lower/upper quantiles; warn on empty or non-numeric ones.
Source code in skyulf-core/skyulf/preprocessing/outliers/winsorize.py
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 | |
infer_output_schema(input_schema, config)
Preserve integer columns and retain existing promotion for other selected types.
Source code in skyulf-core/skyulf/preprocessing/outliers/winsorize.py
190 191 192 193 194 195 196 197 198 199 200 | |
ZScoreApplier
Bases: BaseApplier
Drop rows whose |z| against the fitted mean/std exceeds threshold in any column.
Source code in skyulf-core/skyulf/preprocessing/outliers/zscore.py
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 | |
apply(X, y, params)
Filter rows through the fitted z-score threshold on the active engine.
Source code in skyulf-core/skyulf/preprocessing/outliers/zscore.py
61 62 63 64 65 66 67 68 69 70 71 | |
inference_capability(state, *, engine)
staticmethod
Describe saved row filtering without bypassing the prediction row-count guard.
Source code in skyulf-core/skyulf/preprocessing/outliers/zscore.py
52 53 54 55 56 57 58 59 | |
validate_inference_state(raw)
staticmethod
Inspect saved numeric statistics and native scalar threshold semantics.
Source code in skyulf-core/skyulf/preprocessing/outliers/zscore.py
40 41 42 43 44 45 46 47 48 49 50 | |
ZScoreCalculator
Bases: BaseCalculator
Fit per-column mean and population std (ddof=0) for z-score filtering.
Source code in skyulf-core/skyulf/preprocessing/outliers/zscore.py
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 | |
fit(X, _y, config)
Record each column's mean/std; warn on empty or zero-variance columns.
Source code in skyulf-core/skyulf/preprocessing/outliers/zscore.py
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 | |
infer_output_schema(input_schema, config)
Return the input schema unchanged: row filtering preserves the column set.
Source code in skyulf-core/skyulf/preprocessing/outliers/zscore.py
124 125 126 127 128 129 | |
column_step(name, function, *, output, replace=False, params=None, inference_context=None)
Build columns from function(df) or function(df, params).
inference_context optionally declares row, group, window or global input
dependence for diagnostics. It does not authorize distributed execution.
Source code in skyulf-core/skyulf/preprocessing/function_steps.py
390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 | |
filter_step(name, function, *, columns, params=None, inference_context=None)
Build a pre-split filter keeping rows where function(df) is True.
inference_context optionally declares row, group, window or global input
dependence for diagnostics. Undeclared callback context remains unknown.
Source code in skyulf-core/skyulf/preprocessing/function_steps.py
446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 | |
fitted_step(name, learn, apply, *, output, replace=False, params=None, inference_context=None)
Build a step reusing learn(df, y) state in apply(df, state).
inference_context optionally declares row, group, window or global input
dependence for diagnostics. Learned state alone supplies no such promise.
Source code in skyulf-core/skyulf/preprocessing/function_steps.py
417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 | |
frame_rows(frame)
Row count for pandas/polars frames and numpy arrays (-1 if unknowable).
Source code in skyulf-core/skyulf/preprocessing/fold_adapter.py
365 366 367 368 369 370 371 372 373 | |
validate_schema(expected, actual, *, check_dtypes=False, check_order=False, where='input')
Validate a live DataFrame against an expected schema.
Thin convenience wrapper: builds a :class:SkyulfSchema from actual
(Pandas/Polars/wrapper frame) and delegates to
:meth:SkyulfSchema.assert_compatible. Raises
:class:SchemaMismatchError on any violation.
Source code in skyulf-core/skyulf/core/schema.py
279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 | |