Skip to content

Commit d47193a

Browse files
authored
Merge pull request #466 from KhiopsML/408-add-example-to-the-rule-specification-docstring-of-the-variable-class
Add example derivation rules
2 parents 9cec2f1 + d8a1204 commit d47193a

File tree

2 files changed

+18
-17
lines changed

2 files changed

+18
-17
lines changed

khiops/core/api.py

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -148,10 +148,10 @@ def _preprocess_arguments(args):
148148
-------
149149
tuple
150150
A 3-tuple containing:
151-
- A `~.CommandLineOptions` instance
152-
- A `~.SystemSettings` instance
153-
- A `bool` that is ``True`` if the value of the `dictionary_file_or_domain`
154-
`args` key is a `~.DictionaryDomain` instance.
151+
- A `~.CommandLineOptions` instance
152+
- A `~.SystemSettings` instance
153+
- A `bool` that is ``True`` if the value of the `dictionary_file_or_domain`
154+
`args` key is a `~.DictionaryDomain` instance.
155155
156156
.. note:: This function *mutates* the input `args` dictionary.
157157
"""
@@ -757,9 +757,9 @@ def train_predictor(
757757
Maximum number of text features to construct.
758758
text_features : str, default "words"
759759
Type of the text features. Can be either one of:
760-
- "words": sequences of non-space characters
761-
- "ngrams": sequences of bytes
762-
- "tokens": user-defined
760+
- "words": sequences of non-space characters
761+
- "ngrams": sequences of bytes
762+
- "tokens": user-defined
763763
max_trees : int, default 10
764764
Maximum number of trees to construct.
765765
max_pairs : int, default 0
@@ -788,8 +788,8 @@ def train_predictor(
788788
Maximum number of variable parts produced by preprocessing methods. If equal
789789
to 0 it is automatically calculated.
790790
Special default values for unsupervised analysis:
791-
- If ``discretization_method`` is "EqualWidth" or "EqualFrequency": 10
792-
- If ``grouping_method`` is "BasicGrouping": 10
791+
- If ``discretization_method`` is "EqualWidth" or "EqualFrequency": 10
792+
- If ``grouping_method`` is "BasicGrouping": 10
793793
... :
794794
See :ref:`core-api-common-params`.
795795
@@ -879,11 +879,9 @@ def interpret_predictor(
879879
all the variables of the predictor are considered.
880880
importance_ranking : str, default "Global"
881881
Ranking of the Shapley values produced by the interpretor. Ca be one of:
882-
883-
- "Global": predictor variables are ranked by decreasing global importance.
884-
885-
- "Individual": predictor variables are ranked by decreasing individual
886-
Shapley value.
882+
- "Global": predictor variables are ranked by decreasing global importance.
883+
- "Individual": predictor variables are ranked by decreasing individual
884+
Shapley value.
887885
... :
888886
See :ref:`core-api-common-params`.
889887
@@ -1247,8 +1245,8 @@ def train_recoder(
12471245
Maximum number of variable parts produced by preprocessing methods. If equal
12481246
to 0 it is automatically calculated.
12491247
Special default values for unsupervised analysis:
1250-
- If ``discretization_method`` is "EqualWidth" or "EqualFrequency": 10
1251-
- If ``grouping_method`` is "BasicGrouping": 10
1248+
- If ``discretization_method`` is "EqualWidth" or "EqualFrequency": 10
1249+
- If ``grouping_method`` is "BasicGrouping": 10
12521250
... :
12531251
See :ref:`core-api-common-params`.
12541252

khiops/core/dictionary.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -976,7 +976,10 @@ class Variable:
976976
structure_type : str
977977
Type complement for the ``Structure`` type. Set to "" for other types.
978978
rule : str
979-
Derivation rule. Set to "" if there is no rule associated to this variable.
979+
Derivation rule or external table reference. Set to "" if there is no
980+
rule associated to this variable. Examples:
981+
- standard rule: "Sum(Var1, Var2)"
982+
- reference rule: "[TableName]"
980983
variable_block : `VariableBlock`
981984
Block to which the variable belongs. Not set if the variable does not belong to
982985
a block.

0 commit comments

Comments
 (0)