continue

        labels = np.hstack([[session] * 20 for session in range(4)])
        lplo2 = LeavePLabelOut(labels, p=1)
        for train_id, test_id in lplo2:
            fmri_train, fmri_test = fmri_isi[train_id], fmri_isi[test_id]
            design_train, design_test = (design_isi[train_id],
                                         design_isi[test_id])
            stimuli_train, stimuli_test = (stimuli_isi[train_id],
                                           stimuli_isi[test_id])
            # Feature selection
            fmri_train, fmri_test = de.feature_selection(
                fmri_train, fmri_test, np.argmax(stimuli_train, axis=1))

            # Fit a ridge regression to predict the design matrix
            prediction_test, prediction_train, score = de.fit_ridge(
                fmri_train, fmri_test, design_train, design_test,
                double_prediction=True, extra=fmri_train)

            # Fit a logistic regression for deconvolution
            accuracy = de.logistic_deconvolution(
                prediction_train, prediction_test, stimuli_train,
                stimuli_test, logistic_window, delay=delay)

            scores.append(accuracy)
            subjects.append(subject + 1)
            models.append('logistic deconvolution')
            isis.append(isi)

    print('finished subject ' + str(subject))
        fmri_train, fmri_test = de.feature_selection(
            fmri_train, fmri_test, np.argmax(stimuli_train, axis=1))

        # Fit a ridge regression to predict the design matrix
        prediction_test, prediction_train, score = de.fit_ridge(
            fmri_train,
            fmri_test,
            design_train,
            design_test,
            double_prediction=True,
            extra=fmri_train)

        # Fit a logistic regression for deconvolution
        accuracy = de.logistic_deconvolution(prediction_train,
                                             prediction_test,
                                             stimuli_train,
                                             stimuli_test,
                                             logistic_window,
                                             delay=delay)

        scores.append(accuracy)
        subjects.append(subject)
        models.append('logistic deconvolution')

    print('finished subject ' + str(subject))

dict = {}
dict['subject'] = subjects
dict['model'] = models
dict['accuracy'] = scores

data = pd.DataFrame(dict)
        else:
            continue

        # Feature selection
        fmri_train, fmri_test = de.feature_selection(
            fmri_train, fmri_test, np.argmax(stimuli_train, axis=1), k=k)

        # Fit a ridge regression to predict the design matrix
        prediction_test, prediction_train, score = de.fit_ridge(
            fmri_train, fmri_test, design_train, design_test,
            double_prediction=True, extra=fmri_train)

        # Fit a logistic regression for deconvolution
        accuracy = de.logistic_deconvolution(
            prediction_train, prediction_test, stimuli_train,
            stimuli_test, logistic_window, delay=delay, balance=True,
            n_tests=n_tests, block=blocks, session_id_onset=session_id_onset)

        scores.append(accuracy)
        subjects.append(subject + 1)
        models.append('logistic deconvolution')
        isis.append(isi)

        print('Score for isi of {isi}: {score}'.format(isi=isi,
                                                       score=accuracy))

    print('finished subject ' + str(subject))

dict = {}
dict['subject'] = subjects
dict['model'] = models