Skip to content

khiops.sklearn.estimators

Submodule of khiops.sklearn

Scikit-Learn Estimator Classes for the Khiops AutoML Suite

Class Overview

The diagram below describes the relationships in this module:

KhiopsEstimator(ABC, BaseEstimator)
    |
    +- KhiopsCoclustering(ClusterMixin)
    |
    +- KhiopsSupervisedEstimator
       |
       +- KhiopsPredictor
       |  |
       |  +- KhiopsClassifier(ClassifierMixin)
       |  |
       |  +- KhiopsRegressor(RegressorMixin)
       |
       +- KhiopsEncoder(TransformerMixin)
CLASS DESCRIPTION
KhiopsEstimator

Base class for Khiops Scikit-learn estimators

KhiopsCoclustering

A Khiops Coclustering model

KhiopsSupervisedEstimator

Abstract Khiops Supervised Estimator

KhiopsPredictor

Abstract Khiops Selective Naive Bayes Predictor

KhiopsClassifier

Khiops Selective Naive Bayes Classifier

KhiopsRegressor

Khiops Selective Naive Bayes Regressor

KhiopsEncoder

Khiops supervised discretization/grouping encoder

Classes

KhiopsEstimator(verbose=False, output_dir=None, auto_sort=True)

Bases: ABC, BaseEstimator

Base class for Khiops Scikit-learn estimators

Note

The input features collection X needs to have single-line records so that Khiops can handle them. Hence, multi-line records are preprocessed: carriage returns / line feeds are replaced with blank spaces before being handed over to Khiops.

PARAMETER DESCRIPTION
verbose

If True it prints debug information and it does not erase temporary files when fitting, predicting or transforming.

TYPE: bool DEFAULT: `False`

output_dir

Path of the output directory for the resulting artifacts of Khiops learning tasks. See concrete estimator classes for more information about this parameter.

TYPE: str DEFAULT: None

auto_sort

Advanced.: See concrete estimator classes for information about this parameter.

TYPE: bool DEFAULT: `True`

METHOD DESCRIPTION
export_report_file

Exports the model report to a JSON file

export_dictionary_file

Export the model's Khiops dictionary file (.kdic)

fit

Fit the estimator

Methods:

export_report_file(report_file_path)

Exports the model report to a JSON file

PARAMETER DESCRIPTION
report_file_path

The location of the exported report file.

TYPE: str

RAISES DESCRIPTION
ValueError

When the instance is not fitted.

export_dictionary_file(dictionary_file_path)

Export the model's Khiops dictionary file (.kdic)

fit(X, y=None, **kwargs)

Fit the estimator

RETURNS DESCRIPTION
self

The fitted estimator instance.

TYPE: KhiopsEstimator

KhiopsCoclustering(verbose=False, output_dir=None, auto_sort=True, build_name_var=True, build_distance_vars=False, build_frequency_vars=False)

Bases: ClusterMixin, KhiopsEstimator

A Khiops Coclustering model

A coclustering is a non-supervised piecewise constant density estimator.

PARAMETER DESCRIPTION
build_distance_vars

If True includes a cluster distance variable in the deployment

TYPE: bool DEFAULT: `False`

build_frequency_vars

If True includes the frequency variables in the deployment.

TYPE: bool DEFAULT: `False`

build_name_var

If True includes a cluster id variable in the deployment.

TYPE: bool DEFAULT: `False`

verbose

If True it prints debug information and it does not erase temporary files when fitting, predicting or transforming.

TYPE: bool DEFAULT: `False`

output_dir

Path of the output directory for the Coclustering.khcj report file and the Coclustering.kdic modeling dictionary file.

TYPE: str DEFAULT: None

auto_sort

Advanced. Only for multi-table inputs: If True input tables are automatically sorted by their key before executing Khiops. If the input tables are already sorted by their keys set this parameter to False to speed up the processing. This affects the predict method. Note The sort by key is performed in a left-to-right, hierarchical, lexicographic manner.

TYPE: bool DEFAULT: `True`

ATTRIBUTE DESCRIPTION
is_multitable_model_

True if the model was fitted on a multi-table dataset.

TYPE: bool

model_

The Khiops dictionary domain for the trained coclustering. For coclustering it is a multi-table dictionary even though the model is single-table.

TYPE: DictionaryDomain

model_main_dictionary_name_

The name of the main Khiops dictionary within the model_ domain.

TYPE: str

model_report_

The Khiops report object.

TYPE: CoclusteringResults

Examples:

See the following functions of the samples_sklearn.py documentation script: - samples_sklearn.khiops_coclustering()

METHOD DESCRIPTION
fit

Trains a Khiops Coclustering model

simplify

Creates a simplified coclustering model from the current instance

predict

Predicts the most probable cluster for the test dataset X

fit_predict

Performs clustering on X and returns result (instead of labels)

Methods:

fit(X, y=None, **kwargs)

Trains a Khiops Coclustering model

PARAMETER DESCRIPTION
X

Training dataset. Either an array-like or a dict specification for multi-table datasets (see Multi-Table Learning Primer).

TYPE: array-like of shape (n_samples, n_features_in) or dict

id_column

The column that contains the id of the instance.

TYPE: str

columns

The columns to be co-clustered. If not specified it uses all columns.

TYPE: list

RETURNS DESCRIPTION
self

The calling estimator instance.

TYPE: KhiopsCoclustering

simplify(max_preserved_information=0, max_cells=0, max_total_parts=0, max_part_numbers=None)

Creates a simplified coclustering model from the current instance

PARAMETER DESCRIPTION
max_preserved_information

Maximum information preserve in the simplified coclustering. If equal to 0 there is no limit.

TYPE: int DEFAULT: 0

max_cells

Maximum number of cells in the simplified coclustering. If equal to 0 there is no limit.

TYPE: int DEFAULT: 0

max_total_parts

Maximum number of parts totaled over all variables. If equal to 0 there is no limit.

TYPE: int DEFAULT: 0

max_part_numbers

Maximum number of clusters for each of the co-clustered column. Specifically, a key-value pair of this dictionary represents the column name and its respective maximum number of clusters. If not specified, then no maximum number of clusters is imposed on any column.

TYPE: dict DEFAULT: None

RETURNS DESCRIPTION
self

A new, simplified KhiopsCoclustering estimator instance.

TYPE: KhiopsCoclustering

predict(X)

Predicts the most probable cluster for the test dataset X

PARAMETER DESCRIPTION
X

Training dataset. Either an array-like or a dict specification for multi-table datasets (see Multi-Table Learning Primer).

TYPE: array-like of shape (n_samples, n_features_in) or dict

RETURNS DESCRIPTION
`ndarray <numpy.ndarray>`

An array containing the encoded columns. A first column containing key column ids is added in multi-table mode.

fit_predict(X, y=None, **kwargs)

Performs clustering on X and returns result (instead of labels)

KhiopsSupervisedEstimator(n_features=1000, n_trees=10, n_text_features=10000, type_text_features='words', specific_pairs=None, all_possible_pairs=True, construction_rules=None, n_feature_parts=0, keep_selected_variables_only=True, verbose=False, output_dir=None, auto_sort=True)

Bases: KhiopsEstimator

Abstract Khiops Supervised Estimator

METHOD DESCRIPTION
fit

Fits a supervised estimator according to X,y

Methods:

fit(X, y=None, **kwargs)

Fits a supervised estimator according to X,y

Called by the concrete sub-classes KhiopsEncoder, KhiopsClassifier, KhiopsRegressor.

PARAMETER DESCRIPTION
X

Training dataset. Either an array-like or a dict specification for multi-table datasets (see Multi-Table Learning Primer).

TYPE: array-like of shape (n_samples, n_features_in) or dict

y

The target values.

TYPE: array-like of shape (n_samples,) DEFAULT: None

RETURNS DESCRIPTION
self

The calling estimator instance.

TYPE: KhiopsSupervisedEstimator

KhiopsPredictor(n_features=1000, n_trees=10, n_text_features=10000, type_text_features='words', n_selected_features=0, n_evaluated_features=0, specific_pairs=None, all_possible_pairs=True, construction_rules=None, n_feature_parts=0, keep_selected_variables_only=True, verbose=False, output_dir=None, auto_sort=True)

Bases: KhiopsSupervisedEstimator

Abstract Khiops Selective Naive Bayes Predictor

METHOD DESCRIPTION
predict

Predicts the target variable for the test dataset X

Methods:

predict(X)

Predicts the target variable for the test dataset X

See the documentation of concrete subclasses for more details.

KhiopsClassifier(n_features=1000, n_pairs=0, n_trees=10, n_text_features=10000, type_text_features='words', n_selected_features=0, n_evaluated_features=0, specific_pairs=None, all_possible_pairs=True, construction_rules=None, n_feature_parts=0, group_target_value=False, keep_selected_variables_only=True, verbose=False, output_dir=None, auto_sort=True)

Bases: ClassifierMixin, KhiopsPredictor

Khiops Selective Naive Bayes Classifier

This classifier supports automatic feature engineering on multi-table datasets. See Multi-Table Learning Primer for more details.

Note

Visit the Khiops site to learn about the automatic feature engineering algorithm.

PARAMETER DESCRIPTION
n_features

Maximum number of features to construct automatically. See Multi-Table Learning Primer for more details on the multi-table-specific features.

TYPE: int DEFAULT: 1000

n_pairs

Maximum number of pair features to construct. These features are 2D grid partitions of univariate feature pairs. The grid is optimized such that in each cell the target distribution is well approximated by a constant histogram. Only pairs that are jointly more informative than their marginals may be taken into account in the classifier.

TYPE: int DEFAULT: 0

n_trees

Maximum number of decision tree features to construct. The constructed trees combine other features, either native or constructed. These features usually improve the classifier's performance at the cost of interpretability of the model.

TYPE: int DEFAULT: 10

n_text_features

Maximum number of text features to construct.

TYPE: int DEFAULT: 10000

type_text_features

Type of the text features to construct. Can be either one of: - "words": sequences of non-space characters - "ngrams": sequences of bytes - "tokens": user-defined

TYPE: str DEFAULT: "words"

n_selected_features

Maximum number of features to be selected in the SNB predictor. If equal to 0 it selects all the features kept in the training.

TYPE: int DEFAULT: 0

n_evaluated_features

Maximum number of features to be evaluated in the SNB predictor training. If equal to 0 it evaluates all informative features.

TYPE: int DEFAULT: 0

specific_pairs

User-specified pairs as a list of 2-tuples of feature names. If a given tuple contains only one non-empty feature name, then it generates all the pairs containing it (within the maximum limit n_pairs). These pairs have top priority: they are constructed first.

TYPE: list of tuple DEFAULT: None

all_possible_pairs

If True tries to create all possible pairs within the limit n_pairs. Pairs specified with specific_pairs have top priority: they are constructed first.

TYPE: bool DEFAULT: `True`

construction_rules

Allowed rules for the automatic feature construction. If not set, Khiops uses the multi-table construction rules listed in kh.DEFAULT_CONSTRUCTION_RULES <khiops.core.api.DEFAULT_CONSTRUCTION_RULES>.

TYPE: list of str DEFAULT: None

n_feature_parts

Maximum number of variable parts produced by preprocessing methods. If equal to 0 it is automatically calculated.

TYPE: int DEFAULT: 0

group_target_value

Allows grouping of the target values in classification. It can substantially increase the training time.

TYPE: bool DEFAULT: `False`

keep_selected_variables_only

Keeps only predictor-selected variables in the supervised analysis report.

TYPE: bool DEFAULT: `True`

verbose

If True it prints debug information and it does not erase temporary files when fitting, predicting or transforming.

TYPE: bool DEFAULT: `False`

output_dir

Path of the output directory for the AllReports.khj report file and the Modeling.kdic modeling dictionary file. By default these files are deleted.

TYPE: str DEFAULT: None

auto_sort

Advanced. Only for multi-table inputs: If True input tables are pre-sorted by their key before executing Khiops. If the input tables are already sorted by their keys set this parameter to False to speed up the processing. This affects the fit, predict and predict_proba methods. Note The sort by key is performed in a left-to-right, hierarchical, lexicographic manner.

TYPE: bool DEFAULT: `True`

ATTRIBUTE DESCRIPTION
n_classes_

The number of classes seen in training.

TYPE: int

classes_

The list of classes seen in training. Depending on the training target, the contents are int or str.

TYPE: `ndarray <numpy.ndarray>` of shape (n_classes\_,)

n_features_in_

The number of features in the main table of the training dataset.

TYPE: int

is_multitable_model_

True if the model was fitted on a multi-table dataset.

TYPE: bool

model_

The Khiops dictionary domain for the trained classifier.

TYPE: DictionaryDomain

model_main_dictionary_name_

The name of the main Khiops dictionary within the model_ domain.

TYPE: str

model_report_

The Khiops report object.

TYPE: AnalysisResults

Examples:

See the following functions of the samples_sklearn.py documentation script: - samples_sklearn.khiops_classifier() - samples_sklearn.khiops_classifier_multiclass() - samples_sklearn.khiops_classifier_multitable_star() - samples_sklearn.khiops_classifier_multitable_snowflake() - samples_sklearn.khiops_classifier_pickle()

METHOD DESCRIPTION
fit

Fits a Selective Naive Bayes classifier according to X, y

predict

Predicts the most probable class for the test dataset X

predict_proba

Predicts the class probabilities for the test dataset X

Methods:

fit(X, y, **kwargs)

Fits a Selective Naive Bayes classifier according to X, y

PARAMETER DESCRIPTION
X

Training dataset. Either an array-like or a dict specification for multi-table datasets (see Multi-Table Learning Primer).

TYPE: array-like of shape (n_samples, n_features_in) or dict

y

The target values.

TYPE: array-like of shape (n_samples,)

RETURNS DESCRIPTION
self

The calling estimator instance.

TYPE: KhiopsClassifier

predict(X)

Predicts the most probable class for the test dataset X

The predicted class of an input sample is the arg-max of the conditional probabilities P(y|X) for each value of y.

PARAMETER DESCRIPTION
X

Training dataset. Either an array-like or a dict specification for multi-table datasets (see Multi-Table Learning Primer).

TYPE: array-like of shape (n_samples, n_features_in) or dict

RETURNS DESCRIPTION
`ndarray <numpy.ndarray>`

An array containing the encoded columns. A first column containing key column ids is added in multi-table mode. The numpy.dtype of the array matches the type of y used during training. It will be integer, float, or boolean if the classifier was trained with a y of the corresponding type. Otherwise it will be str.

The key columns are added for multi-table tasks.

predict_proba(X)

Predicts the class probabilities for the test dataset X

PARAMETER DESCRIPTION
X

Training dataset. Either an array-like or a dict specification for multi-table datasets (see Multi-Table Learning Primer).

TYPE: array-like of shape (n_samples, n_features_in) or dict

RETURNS DESCRIPTION
ndarray or str

The probability of the samples for each class in the model. The columns are named with the pattern Prob<class> for each <class> found in the training dataset. The output data container is of type numpy.ndarray.

The key columns are added for multi-table tasks.

KhiopsRegressor(n_features=1000, n_trees=0, n_text_features=10000, type_text_features='words', n_selected_features=0, n_evaluated_features=0, construction_rules=None, n_feature_parts=0, keep_selected_variables_only=True, verbose=False, output_dir=None, auto_sort=True)

Bases: RegressorMixin, KhiopsPredictor

Khiops Selective Naive Bayes Regressor

This regressor supports automatic feature engineering on multi-table datasets. See Multi-Table Learning Primer for more details.

Note

Visit the Khiops site to learn about the automatic feature engineering algorithm.

PARAMETER DESCRIPTION
n_features

Maximum number of features to construct automatically. See Multi-Table Learning Primer for more details on the multi-table-specific features.

TYPE: int DEFAULT: 1000

n_trees

Maximum number of decision tree features to construct. The constructed trees combine other features, either native or constructed. These features usually improve the regressor's performance at the cost of interpretability of the model.

TYPE: int DEFAULT: 10

n_text_features

Maximum number of text features to construct.

TYPE: int DEFAULT: 10000

type_text_features

Type of the text features to construct. Can be either one of: - "words": sequences of non-space characters - "ngrams": sequences of bytes - "tokens": user-defined

TYPE: str DEFAULT: "words"

n_selected_features

Maximum number of features to be selected in the SNB predictor. If equal to 0 it selects all the features kept in the training.

TYPE: int DEFAULT: 0

n_evaluated_features

Maximum number of features to be evaluated in the SNB predictor training. If equal to 0 it evaluates all informative features.

TYPE: int DEFAULT: 0

construction_rules

Allowed rules for the automatic feature construction. If not set, Khiops uses the multi-table construction rules listed in kh.DEFAULT_CONSTRUCTION_RULES <khiops.core.api.DEFAULT_CONSTRUCTION_RULES>.

TYPE: list of str DEFAULT: None

n_feature_parts

Maximum number of variable parts produced by preprocessing methods. If equal to 0 it is automatically calculated.

TYPE: int DEFAULT: 0

keep_selected_variables_only

Keeps only predictor-selected variables in the supervised analysis report.

TYPE: bool DEFAULT: `True`

verbose

If True it prints debug information and it does not erase temporary files when fitting, predicting or transforming.

TYPE: bool DEFAULT: `False`

output_dir

Path of the output directory for the AllReports.khj report file and the Modeling.kdic modeling dictionary file. By default these files are deleted.

TYPE: str DEFAULT: None

auto_sort

Advanced. Only for multi-table inputs: If True input tables are pre-sorted by their key before executing Khiops. If the input tables are already sorted by their keys set this parameter to False to speed up the processing. This affects the fit and predict methods. Note The sort by key is performed in a left-to-right, hierarchical, lexicographic manner.

TYPE: bool DEFAULT: `True`

ATTRIBUTE DESCRIPTION
n_features_in_

The number of features in the main table of the training dataset.

TYPE: int

is_multitable_model_

True if the model was fitted on a multi-table dataset.

TYPE: bool

model_

The Khiops dictionary domain for the trained regressor.

TYPE: DictionaryDomain

model_main_dictionary_name_

The name of the main Khiops dictionary within the model_ domain.

TYPE: str

model_report_

The Khiops report object.

TYPE: AnalysisResults

Examples:

See the following functions of the samples_sklearn.py documentation script: - samples_sklearn.khiops_regressor()

METHOD DESCRIPTION
fit

Fits a Selective Naive Bayes regressor according to X, y

predict

Predicts the regression values for the test dataset X

Methods:

fit(X, y=None, **kwargs)

Fits a Selective Naive Bayes regressor according to X, y

Warning

Make sure that the type of y is float. This is easily done with y = y.astype(float).

PARAMETER DESCRIPTION
X

Training dataset. Either an array-like or a dict specification for multi-table datasets (see Multi-Table Learning Primer).

TYPE: array-like of shape (n_samples, n_features_in) or dict

y

The target values.

TYPE: array-like of shape (n_samples,) DEFAULT: None

RETURNS DESCRIPTION
self

The calling estimator instance.

TYPE: KhiopsRegressor

predict(X)

Predicts the regression values for the test dataset X

The predicted value is estimated by the Selective Naive Bayes Regressor learned during fit step.

PARAMETER DESCRIPTION
X

Training dataset. Either an array-like or a dict specification for multi-table datasets (see Multi-Table Learning Primer).

TYPE: array-like of shape (n_samples, n_features_in) or dict

RETURNS DESCRIPTION
ndarray or str

An array containing the encoded columns. A first column containing key column ids is added in multi-table mode. The key columns are added for multi-table tasks. The array is in the form of a numpy.ndarray if X is array-like, or dataset spec containing pandas.DataFrame tables.

KhiopsEncoder(categorical_target=True, n_features=1000, n_pairs=0, n_trees=0, n_text_features=10000, type_text_features='words', specific_pairs=None, all_possible_pairs=True, construction_rules=None, n_feature_parts=0, informative_features_only=True, group_target_value=False, keep_initial_variables=False, transform_type_categorical='part_id', transform_type_numerical='part_id', transform_type_pairs='part_id', verbose=False, output_dir=None, auto_sort=True)

Bases: TransformerMixin, KhiopsSupervisedEstimator

Khiops supervised discretization/grouping encoder

PARAMETER DESCRIPTION
categorical_target

True if the target column is categorical.

TYPE: bool DEFAULT: `True`

n_features

Maximum number of features to construct automatically. See Multi-Table Learning Primer for more details on the multi-table-specific features.

TYPE: int DEFAULT: 1000

n_pairs

Maximum number of pair features to construct. These features are 2D grid partitions of univariate feature pairs. The grid is optimized such that in each cell the target distribution is well approximated by a constant histogram. Only pairs that are jointly more informative than their marginals may be taken into account in the encoder.

TYPE: int DEFAULT: 0

n_trees

Maximum number of decision tree features to construct. The constructed trees combine other features, either native or constructed. These features usually improve a predictor's performance at the cost of interpretability of the model.

TYPE: int DEFAULT: 10

n_text_features

Maximum number of text features to construct.

TYPE: int DEFAULT: 10000

type_text_features

Type of the text features to construct. Can be either one of: - "words": sequences of non-space characters - "ngrams": sequences of bytes - "tokens": user-defined

TYPE: str DEFAULT: "words"

specific_pairs

User-specified pairs as a list of 2-tuples of feature names. If a given tuple contains only one non-empty feature name, then it generates all the pairs containing it (within the maximum limit n_pairs). These pairs have top priority: they are constructed first.

TYPE: list of tuple DEFAULT: None

all_possible_pairs

If True tries to create all possible pairs within the limit n_pairs. Pairs specified with specific_pairs have top priority: they are constructed first.

TYPE: bool DEFAULT: `True`

construction_rules

Allowed rules for the automatic feature construction. If not set, Khiops uses the multi-table construction rules listed in kh.DEFAULT_CONSTRUCTION_RULES <khiops.core.api.DEFAULT_CONSTRUCTION_RULES>.

TYPE: list of str DEFAULT: None

n_feature_parts

Maximum number of variable parts produced by preprocessing methods. If equal to 0 it is automatically calculated.

TYPE: int DEFAULT: 0

informative_features_only

If True keeps only informative features.

TYPE: bool DEFAULT: `True`

group_target_value

Allows grouping of the target values in classification. It can substantially increase the training time.

TYPE: bool DEFAULT: `False`

keep_initial_variables

If True the original columns are kept in the transformed data.

TYPE: bool DEFAULT: `False`

transform_type_categorical

Type of transformation for categorical features. Valid values: - "part_id" - "part_label" - "dummies" - "conditional_info"

See the documentation for the categorical_recoding_method parameter of the api.train_recoder function for more details.

TYPE: str DEFAULT: "part_id"

transform_type_numerical

One of the following strings are valid: - "part_id" - "part_label" - "dummies" - "conditional_info" - "center_reduction" - "0-1_normalization" - "rank_normalization"

See the documentation for the numerical_recoding_method parameter of the api.train_recoder function for more details.

TYPE: str DEFAULT: "part_id"

transform_type_pairs

Type of transformation for bivariate features. Valid values: - "part_id" - "part_label" - "dummies" - "conditional_info"

TYPE: str DEFAULT: "part_id"

verbose

If True it prints debug information and it does not erase temporary files when fitting, predicting or transforming.

TYPE: bool DEFAULT: `False`

output_dir

Path of the output directory for the AllReports.khj report file and the Modeling.kdic modeling dictionary file. By default these files are deleted.

TYPE: str DEFAULT: None

auto_sort

Advanced. Only for multi-table inputs: If True input tables are pre-sorted by their key before executing Khiops. If the input tables are already sorted by their keys set this parameter to False to speed up the processing. This affects the fit and transform methods. Note The sort by key is performed in a left-to-right, hierarchical, lexicographic manner.

TYPE: bool DEFAULT: `True`

ATTRIBUTE DESCRIPTION
is_multitable_model_

True if the model was fitted on a multi-table dataset.

TYPE: bool

model_

The Khiops dictionary domain for the trained encoder.

TYPE: DictionaryDomain

model_main_dictionary_name_

The name of the main Khiops dictionary within the model_ domain.

TYPE: str

model_report_

The Khiops report object.

TYPE: AnalysisResults

Examples:

See the following functions of the samples_sklearn.py documentation script: - samples_sklearn.khiops_encoder() - samples_sklearn.khiops_encoder_multitable_star() - samples_sklearn.khiops_encoder_multitable_snowflake()

METHOD DESCRIPTION
fit

Fits the Khiops Encoder according to X, y

transform

Transforms X with a fitted Khiops supervised encoder

fit_transform

Fit and transforms its inputs

Methods:

fit(X, y=None, **kwargs)

Fits the Khiops Encoder according to X, y

PARAMETER DESCRIPTION
X

Training dataset. Either an array-like or a dict specification for multi-table datasets (see Multi-Table Learning Primer).

TYPE: array-like of shape (n_samples, n_features_in) or dict

y

The target values.

TYPE: array-like of shape (n_samples,) DEFAULT: None

RETURNS DESCRIPTION
self

The calling estimator instance.

TYPE: KhiopsEncoder

transform(X)

Transforms X with a fitted Khiops supervised encoder

Note

Numerical features are encoded to categorical ones. See the transform_type_numerical parameter for details.

PARAMETER DESCRIPTION
X

Training dataset. Either an array-like or a dict specification for multi-table datasets (see Multi-Table Learning Primer).

TYPE: array-like of shape (n_samples, n_features_in) or dict

RETURNS DESCRIPTION
ndarray

An array containing the encoded columns. A first column containing key column ids is added in multi-table mode.

fit_transform(X, y=None, **kwargs)

Fit and transforms its inputs

PARAMETER DESCRIPTION
X

Training dataset. Either an array-like or a dict specification for multi-table datasets (see Multi-Table Learning Primer).

TYPE: array-like of shape (n_samples, n_features_in) or dict

y

The target values.

TYPE: array-like of shape (n_samples,) DEFAULT: None

RETURNS DESCRIPTION
self

The calling estimator instance.

TYPE: KhiopsEncoder

Functions: