TelVAC

# Import statement

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

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
Xlist[BaseTensorTD]

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
Xlist[BaseTensorTD]

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
Xlist[BaseTensorTD]

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
Xlist[BaseTensorTD]

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