df2 = mr.load_data(file2) # concatenate such data data = mr.concatenate_data(df1, df2) # find trials to later separate trials_index = mr.find_trials(data) # separate trials trials = mr.separate_trials(data, trials_index) # create the label column labels = mr.create_multi_labels(data) # Go through each trial, reset the columns, we split from 100-300ms ((308th sample to 513th sample)) pro_trials = mr.process_trials(trials) # Find the mean across channels avg_trials = mr.average_trials(pro_trials) # concatenates the average trials dataframe with labels ml_df = mr.create_ml_df(avg_trials, labels) # train models X_train, X_test, y_train, y_test = mr.prepare_ml_df(ml_df) acc_svc, precision_svc = mr.train_svc_multi(X_train, X_test, y_train, y_test) acc_dtc, precision_dtc = mr.train_dtc_multi(X_train, X_test, y_train, y_test)
# concatenate such data data = mr.concatenate_data(df1, df2) # find trials to later separate trials_index = mr.find_trials(data) # separate trials trials = mr.separate_trials(data, trials_index) # create the label column labels = mr.create_ic_labels(data) # Go through each trial, reset the columns, we split from 100-300ms ((308th sample to 513th sample)) # Increase window by 50ms each try pro_trials = mr.process_trials(trials, 250, 550) # Find the mean across channels avg_trials = mr.average_trials(pro_trials) # concatenates the average trials dataframe with labels ml_df = mr.create_ml_df(avg_trials, labels) # train models X_train, X_test, y_train, y_test = mr.prepare_ml_df(ml_df, scale=False) acc_svc, precision_svc = mr.train_svc(X_train, X_test, y_train, y_test) acc_dtc, precision_dtc = mr.train_dtc(X_train, X_test, y_train, y_test) acc_nb, precision_nb = mr.train_nb(X_train, X_test, y_train, y_test)