TelVI

# Import statement

from hottbox.algorithms.classification import TelVI
class TelVI(base_clf, probability=False, verbose=False)[source]

Tensor Ensemble Learning: Vectors Independently (TelVI)

Parameters
base_clflist[SklearnClassifier]

List of classifiers that will be used for the corresponding collection of the factor vectors of the tensor decomposition. This list does not have to be heterogeneous. However, all classifiers should support sklearn API. Length of this list should be equal to the number of collection of the factor vectors, otherwise an exception will be thrown. This is checked after the data have been splitted inside decomp_to_array method (called from fit, predict, predict_proba, grid_search_base_clf)

probabilitybool

Whether to enable probability estimates. This must be enabled prior to calling fit, and will slow down that method.

verbosebool

Enable verbose output.

References

  • Ilia Kisil, Ahmad Moniri, Danilo P. Mandic. “Tensor Ensemble Learning for Multidimensional Data.” In 2018 IEEE Global Conference on Signal and Information Processing (GlobalSIP), pp. 1358-1362. IEEE, 2018.

Methods

fit(self, X, y)

Fit specified classification models according to the given training data.

get_params_base_clf(self[, i])

Get parameters of employed base classifier

grid_search(self, X, y, search_params[, …])

Perform hyper parameter search with cross-validation for all base classifiers.

predict(self, X)

Perform classification on samples in X.

predict_proba(self, X)

Compute probabilities of possible outcomes for samples in X.

score(self, X, y)

Returns the mean accuracy on the given test data and labels.

set_params_base_clf(self, params, i)

Set parameters for the specified base classifier

decomp_to_array

fit(self, X, y)[source]

Fit specified classification models according to the given training data.

Parameters
X{list[TensorCPD], list[TensorTKD]}

List of training samples each of which is represented through a tensor factorisation

ynp.ndarray

Target relative to X for classification

Returns
selfobject
get_params_base_clf(self, i=-1)[source]

Get parameters of employed base classifier

Parameters
iint

Positional number of the base classifier. By default outputs parameters for all base classifiers

Returns
Union[list[dict], dict]

Perform hyper parameter search with cross-validation for all base classifiers. Parameter setting that gave the best results on the hold out data are assigned to the base classifiers

Parameters
X{list[TensorCPD], list[TensorTKD]}

List of training samples each of which is represented through a tensor factorisation

ynp.ndarray

Target relative to X for classification

search_paramslist[dict]

List of dictionaries with parameters names (string) as keys and lists of parameter settings to try as values

cv_paramsdict

Dictionary with kwargs that determine the cross-validation splitting strategy.

inplacebool

If True, assign parameter setting that gave the best results on the hold out data to the base classifier

n_jobsint

Number of jobs to run in parallel

Returns
best_paramslist[dict]

List of parameter setting that gave the best results on the hold out data for the corresponding classifier

Raises
TypeError

If the searching parameters are not provided as a list

ValueError

If the searching parameters are not provided for each of the base classifier (lists length comparison) Note: All elements of search_params must contain only valid parameters for the respective base classifiers

predict(self, X)[source]

Perform classification on samples in X.

Parameters
X{list[TensorCPD], list[TensorTKD]}

List of training samples each of which is represented through a tensor factorisation

Returns
y_prednp.ndarray

Class labels for samples in X.

predict_proba(self, X)[source]

Compute probabilities of possible outcomes for samples in X.

Parameters
X{list[TensorCPD], list[TensorTKD]}

List of training samples each of which is represented through a tensor factorisation

Returns
y_pred_probanp.ndarray

Returns the probability of the sample for each class in the model. The columns correspond to the classes in sorted order, as they appear in the attribute base_clf[i].classes_.

score(self, X, y)[source]

Returns the mean accuracy on the given test data and labels.

Parameters
Xlist[BaseTensorTD]
ynp.ndarray
Returns
acc = np.ndarray
set_params_base_clf(self, params, i)[source]

Set parameters for the specified base classifier

Parameters
iint

Positional number of the base classifier.

paramsdict

Dictionary with parameters for the base classifier