molprop.applicability_domain_methods.support_vector_machine.ocsvm.SVM_AD

class molprop.applicability_domain_methods.support_vector_machine.ocsvm.SVM_AD(model_name='svm_ad', dataset=None, kernel='rbf', gamma='scale', nu=0.01, tol=1e-10, **kwargs)

Bases: ABC

Class for Applicability domain (AD) via support vector machine (SVM).

_dataset

string Name of the dataset model should be/is trained on.

_model_name

string, optional Name of the model that is used for saving model parameters. Should be unique. By default: “gnn_dataset”

kernel

string, optional Kernel that will be used for SVM (corresponding to sklearn kernels) By default: “rbf”

gamma

string, optional Hyperparameter gamma that will be used for SVM (corresponding to sklearn gamma) By default: “scale” (autoscale)

nu

float, optional Hyperparameter nu that will be used for SVM (corresponding to sklearn kernels) By default: 0.01

tol

string, optional tolerance that will be used for SVM By default: 1e-10

Methods

__init__

infer

load_model

predict

read_csv_data

Read latent space data stored in csv file (please note csv file should have column named 'latent_vector{_<model_id>}' with latent space arrays for each graph input.

save_model

train

property dataset

Dataset the model is trained on.

property hyperparameters

Dataset the model is trained on.

property model_name

Model name

read_csv_data(file_path, model_id=None, additional_columns=None)

Read latent space data stored in csv file (please note csv file should have column named ‘latent_vector{_<model_id>}’ with latent space arrays for each graph input.

Parameters:
  • file_path – string Filepath to csv file wherein the input data is stored (either for train or test data).

  • model_id – int, optional Identifier for GNN model. Only necessary when GNN ensemble is used, otherwised redundant. By default: None

  • additional_columns – array-like, optional If additional columns should be read in, the column names can be defined here. An additional array is returned. By default: []

Returns:

latent_vectors (, additional_columns) Returns latent vectors in array format (+ additional columns in array format)

property svm

SVM that is trained.