Skip to content

Update Core API docstring and default values #412

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

popescu-v
Copy link
Collaborator

@popescu-v popescu-v commented May 28, 2025

  • replace "None" with "none" as acceptable values for discretization_method and grouping_method, following Khiops Core PR 692 use "none" rather than "None" in all khiops parameters khiops#695
  • use "MODL" as default value instead of Python None for the same two parameters
  • in train_recoder, fix documented default value of keep_initial_categorical_variables and keep_initial_numerical_variables to False, according to the function signature.

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

- replace "None" with "none" as acceptable values for
  discretization_method and grouping_method, following Khiops Core PR
  KhiopsML/khiops#695
- use "MODL" as default value instead of Python None for the same two
  parameters
- in train_recoder, fix documented default value of
  keep_initial_categorical_variables and
  keep_initial_numerical_variables to False, according to the function
  signature.
@@ -1256,13 +1244,13 @@ def train_recoder(
- "0-1 binarization": A 0's and 1's coding the interval/group id
- "conditional info": Conditional information of the interval/group
- "none": Keeps the variable as-is
discretization_method : str
Copy link
Member

Choose a reason for hiding this comment

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

I was wondering what "none" does.

if "discretization_method" in task_args and task_args["target_variable"] == "":
if task_args["discretization_method"] is None:
task_args["discretization_method"] = "MODL"

# Remove discretization method if specified for supervised analysis:
# it is always MODL
if "discretization_method" in task_args and task_args["target_variable"] != "":
del task_args["discretization_method"]
Copy link

@marcboulle marcboulle May 30, 2025

Choose a reason for hiding this comment

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

Je ne comprend pas à quoi cela sert de supprimer la méthode de discrétisation de la cas supervisé, puisque dans ce cas, cette spécification est simplement ignorée, et que cela ne pose aucun problème.

De plus, comme la ligne suivante est dans le scénario, cela ne risque-t-il pas de faire planter le moteur de templating?
DiscretizerUnsupervisedMethodName __discretization_method__

Pourrait-on supprimer ces lignes de preprocessing des arguments des tâches?

if "grouping_method" in task_args and task_args["target_variable"] == "":
if task_args["grouping_method"] is None:
task_args["grouping_method"] = "MODL"

# Remove grouping method if specified for supervised analysis: it is always MODL
if "grouping_method" in task_args and task_args["target_variable"] != "":
del task_args["grouping_method"]

Choose a reason for hiding this comment

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

Idem pour la méthode de groupement de valeur, avec la ligne suivante du scenario:
GrouperUnsupervisedMethodName __grouping_method__

@@ -797,13 +785,13 @@ def train_predictor(
group_target_value : bool, default ``False``
Allows grouping of the target variable values in classification. It can
substantially increase the training time.
discretization_method : str
discretization_method : str, default "MODL"

Choose a reason for hiding this comment

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

Pour info, l'info-bulle de ce champ dans la GUI est actuellement:
Name of the discretization method in case of unsupervised analysis.

Ne pourrait-on pas harmoniser, dans un sens ou dans un autre?

Note: détail, facultatif, à noter éventuellement pour plus tard de façon plus générale en complément de l'issue #363

grouping_method : str
Its valid values are: "MODL", "EqualWidth", "EqualFrequency" or "none".
Ignored for supervised analysis.
grouping_method : str, default "MODL"

Choose a reason for hiding this comment

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

Pour info, l'info-bulle de ce champ dans la GUI est actuellement:
Name of the value grouping method in case of unsupervised analysis.

Cf. commentaire précédent sur la méthode de discrétisation

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