Skip to content

khiops.core.analysis_results

Submodule of khiops.core

Classes to access Khiops JSON reports

Class Overview

Below we describe with diagrams the relationships of the classes in this modules. They are mostly compositions (has-a relations) and we omit native attributes (str, int, float, etc).

The main class of this module is AnalysisResults and it is largely a composition of sub-reports objects given by the following structure:

AnalysisResults
|- preparation_report           |
|- text_preparation_report      |->  PreparationReport
|- tree_preparation_report      |
|- bivariate_preparation_report  ->  BivariatePreparationReport
|- modeling_report               ->  ModelingReport
|- train_evaluation_report      |
|- test_evaluation_report       |->  EvaluationReport
|- evaluation_report            |

These sub-classes in turn use other tertiary classes to represent specific information pieces of each report. The dependencies for the classes PreparationReport and BivariatePreparationReport are:

PreparationReport
|- variables_statistics -> list of VariableStatistics
|- trees                -> list of Tree (only for tree_preparation_report)

BivariatePreparationReport
|- variable_pair_statistics -> list of VariablePairStatistics

VariableStatistics
|- data_grid       -> DataGrid
|- modl_histograms -> ModlHistograms

VariablePairStatistics
|- data_grid -> DataGrid

Tree
|- target_partition -> TargetPartition
|- nodes -> list of TreeNode

TargetPartition
|- partition -> list of PartInterval

DataGrid
|- dimensions -> list of DataGridDimension

ModlHistograms
|- histograms -> list of Histogram

DataGridDimension
|- partition -> list of PartInterval OR
|               list of PartValue OR
|               list of PartValueGroup

for class ModelingReport:

ModelingReport
|- trained_predictors -> list of TrainedPredictors

TrainedPredictor
|- selected_variables -> list of SelectedVariable

and for class EvaluationReport:

EvaluationReport
|- predictors_performance -> list of PredictorPerformance
|- classification_lift_curves -> list of PredictorCurve (classification only)
|- regression_rec_curves -> list of PredictorCurve (regression only)

PredictorPerformance
|- confusion_matrix -> ConfusionMatrix (classification only)

To have a complete illustration of the access to the information of all classes in this module look at their to_dict methods which write Python dictionaries in the same format as the Khiops JSON reports.

CLASS DESCRIPTION
AnalysisResults

Main class containing the information of a Khiops JSON file

PreparationReport

Univariate data preparation report: discretizations and groupings

BivariatePreparationReport

Bivariate data preparation report: 2D grid models

ModelingReport

Modeling report of all predictors created in a supervised analysis

EvaluationReport

Evaluation report for predictors

VariableStatistics

Variable information and statistics

VariablePairStatistics

Variable pair information and statistics

Tree

A decision tree feature

TargetPartition

Target partition details (for regression trees only)

TreeNode

A decision tree node

ModlHistograms

A histogram density estimation for numerical data

Histogram

A histogram

DataGrid

A piecewise constant probability density estimation

DataGridDimension

A dimension (variable) of a data grid

PartInterval

Element of a numerical interval partition in a data grid

PartValue

Element of a value partition (singletons) in a data grid

PartValueGroup

Element of a categorical partition in a data grid

TrainedPredictor

Trained predictor information

SelectedVariable

Information about a selected variable in a predictor

PredictorPerformance

A predictor's performance evaluation

ConfusionMatrix

A classifier's confusion matrix

PredictorCurve

A lift curve for a classifier or a REC curve for a regressor

FUNCTION DESCRIPTION
read_analysis_results_file

Reads a Khiops JSON report

Classes

AnalysisResults(json_data=None)

Bases: KhiopsJSONObject

Main class containing the information of a Khiops JSON file

Sub-reports not available in the JSON data are optional (set to None).

PARAMETER DESCRIPTION
json_data

A dictionary representing the data of a Khiops JSON report file. If not specified it returns an empty instance.

Note

See also the read_analysis_results_file function to obtain an instance of this class from a Khiops JSON file.

TYPE: dict DEFAULT: None

ATTRIBUTE DESCRIPTION
tool

Name of the Khiops tool that generated the report.

TYPE: str

version

Version of the Khiops tool that generated the report.

TYPE: str

short_description

Short description defined by the user.

TYPE: str

khiops_encoding

Encoding of the Khiops report file.

TYPE: str

logs

2-tuples linking each sub-task name to a list containing the warnings and errors found during the execution of that sub-task. Available only if there were errors or warnings.

TYPE: list of tuples

preparation_report

A report about the variables' discretizations and groupings.

TYPE: PreparationReport

bivariate_preparation_report

A report of the grid models created from pairs of variables. Available only when pair of variables were created in the analysis.

TYPE: (BivariatePreparationReport, optional)

modeling_report

A report describing the predictor models. Available only in supervised analysis.

TYPE: ModelingReport

train_evaluation_report

An evaluation report of the trained models on the train dataset split. Available only in supervised analysis.

TYPE: EvaluationReport

test_evaluation_report

An evaluation report of the trained models on the test dataset split. Available only in supervised analysis and when the test split was not empty.

TYPE: EvaluationReport

evaluation_report

An EvaluationReport instance for evaluations created with an explicit evaluation (either with the api.evaluate_predictor core API function or the Evaluate Predictor feature of the Khiops desktop app). Available only when the report was generated with the aforementioned features.

TYPE: EvaluationReport

See class docstring

METHOD DESCRIPTION
get_reports

Returns all available sub-reports

write_report_file

Writes a TSV report file with the object's information

to_dict

Transforms this instance to a dict with the Khiops JSON file structure

write_report

Writes the instance's TSV report into a writer object

Methods:

get_reports()

Returns all available sub-reports

RETURNS DESCRIPTION
list

All available sub-reports.

write_report_file(report_file_path)

Writes a TSV report file with the object's information

Warning

This method is deprecated since Khiops 11.0.0 and will be removed in Khiops 12. Use the to_dict method instead.

PARAMETER DESCRIPTION
report_file_path

Path of the output TSV report file.

TYPE: str

to_dict()

Transforms this instance to a dict with the Khiops JSON file structure

write_report(stream_or_writer)

Writes the instance's TSV report into a writer object

Warning

This method is deprecated since Khiops 11.0.0 and will be removed in Khiops 12. Use the to_dict method instead.

PARAMETER DESCRIPTION
stream_or_writer

Output stream or writer.

TYPE: IOBase or KhiopsOutputWriter

PreparationReport(json_data=None)

Univariate data preparation report: discretizations and groupings

The attributes related to the target variable and null model are available only in the case of a supervised learning task (classification or regression).

PARAMETER DESCRIPTION
json_data

JSON data of the preparationReport field of a Khiops JSON report file. If not specified it returns an empty instance.

TYPE: dict DEFAULT: None

ATTRIBUTE DESCRIPTION
report_type

Report type.

TYPE: "Preparation" (only possible value)

dictionary

Name of the training data table dictionary.

TYPE: str

variable_types

The different types of variables.

TYPE: list of str

variable_numbers

Number of variables for each type. Synchronized with variable_types.

TYPE: list of int

database

Path of the main training data table file.

TYPE: str

sample_percentage

Percentage of instances used in training.

TYPE: int

sampling_mode

Sampling mode used to split the train and datasets.

TYPE: str

selection_variable

Name of the variable used to select training instances.

TYPE: str

selection_value

Value of selection_variable to select training instance.

TYPE: str

constructed_variable_number

Number of constructed variables.

TYPE: int

instance_number

Number of training instances.

TYPE: int

learning_task

Name of the associated learning task. Possible values: - "Classification analysis" - "Regression analysis" - "Unsupervised analysis"

TYPE: str

target_variable

Target variable name.

TYPE: str

main_target_value

Main value of a categorical target variable.

TYPE: str

target_stats_min

Minimum of a numerical target variable.

TYPE: float

target_stats_max

Maximum of a numerical target variable.

TYPE: float

target_stats_mean

Mean of a numerical target variable.

TYPE: float

target_stats_std_dev

Standard deviation of a numerical target variable.

TYPE: float

target_stats_missing_number

Number of missing values for a numerical or categorical target variable.

TYPE: int

target_stats_sparse_missing_number

Number of missing values for a sparse block of numerical or categorical target variables.

TYPE: int

target_stats_mode

Mode of a categorical target variable.

TYPE: str

target_stats_mode_frequency

Mode frequency of a categorical target variable.

TYPE: int

target_values

Values of a categorical target variable.

TYPE: list of str

target_value_frequencies

Frequencies for each target value. Synchronized with target_values.

TYPE: list of int

evaluated_variable_number

Number of variables analyzed.

TYPE: int

informative_variable_number

Supervised analysis only: Number of informative variables.

TYPE: int

selected_variable_number

Number of selected variables.

TYPE: int

native_variable_number

Number of native variables.

TYPE: int

max_constructed_variables

Maximum number of constructed variable specified for the analysis.

TYPE: int

max_text_features

Maximum number of text features specified for the analysis.

TYPE: int

max_trees

Maximum number of constructed trees specified for the analysis.

TYPE: int

max_pairs

Maximum number of constructed variables pairs specified for the analysis.

TYPE: int

discretization

Type of discretization method used.

TYPE: str

value_grouping

Type of grouping method used.

TYPE: str

null_model_construction_cost

Coding length of the null construction model.

TYPE: float

null_model_preparation_cost

Coding length of the null preparation model.

TYPE: float

null_model_data_cost

Coding length of the data given the null model.

TYPE: float

variables_statistics

Variable statistics for each variable analyzed.

TYPE: list of VariableStatistics

trees

Tree details for each tree built.

TYPE: list of Tree

See class docstring

METHOD DESCRIPTION
get_variable_names

Returns the names of the variables analyzed during the preparation

get_variable_statistics

Returns the statistics of the specified variable

get_tree

Returns the tree with the specified name

to_dict

Transforms this instance to a dict with the Khiops JSON file structure

write_report

Writes the instance's TSV report into a writer object

Methods:

get_variable_names()

Returns the names of the variables analyzed during the preparation

RETURNS DESCRIPTION
list of str

The names of the variables analyzed during the preparation.

get_variable_statistics(variable_name)

Returns the statistics of the specified variable

PARAMETER DESCRIPTION
variable_name

Name of the variable.

TYPE: str

RETURNS DESCRIPTION
VariableStatistics

The statistics of the specified variable.

RAISES DESCRIPTION
KeyError

If no variable with the specified names exist.

get_tree(tree_name)

Returns the tree with the specified name

PARAMETER DESCRIPTION
tree_name

Name of the tree.

TYPE: str

RETURNS DESCRIPTION
Tree

The tree which has the specified name.

RAISES DESCRIPTION
KeyError

If no tree with the specified name exists.

to_dict()

Transforms this instance to a dict with the Khiops JSON file structure

write_report(writer)

Writes the instance's TSV report into a writer object

Warning

This method is deprecated since Khiops 11.0.0 and will be removed in Khiops 12. Use the to_dict method instead.

PARAMETER DESCRIPTION
writer

Output writer.

TYPE: KhiopsOutputWriter

BivariatePreparationReport(json_data=None)

Bivariate data preparation report: 2D grid models

The attributes related to the target variable and null model are available only in the case of a supervised learning task (only classification in the bivariate case).

PARAMETER DESCRIPTION
json_data

JSON data of the bivariatePreparationReport field of a Khiops JSON report file. If not specified it returns an empty instance.

TYPE: dict DEFAULT: None

ATTRIBUTE DESCRIPTION
report_type

Report type.

TYPE: "BivariatePreparation" (only possible value)

dictionary

Name of the training data table dictionary.

TYPE: str

variable_types

The different types of variables.

TYPE: list of str

variable_numbers

The number of variables for each type in variables_types (synchronized lists).

TYPE: list of int

database

Path of the main training data table file.

TYPE: str

sample_percentage

Percentage of instances used in training.

TYPE: int

sampling_mode

Sampling mode used to split the train and datasets.

TYPE: str

selection_variable

Variable used to select instances for training.

TYPE: str

selection_value

Value of selection_variable to select instances for training.

TYPE: str

instance_number

Number of training instances.

TYPE: int

learning_task

Name of the associated learning task. Possible values: - "Classification analysis" - "Regression analysis" - "Unsupervised analysis"

TYPE: str

target_variable

Target variable name in supervised analysis.

TYPE: str

main_target_value

Main modality of the target variable in supervised case.

TYPE: str

target_stats_mode

Mode of a categorical target variable.

TYPE: str

target_stats_mode_frequency

Mode frequency of a categorical target variable.

TYPE: int

target_values

Values of a categorical target variable.

TYPE: list of str

target_value_frequencies

Frequencies for each value in target_values (synchronized lists).

TYPE: list of int

evaluated_pair_number

Number of variable pairs evaluated.

TYPE: int

selected_pair_number

Number of variable pairs selected.

TYPE: int

informative_pair_number

Number of informative variable pairs. A pair is considered informative if its level is greater than the sum of its components' levels.

TYPE: int

variable_pair_statistics

Statistics for each analyzed pair of variables.

TYPE: list of VariablePairStatistics

See class docstring

METHOD DESCRIPTION
get_variable_pair_names

Returns the pairs of variable names available on this report

get_variable_pair_statistics

Returns the statistics of the specified pair of variables

to_dict

Transforms this instance to a dict with the Khiops JSON file structure

write_report

Writes the instance's TSV report into a writer object

Methods:

get_variable_pair_names()

Returns the pairs of variable names available on this report

RETURNS DESCRIPTION
list of tuple

The pair of variable names available on this report

get_variable_pair_statistics(variable_name_1, variable_name_2)

Returns the statistics of the specified pair of variables

Note

The variable names can be given in any order.

PARAMETER DESCRIPTION
variable_name_1

Name of the first variable.

TYPE: str

variable_name_2

Name of the second variable.

TYPE: str

RETURNS DESCRIPTION
VariablePairStatistics

The statistics of the specified pair of variables.

RAISES DESCRIPTION
KeyError

If no pair with the specified names exist.

to_dict()

Transforms this instance to a dict with the Khiops JSON file structure

write_report(writer)

Writes the instance's TSV report into a writer object

Warning

This method is deprecated since Khiops 11.0.0 and will be removed in Khiops 12. Use the to_dict method instead.

PARAMETER DESCRIPTION
writer

Output writer.

TYPE: KhiopsOutputWriter

ModelingReport(json_data=None)

Modeling report of all predictors created in a supervised analysis

PARAMETER DESCRIPTION
json_data

JSON data of the modelingReport field of Khiops JSON report file. If not specified it returns an empty instance.

TYPE: dict DEFAULT: None

ATTRIBUTE DESCRIPTION
report_type

Report type.

TYPE: "Modeling" (only possible value)

dictionary

Name of the training data table dictionary.

TYPE: str

database

Path of the main training data table file.

TYPE: str

sample_percentage

Percentage of instances used in training.

TYPE: int

sampling_mode

Sampling mode used to split the train and datasets.

TYPE: 'Include sample' or 'Exclude sample'

selection_variable

Variable used to select instances for training.

TYPE: str

selection_value

Value of selection_variable to select instances for training.

TYPE: str

learning_task

Name of the associated learning task.

TYPE: 'Classification analysis' or 'Regression analysis'

target_variable

Name of the target variable.

TYPE: str

main_target_value

Main value of the target variable.

TYPE: str

trained_predictors

The predictors trained in the task.

TYPE: list of TrainedPredictor

See class docstring

METHOD DESCRIPTION
get_predictor

Returns the specified predictor

get_snb_predictor

Returns the Selective Naive Bayes predictor

get_predictor_names

Returns the names of the available predictor reports

to_dict

Transforms this instance to a dict with the Khiops JSON file structure

write_report

Writes the instance's TSV report into a writer object

Methods:

get_predictor(predictor_name)

Returns the specified predictor

PARAMETER DESCRIPTION
predictor_name

Name of the predictor.

TYPE: str

RETURNS DESCRIPTION
TrainedPredictor

The predictor object for the specified name.

RAISES DESCRIPTION
KeyError

If there is no predictor with the specified name.

get_snb_predictor()

Returns the Selective Naive Bayes predictor

RETURNS DESCRIPTION
TrainedPredictor

The predictor object for "Selective Naive Bayes".

RAISES DESCRIPTION
KeyError

If there is no predictor named "Selective Naive Bayes".

get_predictor_names()

Returns the names of the available predictor reports

RETURNS DESCRIPTION
list of str

The names of the available predictor reports.

to_dict()

Transforms this instance to a dict with the Khiops JSON file structure

write_report(writer)

Writes the instance's TSV report into a writer object

Warning

This method is deprecated since Khiops 11.0.0 and will be removed in Khiops 12. Use the to_dict method instead.

PARAMETER DESCRIPTION
writer

Output writer.

TYPE: KhiopsOutputWriter

EvaluationReport(json_data=None)

Evaluation report for predictors

PARAMETER DESCRIPTION
json_data

JSON data of the fields: - trainEvaluationReport: predictor training - testEvaluationReport: predictor training & non-empty test split - evaluationReport: explicit evaluation

The first two fields are set when doing a supervised analysis: either with the "Train Model" feature of the Khiops app or the api.train_predictor function of the Khiops Python core API. The third field is set when doing an explicit evaluation: either with the Evaluate Predictor feature of the Khiops app or the api.evaluate_predictor function of the Khiops Python core API.

If not specified it returns an empty instance.

TYPE: dict DEFAULT: None

ATTRIBUTE DESCRIPTION
report_type

Report type.

TYPE: "Evaluation" (only possible value)

evaluation_type

Evaluation type. The value "" is set when the evaluation was explicit.

TYPE: (Train, Test or '')

dictionary

Name of the training data table dictionary.

TYPE: str

database

Path of the main training data table file.

TYPE: str

sample_percentage

Percentage of instances used in training.

TYPE: int

sampling_mode

Sampling mode used to split the train and datasets.

TYPE: str

selection_variable

Variable used to select instances for training.

TYPE: str

selection_value

Value of selection_variable to select instances for training.

TYPE: str

instance_number

Number of training instances.

TYPE: int

learning_task

Type of learning task.

TYPE: 'Classification analysis' or 'Regression analysis'

target_variable

Name of the target variable.

TYPE: str

main_target_value

Main value of the target variable.

TYPE: str

predictors_performance

Performance metrics for each predictor.

TYPE: list of PredictorPerformance

regression_rec_curves

REC curves for each regressor.

TYPE: list of PredictorCurve

classification_target_values

Target variable values for which a classifier lift curve was evaluated.

TYPE: list of str

classification_lift_curves

Lift curves for each target value in classification_target_values. The lift curve for the optimal predictor is prepended to those of the target values.

TYPE: list of PredictorCurve

See class docstring

METHOD DESCRIPTION
get_predictor_names

Returns the names of the available predictors in the report

get_predictor_performance

Returns the performance metrics for the specified predictor

get_snb_performance

Returns the performance metrics for the Selective Naive Bayes predictor

get_regressor_rec_curve

Returns the REC curve for the specified regressor

get_snb_rec_curve

Returns the REC curve for the Selective Naive Bayes regressor

get_classifier_lift_curve

Returns the lift curve for the specified classifier and target value

get_snb_lift_curve

Returns lift curve for the Selective Naive Bayes clf. given a target value

to_dict

Transforms this instance to a dict with the Khiops JSON file structure

write_report

Writes the instance's TSV report into a writer object

Methods:

get_predictor_names()

Returns the names of the available predictors in the report

RETURNS DESCRIPTION
list of str

The names of the available predictors.

get_predictor_performance(predictor_name)

Returns the performance metrics for the specified predictor

PARAMETER DESCRIPTION
predictor_name

A predictor name.

TYPE: str

RETURNS DESCRIPTION
PredictorPerformance

The performance metrics for the specified predictor.

RAISES DESCRIPTION
KeyError

If no predictor with the specified name exists.

get_snb_performance()

Returns the performance metrics for the Selective Naive Bayes predictor

RETURNS DESCRIPTION
PredictorPerformance

The performance metrics for the Selective Naive Bayes predictor.

RAISES DESCRIPTION
ValueError

If the Selective Naive Bayes information is not available in the report.

get_regressor_rec_curve(regressor_name)

Returns the REC curve for the specified regressor

PARAMETER DESCRIPTION
regressor_name

Name of a regressor.

TYPE: str

RETURNS DESCRIPTION
PredictorCurve

The REC curve for the specified regressor.

RAISES DESCRIPTION
ValueError

If no regressor curves available. (

KeyError

If no regressor with the specified name exists.

get_snb_rec_curve()

Returns the REC curve for the Selective Naive Bayes regressor

RETURNS DESCRIPTION
PredictorCurve

The REC curve for the Selective Naive Bayes regressor.

RAISES DESCRIPTION
ValueError

If the Selective Naive Bayes information is not available in the report.

get_classifier_lift_curve(classifier_name, target_value)

Returns the lift curve for the specified classifier and target value

PARAMETER DESCRIPTION
classifier_name

A name of a classifier.

TYPE: str

target_value

A specific value of the target variable.

TYPE: str

RETURNS DESCRIPTION
PredictorCurve

The lift curve for the specified classifier and target value.

RAISES DESCRIPTION
KeyError

If no classifier with the specified exists or no target value with the specified name exists.

get_snb_lift_curve(target_value)

Returns lift curve for the Selective Naive Bayes clf. given a target value

PARAMETER DESCRIPTION
target_value

A specific value of the target variable.

TYPE: str

RETURNS DESCRIPTION
PredictorCurve

The lift curve of the Selective Naive Bayes classifier for the specified target value.

RAISES DESCRIPTION
ValueError

If the Selective Naive Bayes classifier information is not available.

KeyError

If no target value with the specified name exists.

to_dict()

Transforms this instance to a dict with the Khiops JSON file structure

write_report(writer)

Writes the instance's TSV report into a writer object

Warning

This method is deprecated since Khiops 11.0.0 and will be removed in Khiops 12. Use the to_dict method instead.

PARAMETER DESCRIPTION
writer

Output writer object.

TYPE: KhiopsOutputWriter

VariableStatistics(json_data=None)

Variable information and statistics

Note

The statistics in this class are for both numerical and categorical data.

PARAMETER DESCRIPTION
json_data

JSON data of an element of the list found at the variablesStatistics field within the preparationReport field of a Khiops JSON report file. If not specified it returns an empty instance.

Note

The data_grid field is considered a "detail" and is not initialized in the constructor. Instead, it is initialized explicitly via the init_details method. This allows to make partial initializations for large reports. If not specified it returns an empty instance.

TYPE: dict DEFAULT: None

ATTRIBUTE DESCRIPTION
rank

Variable rank with respect to its level. Lower Rank = Higher Level.

TYPE: str

name

Variable name.

TYPE: str

type

Variable type. There are only two valid values for a prepared variable : - "Numerical" - "Categorical"

TYPE: str

level

Variable predictive importance.

TYPE: float

target_part_number
  • In regression: Number of the target intervals
  • In classification with target grouping: Number of target groups

TYPE: int

part_number

Number of parts of the variable partition.

TYPE: int

value_number

Number of distinct values of the variable.

TYPE: int

min

Minimum value of the variable.

TYPE: float

max

Maximum value of the variable.

TYPE: float

mean

Mean value of the variable.

TYPE: float

std_dev

Standard deviation of the variable.

TYPE: float

missing_number

Number of missing values of the variable.

TYPE: int

sparse_missing_number

Number of sparse missing values of the variable.

TYPE: int

mode

Most common value.

TYPE: float

mode_frequency

Frequency of the most common value.

TYPE: int

input_values

Different values taken by the variable. If there are too many values only the more frequent will be available.

TYPE: list of str

input_value_frequencies

The frequencies for each input value. Synchronized with input_values.

TYPE: list of int

construction_cost

Construction cost of the variable. More complex variables cost more.

TYPE: float

preparation_cost

Partition model cost. More complex partitions cost more.

TYPE: float

data_cost

Negative log-likelihood of the variable given a preparation model and a construction model.

TYPE: float

derivation_rule

If the variable is not native it is Khiops dictionary function to derive it. Otherwise is set to None.

TYPE: str

data_grid

A density estimation of the partitioned variable with respect to the target.

TYPE: DataGrid

modl_histograms

MODL optimal histograms for for numerical variables. Only for unsupervised analysis.

TYPE: ModlHistograms

See class docstring

METHOD DESCRIPTION
init_details

Initializes the details' attributes from a Python JSON object

is_detailed

Returns True if the report contains any detailed information

to_dict

Transforms this instance to a dict with the Khiops JSON file structure

write_report_header_line

Writes the header line of a TSV report into a writer object

write_report_line

Writes a line of the TSV report into a writer object

write_report_details

Writes the details' attributes into a writer object

Methods:

init_details(json_data=None)

Initializes the details' attributes from a Python JSON object

PARAMETER DESCRIPTION
json_data

JSON data of an element of the list found at the variablesDetailedStatistics field within the preparationReport field of a Khiops JSON report file. If not specified it leaves the object as-is.

TYPE: dict DEFAULT: None

is_detailed()

Returns True if the report contains any detailed information

RETURNS DESCRIPTION
bool

True if the report contains any detailed information.

to_dict(details=False)

Transforms this instance to a dict with the Khiops JSON file structure

write_report_header_line(writer)

Writes the header line of a TSV report into a writer object

The header is the same for all variable types.

Warning

This method is deprecated since Khiops 11.0.0 and will be removed in Khiops 12. Use the to_dict method instead.

PARAMETER DESCRIPTION
writer

Output writer.

TYPE: KhiopsOutputWriter

write_report_line(writer)

Writes a line of the TSV report into a writer object

Warning

This method is deprecated since Khiops 11.0.0 and will be removed in Khiops 12. Use the to_dict method instead.

PARAMETER DESCRIPTION
writer

Output writer.

TYPE: KhiopsOutputWriter

write_report_details(writer)

Writes the details' attributes into a writer object

Warning

This method is deprecated since Khiops 11.0.0 and will be removed in Khiops 12. Use the to_dict method instead.

PARAMETER DESCRIPTION
writer

Output writer.

TYPE: KhiopsOutputWriter

VariablePairStatistics(json_data=None)

Variable pair information and statistics

PARAMETER DESCRIPTION
json_data

JSON data of an element of the list found at the variablesPairStatistics field within the bivariatePreparationReport field of a Khiops JSON report file. If not specified it returns an empty instance.

Note

The data_grid field is considered as "detail" and is not initialized in the constructor. Instead, it is initialized explicitly via the init_details method. This allows to make partial initializations for large reports. If not specified it returns an empty instance.

TYPE: dict DEFAULT: None

ATTRIBUTE DESCRIPTION
rank

Variable rank with respect to its level. Lower Rank = Higher Level.

TYPE: str

name1

Name of the pair's first variable.

TYPE: str

name2

Name of the pair's second variable.

TYPE: str

level

Predictive importance of the pair.

TYPE: float

level1

Predictive importance of the first variable.

TYPE: float

level2

Predictive importance of the second variable.

TYPE: float

delta_level

Difference between the pair's level and the sum of those of its components (delta_level = level - level1 - level2).

TYPE: float

variable_number

Number of active variables in the pair: - 0 means that there is no information in any of the variables - 1 means that the pair information reduces to that of any of its components - 2 means that the two variables are jointly informative

TYPE: int

part_number1

Number of parts of the first variable partition.

TYPE: int

part_number2

Number of parts of the second variable partition.

TYPE: int

cell_number

Number of cells generated of the pair grid.

TYPE: int

construction_cost

Advanced: Construction cost of the variable. More complex variables cost more.

TYPE: float

preparation_cost

Advanced: Partition model cost. More complex partitions cost more.

TYPE: float

data_cost

Advanced: Negative log-likelihood of the variable given a preparation model and a construction model.

TYPE: float

data_grid

A density estimation of the partitioned pair of variable with respect to the target.

TYPE: DataGrid

See class docstring

METHOD DESCRIPTION
init_details

Initializes the details' attributes from a Python JSON object

is_detailed

Returns True if the report contains any detailed information

to_dict

Transforms this instance to a dict with the Khiops JSON file structure

write_report_header_line

Writes the header line of a TSV report into a writer object

write_report_line

Writes a line of the TSV report into a writer object

write_report_details

Writes the details' attributes into a writer object

Methods:

init_details(json_data=None)

Initializes the details' attributes from a Python JSON object

PARAMETER DESCRIPTION
json_data

JSON data of an element of the list found at the variablesPairsDetailedStatistics field within the bivariatePreparationReport field of a Khiops JSON report file. If not specified it leaves the object as-is.

TYPE: dict DEFAULT: None

is_detailed()

Returns True if the report contains any detailed information

RETURNS DESCRIPTION
bool

True if the report contains any detailed information.

to_dict(details=False)

Transforms this instance to a dict with the Khiops JSON file structure

write_report_header_line(writer)

Writes the header line of a TSV report into a writer object

The header is the same for all variable types.

Warning

This method is deprecated since Khiops 11.0.0 and will be removed in Khiops 12. Use the to_dict method instead.

PARAMETER DESCRIPTION
writer

Output writer.

TYPE: KhiopsOutputWriter

write_report_line(writer)

Writes a line of the TSV report into a writer object

Warning

This method is deprecated since Khiops 11.0.0 and will be removed in Khiops 12. Use the to_dict method instead.

PARAMETER DESCRIPTION
writer

Output writer.

TYPE: KhiopsOutputWriter

write_report_details(writer)

Writes the details' attributes into a writer object

Warning

This method is deprecated since Khiops 11.0.0 and will be removed in Khiops 12. Use the to_dict method instead.

PARAMETER DESCRIPTION
writer

Output writer.

TYPE: KhiopsOutputWriter

Tree(json_data=None)

A decision tree feature

PARAMETER DESCRIPTION
json_data

JSON data of a value associated to the rank key in the object found at the treeDetails field within the treePreparationReport field of a Khiops JSON report file. If not specified, it returns an empty instance.

TYPE: dict DEFAULT: None

ATTRIBUTE DESCRIPTION
name

Name of the tree.

TYPE: str

variable_number

Number of variables in the tree.

TYPE: int

depth

Depth of the tree.

TYPE: int

target_partition

Summary of the target partition. For regression only.

TYPE: TargetPartition

nodes

Nodes of the tree.

TYPE: list of TreeNode

"See class docstring

METHOD DESCRIPTION
to_dict

Transforms this instance to a dict with the Khiops JSON file structure

Methods:

to_dict()

Transforms this instance to a dict with the Khiops JSON file structure

TargetPartition(json_data=None)

Target partition details (for regression trees only)

PARAMETER DESCRIPTION
json_data

JSON data of the targetPartition field of the treeDetails field of the treePreparationReport field of a Khiops JSON report file. If not specified it returns an empty instance.

TYPE: dict DEFAULT: None

ATTRIBUTE DESCRIPTION
variable

Variable name.

TYPE: str

type

Variable type.

TYPE: "Numerical" (only possible value)

partition_type

Partition type.

TYPE: "Intervals" (only possible value)

partition

The dimension parts. The list objects are of type PartInterval, as partition_type is "Intervals"

TYPE: list

frequencies

Frequencies of the intervals in the target partition.

TYPE: list of int

See class docstring

METHOD DESCRIPTION
to_dict

Transforms this instance to a dict with the Khiops JSON file structure

Methods:

to_dict()

Transforms this instance to a dict with the Khiops JSON file structure

TreeNode(json_data=None, parent_id=None)

A decision tree node

PARAMETER DESCRIPTION
json_data

JSON data of either:

  • the treeNodes field of the treeDetails field of the treePreparationReport field of a Khiops JSON report file, or
  • an element of the childNodes field of the treeNodes field of the treeDetails field of the treePreparationReport field of a Khiops JSON report file.

If not specified it returns an empty instance

TYPE: dict DEFAULT: None

parent_id

Identifier of the parent TreeNode instance. Not set for "root" nodes.

TYPE: str DEFAULT: None

ATTRIBUTE DESCRIPTION
id

Identifier of the TreeNode instance.

TYPE: str

parent_id

Value of the id field of another TreeNode instance. Not set for "root" nodes.

TYPE: (str, optional)

variable

Name of the tree variable.

TYPE: str

type

Khiops type of the tree variable.

TYPE: str

partition

The tree variable partition.

TYPE: list

default_group_index

The index of the default variable group.

TYPE: int

target_values

Values of a categorical tree target variable.

TYPE: list of str

target_value_frequencies

Frequencies of each tree target value. Synchronized with target_values.

TYPE: list of int

See class docstring

METHOD DESCRIPTION
to_dict

Transforms this instance to a dict with the Khiops JSON file structure

Methods:

to_dict()

Transforms this instance to a dict with the Khiops JSON file structure

ModlHistograms(json_data=None)

A histogram density estimation for numerical data

A MODL histogram is a regularized piecewise-constant estimation of the probability density for numerical data. It has various refinement levels to ease exploratory analysis tasks.

PARAMETER DESCRIPTION
json_data

JSON data at a modlHistograms field of an element of the list found at the variablesDetailedStatistics field within the preparationReport field of a Khiops JSON report file. If not specified, it returns an empty instance.

TYPE: dict DEFAULT: None

ATTRIBUTE DESCRIPTION
histogram_number

Number of available histograms.

TYPE: int

interpretable_histogram_number

Number of interpretable histograms. Can be equal to either histogram_number or histogram_number - 1.

TYPE: int

truncation_epsilon

Truncation epsilon used by the truncation heuristic implemented in Khiops. Equals 0 if no truncation is detected in the input data.

TYPE: float

removed_singular_interval_number

Number of singular intervals removed from the finest-grained histogram to obtain the first interpretable histogram.

TYPE: int

granularities

Histogram granularities, sorted in increasing order. Synchronized with histograms.

TYPE: list of int

interval_numbers

Histogram interval numbers, sorted in increasing order. Synchronized with histograms.

TYPE: list of int

peak_interval_numbers

Histogram peak interval numbers, sorted in increasing order. Synchronized with histograms.

TYPE: list of int

spike_interval_numbers

Histogram spike interval numbers, sorted in increasing order. Synchronized with histograms.

TYPE: list of int

empty_interval_numbers

Histogram empty interval numbers, sorted in increasing order. Synchronized with histograms.

TYPE: list of int

levels

List of histogram levels, sorted in increasing order. Synchronized with histograms.

TYPE: list of float

information_rates

Histogram information rates, sorted in increasing order. Between 0 and 100 for interpretable histograms. Synchronized with histograms.

TYPE: list of float

histograms

The MODL histograms.

TYPE: list of Histogram

See class docstring

METHOD DESCRIPTION
to_dict

Transforms this instance to a dict with the Khiops JSON file structure

Methods:

to_dict()

Transforms this instance to a dict with the Khiops JSON file structure

Histogram(json_data=None)

A histogram

Represents one of the refinement levels of a ModlHistograms object.

PARAMETER DESCRIPTION
json_data

JSON data of an element at the histograms field of a modlHistograms field of an element of the list found at the variablesDetailedStatistics field within the preparationReport field of a Khiops JSON report file. If not specified it returns an empty instance.

TYPE: dict DEFAULT: None

ATTRIBUTE DESCRIPTION
bounds

Interval bounds.

TYPE: list of float

frequencies

Interval frequencies.

TYPE: list of int

See class docstring

METHOD DESCRIPTION
to_dict

Transforms this instance to a dict with the Khiops JSON file structure

Methods:

to_dict()

Transforms this instance to a dict with the Khiops JSON file structure

DataGrid(json_data=None)

A piecewise constant probability density estimation

A data grid represents one or many variables referred to as "dimensions" to differentiate them from the original data variables. Each dimension can be partitioned by:

  • Intervals for numerical variables
  • Values (singletons) / Value groups for categorical variables

The Cartesian product of the unidimensional partitions provides a multivariate partition of cells whose frequencies allow to estimate the multivariate probability density.

In the univariate case, the data grid is simply an histogram. In the case of multiple variables, the data grid may be supervised or not. If supervised, the target variable is the last one, and the data grid represents the conditional density estimator of the source variable with respect to the target. Otherwise, it represents a joint density estimator.

In case of an unsupervised data grid, the cells are described by their index on the variable partitions, together with their frequencies. For a supervised data grid, the cells are described by their index on the input variables partitions, and a vector of target frequencies is associated to each cell.

PARAMETER DESCRIPTION
json_data

JSON data at a dataGrid field of an element of the list found at the variablesDetailedStatistics field within the preparationReport field of a Khiops JSON report file. If not specified it returns an empty instance.

TYPE: dict DEFAULT: None

ATTRIBUTE DESCRIPTION
is_supervised

True if the data grid is supervised (there is a target).

TYPE: bool

dimensions

The dimensions of the data grid.

TYPE: list of DataGridDimension

frequencies

Unsupervised only: Frequencies for each part.

TYPE: list of int

part_interests

Supervised univariate only: Prediction interests for each part of the input dimension. Synchronized with dimensions[0].partition.

TYPE: list of float

part_target_frequencies

Supervised univariate only: List of frequencies per target value for each part of the input dimension. Synchronized with dimensions[0].partition.

TYPE: list

cell_ids

Multivariate only: Unique identifiers of the grid's cells.

TYPE: list of str

cell_part_indexes

Multivariate only: List of dimension indexes defining each cell. Synchronized with cell_ids.

TYPE: list

cell_frequencies

Unsupervised multivariate only: Frequencies for each cell. Synchronized with cell_ids.

TYPE: list of int

cell_target_frequencies

Supervised multivariate only: List of frequencies per target value for each cell. Synchronized with cell_ids.

TYPE: list

See class docstring

METHOD DESCRIPTION
to_dict

Transforms this instance to a dict with the Khiops JSON file structure

write_report

Writes the instance's TSV report into a writer object

Methods:

to_dict()

Transforms this instance to a dict with the Khiops JSON file structure

write_report(writer)

Writes the instance's TSV report into a writer object

Warning

This method is deprecated since Khiops 11.0.0 and will be removed in Khiops 12. Use the to_dict method instead.

PARAMETER DESCRIPTION
writer

Output writer.

TYPE: KhiopsOutputWriter

DataGridDimension(json_data=None)

A dimension (variable) of a data grid

PARAMETER DESCRIPTION
json_data

JSON data of an element at the dimensions field of a dataGrid field of an element of the list found at the variablesDetailedStatistics field within the preparationReport field of a Khiops JSON report file. If not specified it returns an empty instance.

TYPE: dict DEFAULT: None

ATTRIBUTE DESCRIPTION
variable

Variable name

TYPE: str

type

Variable type.

TYPE: Numerical or Categorical

partition_type

Partition type.

TYPE: (Intervals, Values or 'Value groups')

partition

The dimension parts. The list objects are of type: - PartInterval: If partition type is "Intervals" - PartValue: If partition_type is "Values" - PartValueGroup: If partition_type is "Value groups"

TYPE: list

See class docstring

METHOD DESCRIPTION
to_dict

Transforms this instance to a dict with the Khiops JSON file structure

write_report

Writes the instance's TSV report into a writer object

Methods:

to_dict()

Transforms this instance to a dict with the Khiops JSON file structure

write_report(writer)

Writes the instance's TSV report into a writer object

Warning

This method is deprecated since Khiops 11.0.0 and will be removed in Khiops 12. Use the to_dict method instead.

PARAMETER DESCRIPTION
writer

Output writer.

TYPE: KhiopsOutputWriter

PartInterval(json_data=None)

Element of a numerical interval partition in a data grid

PARAMETER DESCRIPTION
json_data

JSON data of the partition field of a dataGrid field of an element of the list found at the variablesDetailedStatistics field within the preparationReport field of a Khiops JSON report file. If not specified it returns an empty instance.

TYPE: list DEFAULT: None

ATTRIBUTE DESCRIPTION
lower_bound

The lower bound of the interval.

TYPE: float

upper_bound

The upper bound of the interval.

TYPE: float

is_missing

True if it is the missing values part (bounds are None).

TYPE: bool

is_left_open

True if the interval has no minimum. lower_bound still contains the minimum value seen on data.

TYPE: bool

is_right_open

True if the interval has no maximum. upper_bound still contains the minimum value seen on data.

TYPE: bool

See class docstring

METHOD DESCRIPTION
__str__

Returns a human readable string representation

part_type

Type of this part

to_dict

Transforms this instance to a dict with the Khiops JSON file structure

write_report_line

Writes a line of the TSV report into a writer object

Methods:

__str__()

Returns a human readable string representation

part_type()

Type of this part

RETURNS DESCRIPTION
str

Only possible value: "Interval".

to_dict()

Transforms this instance to a dict with the Khiops JSON file structure

write_report_line(writer)

Writes a line of the TSV report into a writer object

Warning

This method is deprecated since Khiops 11.0.0 and will be removed in Khiops 12. Use the to_dict method instead.

PARAMETER DESCRIPTION
writer

Output writer.

TYPE: KhiopsOutputWriter

PartValue(json_data=None)

Element of a value partition (singletons) in a data grid

PARAMETER DESCRIPTION
json_data

The value contained in this singleton part. If not specified it returns an empty object.

TYPE: str DEFAULT: None

ATTRIBUTE DESCRIPTION
value

A representation of the value defining the singleton.

TYPE: str

See class docstring

METHOD DESCRIPTION
__str__

Returns a readable string representation

part_type

Type of the instance

to_dict

Transforms this instance to a dict with the Khiops JSON file structure

write_report_line

Writes a line of the TSV report into a writer object

Methods:

__str__()

Returns a readable string representation

part_type()

Type of the instance

RETURNS DESCRIPTION
str

Only possible value: "Value".

to_dict()

Transforms this instance to a dict with the Khiops JSON file structure

write_report_line(writer)

Writes a line of the TSV report into a writer object

Warning

This method is deprecated since Khiops 11.0.0 and will be removed in Khiops 12. Use the to_dict method instead.

PARAMETER DESCRIPTION
writer

Output writer.

TYPE: KhiopsOutputWriter

PartValueGroup(json_data=None)

Element of a categorical partition in a data grid

PARAMETER DESCRIPTION
json_data

The list of values of the group. If not specified it returns an empty instance.

TYPE: list of str DEFAULT: None

ATTRIBUTE DESCRIPTION
values

The group's values.

TYPE: list of str

is_default_part

True if this part is dedicated to all unknown values.

TYPE: bool

See class docstring

METHOD DESCRIPTION
__str__

Returns a human readable string representation

part_type

Type of the instance

to_dict

Transforms this instance to a dict with the Khiops JSON file structure

write_report_line

Writes a line of the TSV report into a writer object

Methods:

__str__()

Returns a human readable string representation

part_type()

Type of the instance

RETURNS DESCRIPTION
str

Only possible value: "Value group".

to_dict()

Transforms this instance to a dict with the Khiops JSON file structure

write_report_line(writer)

Writes a line of the TSV report into a writer object

Warning

This method is deprecated since Khiops 11.0.0 and will be removed in Khiops 12. Use the to_dict method instead.

PARAMETER DESCRIPTION
writer

Output writer.

TYPE: KhiopsOutputWriter

TrainedPredictor(json_data=None)

Trained predictor information

PARAMETER DESCRIPTION
json_data

JSON data of an element of the list found at the trainedPredictors field within the modelingReport field of a Khiops JSON report file. If not specified it returns an empty instance.

Note

The selected_variables field is considered a "detail" and is not initialized in the constructor. Instead, it is initialized explicitly via the init_details method. This allows to make partial initializations for large reports.

TYPE: dict DEFAULT: None

ATTRIBUTE DESCRIPTION
family

Predictor family name. Valid values are found in the predictor_families class variable. They are:

  • "Baseline": for regression only,
  • "Selective Naive Bayes": in all other cases.

TYPE: str

type

Predictor type. Valid values are found in the predictor_types class attribute.

TYPE: Classifier or Regressor

name

Human readable predictor name.

TYPE: str

variable_number

Number of variables used by the predictor.

TYPE: int

selected_variables

Variables used by the predictor. Only for type "Selective Naive Bayes".

TYPE: list of SelectedVariable

See class docstring

METHOD DESCRIPTION
init_details

Initializes the details' attributes from a Python JSON object

is_detailed

Returns True if the report contains any detailed information

to_dict

Transforms this instance to a dict with the Khiops JSON file structure

write_report_header_line

Writes the header line of a TSV report into a writer object

write_report_line

Writes a line of the TSV report into a writer object

write_report_details

Writes the details of the TSV report into a writer object

Methods:

init_details(json_data=None)

Initializes the details' attributes from a Python JSON object

PARAMETER DESCRIPTION
json_data

JSON data of the dictionary found at the trainedPredictorsDetails field within the modelingReport field of a Khiops JSON report file. If not specified it leaves the object as-is.

TYPE: dict DEFAULT: None

is_detailed()

Returns True if the report contains any detailed information

RETURNS DESCRIPTION
bool

True if the report contains any detailed information.

to_dict(details=False)

Transforms this instance to a dict with the Khiops JSON file structure

write_report_header_line(writer)

Writes the header line of a TSV report into a writer object

Warning

This method is deprecated since Khiops 11.0.0 and will be removed in Khiops 12. Use the to_dict method instead.

The header is the same for all variable types.

PARAMETER DESCRIPTION
writer

Output writer.

TYPE: KhiopsOutputWriter

write_report_line(writer)

Writes a line of the TSV report into a writer object

Warning

This method is deprecated since Khiops 11.0.0 and will be removed in Khiops 12. Use the to_dict method instead.

PARAMETER DESCRIPTION
writer

Output writer.

TYPE: KhiopsOutputWriter

write_report_details(writer)

Writes the details of the TSV report into a writer object

Warning

This method is deprecated since Khiops 11.0.0 and will be removed in Khiops 12. Use the to_dict method instead.

PARAMETER DESCRIPTION
writer

Output writer.

TYPE: KhiopsOutputWriter

SelectedVariable(json_data=None)

Information about a selected variable in a predictor

PARAMETER DESCRIPTION
json_data

JSON data representing an element of the selectedVariables list in the trainedPredictorsDetails field within the modelingReport field of a Khiops JSON report file. If not specified it returns an empty instance.

TYPE: dict DEFAULT: None

ATTRIBUTE DESCRIPTION
name

Human readable variable name.

TYPE: str

prepared_name

Internal variable name.

TYPE: str

level

Variable level.

TYPE: float

weight

Variable weight in the model.

TYPE: float

importance

A measure of overall importance of the variable in the model. It is the geometric mean of the level and weight.

TYPE: float

See class docstring

METHOD DESCRIPTION
to_dict

Transforms this instance to a dict with the Khiops JSON file structure

write_report_header_line

Writes the header line of a TSV report into a writer object

write_report_line

Writes a line of the TSV report into a writer object

Methods:

to_dict()

Transforms this instance to a dict with the Khiops JSON file structure

write_report_header_line(writer)

Writes the header line of a TSV report into a writer object

The header is the same for all variable types.

Warning

This method is deprecated since Khiops 11.0.0 and will be removed in Khiops 12. Use the to_dict method instead.

PARAMETER DESCRIPTION
writer

Output writer.

TYPE: KhiopsOutputWriter

write_report_line(writer)

Writes a line of the TSV report into a writer object

Warning

This method is deprecated since Khiops 11.0.0 and will be removed in Khiops 12. Use the to_dict method instead.

PARAMETER DESCRIPTION
writer

Output writer.

TYPE: KhiopsOutputWriter

PredictorPerformance(json_data=None)

A predictor's performance evaluation

This class describes the performance of a predictor (classifier or regressor).

PARAMETER DESCRIPTION
json_data

JSON data of an element of the dictionary found at the predictorPerformances field within the one of the evaluation report fields of a Khiops JSON report file. If not specified it returns an empty instance.

Note

The confusion_matrix field is considered as "detail" and is not initialized in the constructor. Instead, it is initialized explicitly via the init_details method. This allows to make partial initializations for large reports.

TYPE: dict DEFAULT: None

ATTRIBUTE DESCRIPTION
rank

An string index representing the order in the report.

TYPE: str

type

Type of the predictor.

TYPE: Classifier or Regressor

name

Human readable name.

TYPE: str

data_grid

Data grid representing the distribution of the target values per part of the descriptive variable in the evaluated dataset.

TYPE: DataGrid

accuracy

Classifier only: Accuracy.

TYPE: float

compression

Classifier only: Compression rate.

TYPE: float

auc

Classifier only: Area under the ROC curve.

TYPE: float

confusion_matrix

Classifier only: Confusion matrix.

TYPE: ConfusionMatrix

rmse

Regressor only: Root mean square error.

TYPE: float

mae

Regressor only: Mean absolute error.

TYPE: float

nlpd

Regressor only: Negative log predictive density.

TYPE: float

rank_rmse

Regressor only: Root mean square error on the target's value rank.

TYPE: float

rank_mae

Regressor only: Mean absolute error on the target's value rank.

TYPE: float

rank_nlpd

Regressor only: Negative log predictive density on the target's value rank.

TYPE: float

See class docstring

METHOD DESCRIPTION
init_details

Initializes the details' attributes from a python JSON object

is_detailed

Returns True if the report contains any detailed information

get_metric_names

Returns the available univariate metrics

get_metric

Returns the value of the specified metric

to_dict

Transforms this instance to a dict with the Khiops JSON file structure

write_report_header_line

Writes the header line of a TSV report into a writer object

write_report_line

Writes a line of the TSV report into a writer object

write_report_details

Writes the details of the TSV report into a writer object

Methods:

init_details(json_data=None)

Initializes the details' attributes from a python JSON object

is_detailed()

Returns True if the report contains any detailed information

RETURNS DESCRIPTION
bool

True if the report contains any detailed information.

get_metric_names()

Returns the available univariate metrics

RETURNS DESCRIPTION
list of str

The names of the available metrics.

get_metric(metric_name)

Returns the value of the specified metric

Note

The available metrics is available via the method get_metric_names.

PARAMETER DESCRIPTION
metric_name

A metric name (case insensitive).

TYPE: str

RETURNS DESCRIPTION
float

The value of the specified metric.

to_dict(details=False)

Transforms this instance to a dict with the Khiops JSON file structure

write_report_header_line(writer)

Writes the header line of a TSV report into a writer object

The header is the same for all variable types.

Warning

This method is deprecated since Khiops 11.0.0 and will be removed in Khiops 12. Use the to_dict method instead.

PARAMETER DESCRIPTION
writer

Output writer.

TYPE: KhiopsOutputWriter

write_report_line(writer)

Writes a line of the TSV report into a writer object

Warning

This method is deprecated since Khiops 11.0.0 and will be removed in Khiops 12. Use the to_dict method instead.

PARAMETER DESCRIPTION
writer

Output writer.

TYPE: KhiopsOutputWriter

write_report_details(writer)

Writes the details of the TSV report into a writer object

Warning

This method is deprecated since Khiops 11.0.0 and will be removed in Khiops 12. Use the to_dict method instead.

PARAMETER DESCRIPTION
writer

Output writer.

TYPE: KhiopsOutputWriter

ConfusionMatrix(json_data=None)

A classifier's confusion matrix

PARAMETER DESCRIPTION
json_data

JSON data of the confusionMatrix field of an element of the dictionary found at the predictorsDetailedPerformances field within one of the evaluation report fields of a Khiops JSON report file. If not specified it returns an empty object.

TYPE: dict DEFAULT: None

ATTRIBUTE DESCRIPTION
values

Values of the target variable.

TYPE: list of str

matrix

Matrix of predicted frequencies vs target frequencies. This list is synchornized with values. Each list element represents a row of the confusion matrix, that is, the target frequencies for a fixed predicted target value.

TYPE: list

See class docstring

METHOD DESCRIPTION
to_dict

Transforms this instance to a dict with the Khiops JSON file structure

write_report

Writes the instance's TSV report into a writer object

Methods:

to_dict()

Transforms this instance to a dict with the Khiops JSON file structure

write_report(writer)

Writes the instance's TSV report into a writer object

Warning

This method is deprecated since Khiops 11.0.0 and will be removed in Khiops 12. Use the to_dict method instead.

PARAMETER DESCRIPTION
writer

Output writer.

TYPE: KhiopsOutputWriter

PredictorCurve(json_data=None)

A lift curve for a classifier or a REC curve for a regressor

PARAMETER DESCRIPTION
json_data

JSON data of an element of the liftCurves or recCurves field of one of the evaluation report fields of a Khiops JSON report file. If not specified it returns an empty instance.

TYPE: dict DEFAULT: None

ATTRIBUTE DESCRIPTION
type

Type of predictor curve.

TYPE: Lift(classifier) or REC(regressor)

name

Name of evaluated predictor.

TYPE: str

values

The curve's y-axis values.

TYPE: list of float

See class docstring

Methods:

Functions:

read_analysis_results_file(json_file_path)

Reads a Khiops JSON report

PARAMETER DESCRIPTION
json_file_path

Path of the JSON report file.

TYPE: str

RETURNS DESCRIPTION
AnalysisResults

An instance of AnalysisResults containing the report's information.

Examples:

See the following functions of the samples.py documentation script: - samples.access_predictor_evaluation_report() - samples.train_predictor_with_cross_validation() - samples.multiple_train_predictor()