mechanoChemML.src.kfold_train

Module Contents

Classes

MLKFold this class is created to speed up the k-fold training process
class mechanoChemML.src.kfold_train.MLKFold(total_folds, dataset, split_ratio=[0.8, 0.1, 0.1])[source]

this class is created to speed up the k-fold training process by default, after an initial shuffle, 10% data will be saved for testing the 90% dataset will be used for k-fold train to train the best NN structure, 90% dataset will be split as 80%, 10% for train and validation the held 10% testing dataset will be used for final model evaluation

prepare_kfold(self)[source]

prepare the kfold dataset split

any_left_fold(self)[source]
plot_all_folds(self)[source]

plot all the folds in one figure

get_next_fold(self, dataset, labels, derivative=[], fold_id=-1, final_data=False)[source]

get next fold data for training/validation

input: features, labels, fold_id
fold_id is only used when a specific number is given

output: current fold of features and labels

get_current_fold_derivative_data(self)[source]
update_kfold_status(self)[source]

wait until the training is done before save the status

save_status(self)[source]

save the k_fold split information such that it will not change index of each fold after restart

load_status(self)[source]

load previously saved k_fold split information for consistency

init_kfold(self)[source]

initialize kfold split ratio, etc.

mechanoChemML.src.kfold_train.size_of_data = 100[source]