Skip to content

Dev/master#197

Merged
TonyKatkov89 merged 95 commits into
masterfrom
dev/master
Dec 29, 2025
Merged

Dev/master#197
TonyKatkov89 merged 95 commits into
masterfrom
dev/master

Conversation

@TonyKatkov89

Copy link
Copy Markdown
Collaborator

No description provided.

@Dmatryus Dmatryus left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👌

@TonyKatkov89 TonyKatkov89 merged commit e2cdd3f into master Dec 29, 2025
18 checks passed
TonyKatkov89 added a commit that referenced this pull request Jun 18, 2026
* Base executors in the executors family scheme.

* Add analyzers in executors_famaly.dot

* Start abstract comporators

* Abstract comporators are finished

* Comporators are finished

* Add Data, Encoders and Extensions

* Add forks

* Micro refactor and new schemes:
* ml
* operators
* reporters

* New architecture sceme

* Update scheme

* Написали от начала до экспериментов

* Add Reporters

* Add Extensions

* Rework part 11

* Add toc

* Add part of presentation

* Add part of presentation

* Dev/master (#197)

* aan added

* best split assembled correctly

* tutorail updated, test added

* mantching n-neighbours added

* add cuped

* custom_weights added

* matching fixed

* one feature fix

* quality result fix

* const_groups fix

* ab multitest fixed

* add min_sample_size

* add feature importances

* tox fixed

---------

Co-authored-by: anastasiiafed24 <fedorovanasty24@gmail.com>
Co-authored-by: anastasiiafed24 <144920163+anastasiiafed24@users.noreply.github.com>
Co-authored-by: Alsherov Ruslan <114132014+anathema-git@users.noreply.github.com>
Co-authored-by: Альшеров Руслан <ruslan-alsherov@yandex.ru>
Co-authored-by: Dasha Vigovskaya <vigosya@Dashas-MacBook-Air.local>
Co-authored-by: Vigovskaya Daria <78546846+Vigosya@users.noreply.github.com>
Co-authored-by: Альшеров Руслан <uslan-alsherov@yandex.ru>

* Ks test in ab (#216)

* ks-test for ab-test added

* gitignore updated

* version update

* scipy requirements updated

* scipy requirements updated

* Cupac fix (#226)

* fix: CUPAC validation, KSTest pass display, and max_lag error handling

- Fix KSTest (and other stat tests) always showing "OK" due to `is True`
  identity check failing for numpy.bool_ values; use `bool(v)` instead
- Add clear ValueError when a CUPAC target has no lag periods defined,
  advising to use PreTargetRole(lag=N)
- Improve CUPAC validation error message to mention uninstalled packages

* ttest equal_vars changed to False by default

* ttest equal_vars changed to False by default

* version and readme updated

* version and readme updated

* documentation update

* deprecation warning added

* tutorails and ok/not_ok assignment fixed

* Update ci.yml (#227)

* Fix CUPED theta to Cov(X,Y)/Var(X)

The CUPED adjustment used theta = Cov(X,Y) / (std_x * std_y), which equals
the correlation coefficient rho and is only correct when std_x == std_y.
For covariates and targets on different scales this left variance on the
table (or, when std_x >> std_y, increased variance). Use the optimal
theta = Cov(X,Y) / Var(X) so the adjustment reaches the rho**2 reduction
bound. cov_xy and var_x are now both population moments so the 1/N factors
cancel exactly, and the zero-variance guard checks the denominator (var_x).

Add tests/test_cuped.py pinning rho**2 variance reduction across differing
X/Y scales, the theta = Cov/Var identity, and the constant-covariate no-op.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* Apply CUPED theta-scaling to CUPAC adjustment

CUPAC removed the model prediction from the target directly (y - (pred -
E[pred])), implicitly assuming theta = 1. That is only optimal when
Cov(pred, y) == Var(pred); for cross-period and regularized predictions the
scale differs, so it left variance on the table (and reported
variance_reduction_real below variance_reduction_cv).

Residualize with the optimal CUPED coefficient theta = Cov(pred, y)/Var(pred)
in both CUPAC paths:
- CV/model-selection (extensions/cupac.py): pool out-of-fold predictions and
  apply a single theta-residualization, matching cross-fitted CUPED.
- Final adjustment (ml/cupac.py): scale the explained variation by theta.

_cuped_theta guards a (near-)constant prediction with a scale-relative
threshold so theta=0 (no-op) instead of a ratio of floating-point noise.

Add tests/test_cupac.py: theta = Cov/Var identity, theta-residualization
never worse than theta=1 (strictly better under scale mismatch), constant
prediction no-op, and an end-to-end ABTest CUPAC variance-reduction check.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* Tune CUPAC default Ridge/Lasso hyperparameters

  Set Ridge(alpha=0.5) and Lasso(alpha=0.01, max_iter=10000) as the default
  CUPAC regressors instead of sklearn defaults (alpha=1.0).

  The default Lasso(alpha=1.0) under-fits and loses ~14pp of variance
  reduction, which could flip CUPAC model selection toward Linear even when
  a regularized model fits better. With these defaults the per-model
  variance reductions and selected best model match the reference CUPAC
  implementation exactly.

---------

Co-authored-by: Dmatryus <dmatryus.sqrt49@yandex.ru>
Co-authored-by: dmbulychev <dmbulychev@avito.ru>
Co-authored-by: anastasiiafed24 <fedorovanasty24@gmail.com>
Co-authored-by: anastasiiafed24 <144920163+anastasiiafed24@users.noreply.github.com>
Co-authored-by: Alsherov Ruslan <114132014+anathema-git@users.noreply.github.com>
Co-authored-by: Альшеров Руслан <ruslan-alsherov@yandex.ru>
Co-authored-by: Dasha Vigovskaya <vigosya@Dashas-MacBook-Air.local>
Co-authored-by: Vigovskaya Daria <78546846+Vigosya@users.noreply.github.com>
Co-authored-by: Альшеров Руслан <uslan-alsherov@yandex.ru>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants