Skip to content

Drop importances from khiops sklearn estimator attributes#494

Merged
popescu-v merged 6 commits into
devfrom
drop-importances-from-khiops-sklearn-estimator-attributes
Oct 14, 2025
Merged

Drop importances from khiops sklearn estimator attributes#494
popescu-v merged 6 commits into
devfrom
drop-importances-from-khiops-sklearn-estimator-attributes

Conversation

@popescu-v

@popescu-v popescu-v commented Oct 14, 2025

Copy link
Copy Markdown
Collaborator

For a rationale, see the discussion at #480, namely #480 (comment) and #480 (comment).


TODO Before Asking for a Review

  • Rebase your branch to the latest version of dev (or main for release PRs)
  • Make sure all CI workflows are green
  • When adding a public feature/fix: Update the Unreleased section of CHANGELOG.md (no date)
  • Self-Review: Review "Files Changed" tab and fix any problems you find
  • API Docs (only if there are changes in docstrings, rst files or samples):
    • Check the docs build without warning: see the log of the API Docs workflow
    • Check that your changes render well in HTML: download the API Docs artifact and open index.html
    • If there are any problems it is faster to iterate by building locally the API Docs

- separate construction rules into:
  - rules applied by default (`DEFAULT_CONSTRUCTION_RULES`);
  - calendar-related rules (`CALENDRICAL_CONSTRUCTION_RULES`);
- document the construction rules;
- fix the `construction_rules` parameter documentation in the Core API;
- fix the `n_features` parameter documentation the Sklearn estimator API.
- the evaluated features characterize the analysis process, not the
  model itself
- the used features characterize the model, but:
  - they are easily accessible through the `model_report_` attribute
  - they are not expected by the Scikit-learn ecosystem.
@popescu-v popescu-v self-assigned this Oct 14, 2025
@tramora

tramora commented Oct 14, 2025

Copy link
Copy Markdown
Collaborator

It is a bit confusing to mix the removal of the sklearn estimator attributes and the clarification of the variable construction rules in the same PR

Comment thread khiops/core/api.py
"GetDate",
"GetTime",
# Construction rules
DEFAULT_CONSTRUCTION_RULES = [

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.

I am surprised that the default construct rules do not include the "calendrical" ones because legacy tools based on khiops seems to assume that.
Is this a change introduced with v11 ?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Opening the Khiops 11.0.0-b.0 GUI, then "Parameters" > "Advanced predictor parameters" > "Variable construction parameters" shows which rules are enabled by default and which are not: we can see that multi-table rules (Entity and Table) are enabled by default, and that "calendrical" rules are not. In this PR we lift these to the Python API.

@tramora tramora 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.

My couple of remarks is not blocking

@popescu-v

Copy link
Copy Markdown
Collaborator Author

It is a bit confusing to mix the removal of the sklearn estimator attributes and the clarification of the variable construction rules in the same PR

These updates are recycled from PR #486 which is no longer retained as per recent discussions. In the context of that PR, the link was that, in order for the importances to be relevant, we needed to make sure all rules are disabled, and having monotable datasets indeed disables all the rules by default since the calendrical rules are not applied unless requested by the user.

In the context of the new PR, the juxtaposition seems artificial, but the idea is to opportunistically recycle the parts of the former PR #486 that are still retained.

Comment thread CHANGELOG.md
comments, and dictionary and variable block internal comments.
- (`core`) Dictionary `Rule` class and supporting API for serializing `Rule` instances.
- (`core`) New way to add a variable to a dictionary using a complete specification.
- (`core`) New API constants for rules used in automatic variable construction:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Add the removed attributes in the Removed section.

@popescu-v popescu-v Oct 14, 2025

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Ok, right. They had been added in 10.2.2.4.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Done.

@popescu-v popescu-v force-pushed the drop-importances-from-khiops-sklearn-estimator-attributes branch from bacd5c1 to dc8bbd9 Compare October 14, 2025 15:30
@popescu-v popescu-v merged commit b9f51fa into dev Oct 14, 2025
19 checks passed
@popescu-v popescu-v deleted the drop-importances-from-khiops-sklearn-estimator-attributes branch October 14, 2025 16:23
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.

3 participants