Skip to content
Merged

0821 #165

Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
529e7c9
fix(eda): recognize small string categories and exclude missing labels
flyingriverhorse Sep 12, 2026
4fea1cc
fix(eda): retain reliable per-feature VIF warnings
flyingriverhorse Sep 12, 2026
8425f56
fix(preprocessing): process Decimal columns as numeric features
flyingriverhorse Sep 12, 2026
2ba4c67
fix(preprocessing): include Enum columns in text auto-selection
flyingriverhorse Sep 12, 2026
9663132
fix(preprocessing): align numeric profiles and missing bin labels
flyingriverhorse Sep 12, 2026
7947d5a
fix(core): preserve calibrated model choices and validate preprocessi…
flyingriverhorse Sep 12, 2026
81f35f0
fix(core): guard generated columns and empty-data expectations
flyingriverhorse Sep 12, 2026
f479e19
fix(core): restore LightGBM sampling and decomposition navigation
flyingriverhorse Sep 12, 2026
f0468f2
ideas
flyingriverhorse Sep 12, 2026
d470b87
fix(core): align validation targets and preserve class and group iden…
flyingriverhorse Sep 12, 2026
61d6272
fix(core): repair fold alignment, tuning weights and preprocessing edges
flyingriverhorse Sep 12, 2026
b0fd13b
fix: resolve seven core audit findings and align canvas preview paths
flyingriverhorse Sep 12, 2026
8053a84
fix: preserve categorical replay and profiling data across engines
flyingriverhorse Sep 12, 2026
c9de8e7
fix: preserve inference provenance and categorical drift evidence
flyingriverhorse Sep 12, 2026
8a83ad6
fix: close six core audit findings and bump to 0.8.21
flyingriverhorse Sep 12, 2026
b379151
fix: resolve complexity and sklearn compatibility CI failures
flyingriverhorse Sep 12, 2026
e1bc7b4
ci: enforce CCN 10 across core and backend
flyingriverhorse Sep 12, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions backend/ml_pipeline/_execution/engine/_feature_eng.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
from skyulf.modeling.base import extract_xy
from skyulf.preprocessing.fold_adapter import (
SPLITTER_STEP_TYPES,
UNSAFE_BRANCH_STEP_TYPES,
FeatureEngineerFoldAdapter,
MergedBranchFoldAdapter,
merged_branch_step_unsafe_reason,
)
from skyulf.preprocessing.pipeline import FeatureEngineer

Expand Down Expand Up @@ -556,10 +556,11 @@ def _try_fork_join_refit(
)
for step in branch_steps:
transformer = step.get("transformer")
if transformer in UNSAFE_BRANCH_STEP_TYPES:
reason = merged_branch_step_unsafe_reason(step)
if reason is not None:
return (
None,
(f"branch step '{transformer}' splits data or changes row counts"),
(f"branch step '{transformer}' {reason}"),
"row_changing_branch_step",
)
branch_lists.append(branch_steps)
Expand Down
167 changes: 167 additions & 0 deletions changelog/0.8.x.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,175 @@
For the version index, see root [CHANGELOG.md](../CHANGELOG.md).

---
## v0.8.21

- **Sequential transformation fitting (OC-264):** fit each power rule against
preceding transformations on the same column, matching replay order. Refit
affected transformation steps and downstream models to correct saved statistics.
- **Native date cross-validation (OC-275):** detect pandas `datetime.date`
columns for chronological folds while preserving target alignment, stable
ordering and missing dates last. Rerun affected temporal CV/tuning evaluations.
- **Elastic Net defaults (OC-282):** resolve omitted/null Logistic Regression
`l1_ratio` to `0.5` for Elastic Net in fitting, all tuning strategies and final
refitting. Search it separately from other penalties when its ratio is
unspecified; explicit numeric Elastic Net ratios remain unchanged.
- **Missing-row policy validation (OC-285):** reject unsupported or explicit
null `how` values during fit and replay instead of filtering differently
across engines. Omitted `how` continues to mean `any`.
- **Numeric imputation selections (OC-294):** reject explicit text columns for
mean/median with an actionable error on both engines; preserve numeric
automatic selection and supported text strategies.
- **Decimal text-cleaning safety (OC-295):** automatic text selection excludes
pandas Decimal columns, preserving their exact values and dtype. Refit saved
text-cleaning selections and rerun affected transformations from original data.
- **Inference result provenance (OC-293):** the results table and downloaded
CSV use the input belonging to the displayed run, including saved history
and results retained during a rerun. Editing the input cannot relabel old
predictions, and cleared or retired requests cannot restore stale results.
- **Polling response order (OC-291):** stale requests cannot overwrite newer
job status or retry accounting, and terminal results stop queued refreshes
and socket-triggered restarts. Slow responses remain usable while a newer
request is pending.
- **Categorical drift evidence (OC-257/317):** include native Enum columns in
drift calculations and categorical PSI in the page's average and most-drifted
cards. Show unavailable PSI explicitly instead of treating it as stable zero.
Rerun saved checks to recover Enum measurements omitted by older calculations.
- **Text output collisions (OC-290):** Tokenizer, Count, TF-IDF, Hashing and
Sentence Embedder reject output names that overwrite retained columns or
create duplicates, during both fit and inference. Tokenizer reads all original
sources before replacing dropped columns, preserving valid name reuse.
- **Missing-indicator schema (OC-296):** only predict flags for input columns
that exist, so downstream references to nonexistent flags remain detectable.
- **Arithmetic missing values (OC-300):** apply configured `fillna` to both
native nulls and NaNs on Polars, matching pandas for all four arithmetic
operations. Rerun affected transformations and refit downstream models.
- **Portable category encoding (OC-271/299):** newly fitted DummyEncoder
artifacts preserve Boolean and date/datetime categories across pandas and
Polars, and automatic encoder selection includes native Enum columns.
Refit affected encoders and downstream models to apply the new behavior;
saved artifacts retain their existing category names.
- **Binning output safety (OC-276/283/284):** new range artifacts preserve
category names across engines; reject collisions and ambiguous duplicate-edge
labels, and retain the binned output when replacing a dropped source with an
empty suffix. Refit legacy binning and downstream encoders/models together
before changing engines.
- **Lossless date profiling (OC-273/305):** retain original strings when the
selected date format cannot parse the full column, preventing fabricated
missingness and Drop recommendations. Empty temporal bounds are actual nulls.
Regenerate saved profiles; normalize mixed formats before temporal analysis.
- **Exact integer cleanup (OC-297):** infinity-only replacement preserves
signed/unsigned integer values and dtypes, including values beyond Float64
precision. Additional numeric rules and floating infinity replacement remain
effective. Rerun affected transformations from the original data.
- **Canvas preview path labels:** include preprocessing outputs that feed a
separate Data Preview node when assigning path letters, so their Canvas
labels and Preview Results tabs agree. Use registered display names such as
Resampling instead of technical type names such as Resampling Node.
- **Casting date and boolean text (OC-265/266):** preserve valid date strings
on Polars and support boolean aliases in Categorical and Enum columns.
- **SMOTE + Tomek neighbors (OC-267):** apply the configured neighbor count
to inner SMOTE and expose/validate the setting in Canvas.
- **Feature-selection target types (OC-256):** recognize pandas StringDtype
and string Categorical targets as classification, including more than ten labels.
- **Calibrated ensemble refits (OC-268):** retain tuned calibration and nested
base-model parameters during subsequent training and cross-validation.
- **Native missing features in tuning (OC-270):** inspect estimator support
instead of a model-name allowlist, retaining old sklearn tag compatibility.
- **Threshold-aware fingerprints (OC-261):** include saved decision thresholds
in pipeline identity. Recompute stored fingerprints for affected pipelines;
model retraining is not required.
- **Merged-fold row alignment (OC-248):** reject branch configurations that
sort or filter observations before a positional merge. Core and backend use
the same admission checks; runtime row-count checks guard branch outputs.
- **Tuned class weights (OC-250):** apply nonnative class weights during all
search strategies and final refitting using each fold's transformed training
labels. Retrain affected tuned models to apply previously ignored weights.
- **Constant-feature PCA (OC-46):** report PCA as unavailable when prepared
features have no variation, preventing NaN variance ratios in public JSON.
- **LabelEncoder target containers (OC-254):** apply target encoding to lists
and NumPy arrays on either engine, preserving native Series metadata and
leaving feature-only targets unchanged.
- **Antipodal distances (OC-263):** prevent floating-point roundoff from
producing NaN Haversine distances for valid opposite points on Earth.
- **Threshold validation alignment (OC-249):** carry labels through the same
sorting and filtering as validation features before choosing decision
thresholds; reject mismatched raw row counts. Rerun threshold optimization
if an affected pipeline previously saved a cutoff.
- **Single-class evaluation (OC-35):** omit undefined binary ROC curves and
ROC AUC when a holdout contains one class, while retaining finite PR output.
- **PR-AUC tuning (OC-252):** align probability columns with the fitted model's
classes when validation omits a class, including the binary positive class.
- **Decomposition column names (OC-258):** preserve groups named `value` or
`ratio` through aggregation and drill-down; allow a numeric grouping column
to serve as its own measure.
- **Dataframe wrapper restoration (OC-262):** load pickled/joblib pandas and
Polars wrappers without recursion, preserving their data and native methods.
- **LightGBM row sampling (OC-187):** make `subsample` effective for GBDT/DART
in basic training, all tuning strategies and final refitting. Preserve GOSS
sampling, explicit frequency overrides and existing fitted models; retrain
to apply a previously ignored fraction.
- **EDA decomposition missing groups (OC-192):** keep missing values separate
from a literal `Unknown` category and use their identity when drilling down.
The tree labels missing groups explicitly and retains them during navigation.
- **Split configuration warnings (OC-90):** warn when an unsupported public
setting is ignored, including `stratify_col`; use `stratify` and
`target_column` in node configs. Canvas sends only supported split settings
plus routing metadata, so editor labels do not produce warnings.
- **Generated column collisions (OC-18):** reject conflicting one-hot, dummy,
missing-indicator and multiclass target-encoding names before replacing
existing data or emitting duplicate columns. Checks also apply at inference;
names belonging only to dropped sources remain available.
- **Datetime output names (OC-30):** honor the configured output name, using
it as a prefix for multiple features. Preserve existing columns with numbered
suffixes unless overwrite is enabled. Refit saved pipelines affected by
previously ignored names or overwritten columns.
- **Empty-data expectations (OC-48):** null, range and uniqueness checks
reject zero-row datasets by default. Add `allow_empty=True` to calls that
intentionally accept empty partitions; column-existence checks stay unchanged.
- **Calibrated base selection in tuning (OC-66 follow-up):** honor Base
Estimator search choices in every strategy and final refit, including fold
preprocessing. Random Forest selection no longer fails in Optuna/halving
or silently trains logistic regression in Grid/Random search.
- **EDA transformation advice (OC-51):** choose transformations compatible
with the value range and skew direction. Preparation recommendations now
suppress the contradictory clean-dataset message, including target resampling.
- **Calibrated classifier seeds (OC-101):** apply `random_state` to stochastic
base estimators during training, tuning and final refitting. Default 42 and
explicit 0/None are respected; calibration CV splitting remains unchanged.
- **Invalid-value replacement (OC-140):** reject nonnumeric selections with
a clear error before either engine can coerce text or compare it to numbers.
Numeric text requires explicit conversion; temporal columns are excluded
from automatic selection, and inactive configurations preserve their input.
- **Dataset Profile coverage (OC-59):** report supported numeric dtypes on
both engines, including small/unsigned integers, binary, constant and
entirely missing numeric columns. Rerun the node to refresh saved profiles.
- **Binning missing labels (OC-60):** honor the configured missing label on
Polars for null, NaN and out-of-range bins. Label mode consistently returns
strings on Polars; pandas retains mixed numeric/text values and the default
keep strategy is unchanged.
- **Group aggregation regressions (OC-24):** verify the existing shared
null/NaN training group and fitted-only inference behavior across both engines.
- **EDA string categories (OC-110):** recognize repeated labels in small
datasets so categorical statistics and classification target analysis are
available. Infer from non-missing values; preserve unique strings as text.
Rerun saved analyses to refresh their results.
- **EDA category counts (OC-247):** exclude missing values from distinct and
rare-label counts and keep them from displacing observed top categories.
- **Decimal preprocessing (OC-120):** include Decimal columns in numeric
auto-selection on both engines and handle selected values and missingness
safely through scaling, imputation, outlier handling and binning. Numeric
calculations use float64; source frames retain exact Decimal values. Refit
affected pipelines to include columns omitted by older fitted artifacts.
- **Enum text cleaning (OC-121):** include Polars Enum columns in automatic
TextCleaning and AliasReplacement selection, matching pandas categorical
strings. Preserve missing values and explicit empty selections; refit saved
artifacts that previously omitted Enum columns.

## v0.8.20

- **EDA multicollinearity (OC-113):** use regression residuals when correlation
inversion is unstable so near-duplicate features retain high-VIF warnings;
preserve low VIF for unrelated features. Rerun saved analyses to refresh results.
- **EDA causal analysis (OC-235–238):** correct reversed arrows, retain the
selected numeric target under the feature cap, and replace arbitrary
categorical target codes with an explicit numeric-analysis boundary.
Expand Down
23 changes: 22 additions & 1 deletion docs/guides/backend_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,28 @@ Get a specific EDA report by ID.
Cancel a running EDA analysis.

### `POST /api/eda/{dataset_id}/decomposition`
Run time-series decomposition on a dataset column.
Aggregate a measure for one level of the EDA decomposition tree, optionally
grouped by `split_col` and restricted by `filters`.

Grouped response rows include `name` (display label), `filter_value` (the
category identity), `value` and `ratio`. Use `filter_value` when drilling into a
row: missing values have JSON `null`, while a real category named `Unknown`
has the string `"Unknown"`. For example, the following filter selects missing
values in `group`:

```json
{"column": "group", "operator": "==", "value": null}
```

Input columns can be named `value`, `ratio`, `name` or `filter_value`; those
names do not conflict with response fields. A numeric column can also be used
as both the grouping column and the measure.

Use `"!="` with `null` to select non-missing rows. The UI labels the missing
bucket `Unknown (missing)` and keeps literal `Unknown` separate. Older response
rows without `filter_value` fall back to their display name; the legacy string
`"Unknown"` still selects missing values on numeric columns. Reload or reopen
the tree to obtain updated group identities; no stored-data migration is needed.

### `GET /api/eda/jobs/all`
List all EDA jobs with status. Query params: `limit` (default 50), `skip` (default 0).
Expand Down
10 changes: 10 additions & 0 deletions docs/guides/multi_path_pipelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@

Skyulf supports building pipelines with **multiple branches** that merge into a single training node or fan out into separate experiments. This guide covers both patterns.

## Preview Path Labels

Canvas path labels identify the corresponding branches in **Preview Results**.
They use the node's display name, such as **Resampling**, or your custom label.
The **Preview data** action excludes separate Data Preview nodes; a preprocessing
output feeding only one of those nodes still gets its own preview path. For
example, parallel Imputation and Resampling outputs retain matching path letters
on their Canvas connections and result tabs even when Imputation also feeds a
Data Preview node. Rerun Preview after changing the graph to refresh the results.

---

## Merge: Combining Multiple Branches
Expand Down
6 changes: 6 additions & 0 deletions docs/guides/profiling_comparison.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,12 @@ descriptive statistics. Its profile can include:

- **PCA Projection:** Skyulf computes 2D/3D PCA projections colored by target class, helping you visually assess class separability before training a model.

If all prepared numeric features are constant, including after missing-value
imputation, PCA has no variance to explain. The profile returns
`pca_data=null` and `pca_components=null`, and the UI shows its existing
unavailable state. A varying feature alongside a constant feature still
produces PCA output.

- **Target Interactions with ANOVA (p-values):** For categorical targets, Skyulf can compute ANOVA p-values for numeric features (when SciPy is available) and rank associations accordingly. This helps you quickly find features that differ meaningfully across target classes.

**3. Specialized Domain Analysis**
Expand Down
35 changes: 30 additions & 5 deletions docs/reference/data_validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ dependencies**. Each `expect_*` function checks a single condition and raises
[`ExpectationError`][skyulf.profiling.expect.ExpectationError] with a precise
message when the condition is violated.

It is **engine-agnostic**: Pandas frames are used directly; Polars (or any frame
exposing `to_pandas()`) is converted first.
It is **engine-agnostic**: Pandas frames are used directly; raw and wrapped
Polars frames stay native for simple predicates. Boolean range checks and
other frames exposing `to_pandas()` use Pandas conversion.

## When to use it

Expand All @@ -24,9 +25,33 @@ automatically. You call them yourself in two main places:
| Function | Checks |
| --- | --- |
| `expect_columns_exist(df, columns)` | Every name in `columns` is present. |
| `expect_no_nulls(df, columns=None)` | Given columns (default: all) have no nulls. |
| `expect_value_range(df, column, *, minimum, maximum, inclusive=True)` | All values fall within `[minimum, maximum]`. |
| `expect_unique(df, columns)` | The combination of `columns` has no duplicate rows. |
| `expect_no_nulls(df, columns=None, *, allow_empty=False)` | Given columns (default: all) have no nulls. |
| `expect_value_range(df, column, *, minimum=None, maximum=None, inclusive=True, allow_empty=False)` | All non-null values fall within the optional bounds. |
| `expect_unique(df, columns, *, allow_empty=False)` | The combination of `columns` has no duplicate rows. |

## Empty datasets

The null, range and uniqueness checks require at least one row by default.
An ingestion that unexpectedly returns zero rows therefore raises
`ExpectationError`, even if the expected columns are present.

If empty partitions are valid in your workflow, explicitly opt in on each check:

```python
import pandas as pd
from skyulf import expect_no_nulls, expect_unique, expect_value_range

empty = pd.DataFrame({"age": pd.Series(dtype="float64")})
expect_no_nulls(empty, ["age"], allow_empty=True)
expect_value_range(empty, "age", minimum=0, maximum=120, allow_empty=True)
expect_unique(empty, ["age"], allow_empty=True)
```

Previously these checks accepted empty frames automatically; existing callers
that rely on that behavior must add `allow_empty=True`. Requested columns must
still exist. `expect_columns_exist` only checks the schema and accepts zero rows.
Range checks continue to ignore null values, including an all-null column in a
frame that has rows; combine them with `expect_no_nulls` when nulls are invalid.

## Example: a dataset contract in CI

Expand Down
Loading
Loading