From cacb98da706d689667056952b471f1bda9b5b4e4 Mon Sep 17 00:00:00 2001 From: Popescu V <136721202+popescu-v@users.noreply.github.com> Date: Mon, 8 Jun 2026 16:39:26 +0200 Subject: [PATCH] Document external data table paths in various contexts - In `train_predictor`, `SNB_` or `Baseline_`-prefixed model dictionaries are generated. Similarly, in `train_recoder`, `R_`-prefixed model dictionaries are generated. - In `deploy_model`, these prefixed dictionaries must be used, even for external tables. - However, in `evaluate_predictor`, the original names must be used for external tables, in order to support evaluating several predictors. --- doc/multi_table_primer.rst | 21 +++++++++++++++++++++ khiops/core/api.py | 16 +++++++++++++++- 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/doc/multi_table_primer.rst b/doc/multi_table_primer.rst index 6d39bae7..ad1db04d 100644 --- a/doc/multi_table_primer.rst +++ b/doc/multi_table_primer.rst @@ -208,6 +208,27 @@ Types of secondary tables include: than the number of addresses so it may make sense to load it entirely in memory for efficiency reasons. + .. note:: In `.khiops.core.api.evaluate_predictor`, the initial name of the + external table must be used, thus supporting the evaluation of several models. + For example: + + .. code-block:: c + + additional_data_tables: { + "/City": "/path/to/Cities.csv" + } + + .. note:: In `.khiops.core.api.deploy_model`, model dictionary data paths must be used for + external tables. For example, when deploying a classification or a regression + model: + + .. code-block:: c + + additional_data_tables: { + "/SNB_City": "/path/to/Cities.csv" + } + + Note that besides the root table names the components of a data path are **table variable names** and not *table names*. For further details about the multi-table capabilities of Khiops refer to the documentation at `the Khiops site `_. diff --git a/khiops/core/api.py b/khiops/core/api.py index a1056876..4537dea3 100644 --- a/khiops/core/api.py +++ b/khiops/core/api.py @@ -712,6 +712,11 @@ def train_predictor( ): r"""Trains a model from a data table + .. note:: + For all input dictionaries, this function creates model dictionaries whose + names are prefixed with ``SNB_``. For regression models, additional + dictionaries are created and their names are prefixed with ``Baseline_``. + Parameters ---------- dictionary_file_path_or_domain : str or `.DictionaryDomain` @@ -1069,7 +1074,9 @@ def evaluate_predictor( A dictionary containing the data paths and file paths for a multi-table dictionary file. For more details see :doc:`/multi_table_primer`. - .. note:: Use the initial dictionary name in the data paths. + .. note:: + Use the initial dictionary name in the data paths. This allows to + evaluate several predictors simultaneously. main_target_value : str, default "" If this target value is specified then it guarantees the calculation of lift @@ -1165,6 +1172,10 @@ def train_recoder( The output files of this process contain a dictionary file (``.kdic``) that can be used to recode databases with the `deploy_model` function. + .. note:: + For all input dictionaries, this function creates model dictionaries whose names + are prefixed with ``R_``. + Parameters ---------- dictionary_file_path_or_domain : str or `.DictionaryDomain` @@ -1400,6 +1411,9 @@ def deploy_model( additional_data_tables : dict, optional A dictionary containing the data paths and file paths for a multi-table dictionary file. For more details see :doc:`/multi_table_primer`. + + .. note:: Use model dictionary data paths for external tables. + output_header_line : bool, default ``True`` If ``True`` writes a header line with the column names in the output table. output_field_separator : str, default "\\t"