model

This modules models data, user input in classes and functions

Classes

DataInfo(no_samples, no_features, no_class, …) It stores dataset characteristics such as no.
UserInput() It encapsulates a user’s input.
class model.DataInfo(no_samples, no_features, no_class, class_labels, header_names)[source]

Bases: object

It stores dataset characteristics such as no. samples, no. features and etc.

Parameters:

no_samples : int

Number of samples in dataset.

no_features : init

Number of features in dataset.

no_class : int

Number of classes in dataset.

class_labels: array-like

Unique class labels.

header_names: list

Name of every feature in dataset.

class model.UserInput[source]

Bases: object

It encapsulates a user’s input.

Attributes

X_train (array-like, shape (n_samples, n_features)) Training feature vectors, where n_samples is the number of samples and n_features is the number of features.
y_train (array-like, shape(n_samples,)) Target values or class labels.
data_filename (str) The filename of a user’s dataset.
clf_type (str, {‘tsvm’, ‘lstsvm’}) Type of the classifier.
class_type (str, {‘binary’, ‘multiclass’}) Type of classification problem.
mc_scheme (str, {‘ova’, ‘ovo’}) The multi-class strategy
result_path (str) Path for saving classification results.
save_clf_results (boolean (default=True)) Whether to save the classification results or not.
save_best_model (boolean (default=False)) Whether to save the best fitted model or not.
log_file (boolean) Whether to create a log file or not.
kernel_type (str, {‘linear’, ‘RBF’}) Type of the kernel function
rect_kernel (float (default=1.0)) Percentage of training samples for Rectangular kernel.
test_method_tuple (tuple) A two-element tuple which contains type of evaluation method and its parameter.
step_size (float) Step size for generating search elements.
C1_range (tuple) Lower and upper bound for C1 penalty parameter. example: (-4, 5), first element is lower bound and second element is upper bound
C2_range (tuple) Lower and upper bound for C2 penalty parameter.
u_range (tuple) Lower and upper bound for gamma parameter.
C1 (float) The penalty parameter.
C2 (float) The penalty parameter.
u (float) The parameter of the RBF kernel function.
input_complete (boolean) Whether all the required inputs are set.
linear_db (boolean) Whether to plot decision boundary or not.
fig_save (boolean) Whether to save the figure or not.
fig_dpi (int) DPI of the figure. It determines the quality of the output image.
fig_save_path (str) The path at which a figure will be saved.
pre_trained_model (object) A pre-trained TSVM-based classifer.
save_pred (boolean) Whether to save predicted labels of test samples in a file or not.
save_pred_path (str) The path at which the file of predicted labels will be saved.

Methods

get_clf_params() It returns hyper-parameters of the classifier in a dictionary.
get_current_selection() It returns a user’s current selection for confirmation
get_fig_name() Returns the figure’s name based on the user’s selection for saving a file.
get_selected_clf() It returns the classifier that is selected by user.
validate_step_size() Checks whether step size for generating search elements are valid or not.
get_current_selection()[source]

It returns a user’s current selection for confirmation

get_selected_clf()[source]

It returns the classifier that is selected by user.

Returns:

clf_obj : object

An estimator object.

get_clf_params()[source]

It returns hyper-parameters of the classifier in a dictionary.

Returns:

dict

Hyper-parameters of the classifier.

get_fig_name()[source]

Returns the figure’s name based on the user’s selection for saving a file.

validate_step_size()[source]

Checks whether step size for generating search elements are valid or not.

Returns:

boolean

Whether step size is valid or not.