Exemple #1
0
    def run_training(self):
        self.binary_csp = BinaryCSP(
            self.cnt,
            self.filterbands,
            self.filt_order,
            self.folds,
            self.class_pairs,
            self.segment_ival,
            self.n_top_bottom_csp_filters,
            standardize_filt_cnt=self.standardize_filt_cnt,
            standardize_epo=self.standardize_epo,
            ival_optimizer=self.ival_optimizer,
            marker_def=self.marker_def)
        self.binary_csp.run()

        self.filterbank_csp = FilterbankCSP(
            self.binary_csp,
            n_features=self.n_selected_features,
            n_filterbands=self.n_selected_filterbands,
            forward_steps=self.forward_steps,
            backward_steps=self.backward_steps,
            stop_when_no_improvement=self.stop_when_no_improvement)
        self.filterbank_csp.run()

        self.multi_class = MultiClassWeightedVoting(
            self.binary_csp.train_labels_full_fold,
            self.binary_csp.test_labels_full_fold,
            self.filterbank_csp.train_pred_full_fold,
            self.filterbank_csp.test_pred_full_fold, self.class_pairs)
        self.multi_class.run()
Exemple #2
0
def recreate_multi_class(train_csp_obj):
    """ Assumes filterbank + possibly binary csp was rerun and
    recreates multi class weighted voting object 
    with new labels + predictions. """
    train_csp_obj.multi_class = MultiClassWeightedVoting(
        train_csp_obj.binary_csp.train_labels_full_fold,
        train_csp_obj.binary_csp.test_labels_full_fold,
        train_csp_obj.filterbank_csp.train_pred_full_fold,
        train_csp_obj.filterbank_csp.test_pred_full_fold,
        train_csp_obj.class_pairs)