PHOTONAI Wizard

Yeah! Let's start a new pipeline. We just want to make sure you know that all of your current choices are then replaced with a fresh and empty pipeline.

Start new Cancel

Analysis Name

Specify a name for this analysis.

Project Description

Please provide a short description of your project.

Project Folder

Please give a local directory for your photon analysis

                        
                            
# Specify how results are going to be saved
# Define hyperpipe
hyperpipe = Hyperpipe('None',
                      project_folder = './results',
                      optimizer="random_grid_search",
                      optimizer_params={'n_configurations': 30},
                      metrics=['accuracy', 'balanced_accuracy', 'specificity', 'sensitivity'],
                      best_config_metric="balanced_accuracy",
                      outer_cv = KFold(n_splits=5,shuffle=True),
                      inner_cv = KFold(n_splits=3, shuffle=True),
                      verbosity=2)
        
# Add neuro elements
neuro_branch = NeuroBranch('Neuro', nr_of_processes=3)
neuro_branch += PipelineElement('BrainMask', hyperparameters={}, mask_image='MNI_ICBM152_GrayMatter',
                                extract_mode='vec', batch_size=50)
hyperpipe += neuro_branch
            
# Add transformer elements
preprocessing_pipe = Preprocessing()
hyperpipe += preprocessing_pipe
preprocessing_pipe += PipelineElement("LabelEncoder") 
                        
hyperpipe += PipelineElement("PCA", hyperparameters={}, 
                             test_disabled=False, n_components=0.8)
hyperpipe += PipelineElement("SVC", hyperparameters={}, C=1, gamma='scale', max_iter=1000000.0, kernel='linear')

                        
                    

PHOTON SYNTAX

                    
                        
# Specify how results are going to be saved
# Define hyperpipe
hyperpipe = Hyperpipe('None',
                      project_folder = './results',
                      optimizer="random_grid_search",
                      optimizer_params={'n_configurations': 30},
                      metrics=['accuracy', 'balanced_accuracy', 'specificity', 'sensitivity'],
                      best_config_metric="balanced_accuracy",
                      outer_cv = KFold(n_splits=5,shuffle=True),
                      inner_cv = KFold(n_splits=3, shuffle=True),
                      verbosity=2)
        
# Add neuro elements
neuro_branch = NeuroBranch('Neuro', nr_of_processes=3)
neuro_branch += PipelineElement('BrainMask', hyperparameters={}, mask_image='MNI_ICBM152_GrayMatter',
                                extract_mode='vec', batch_size=50)
hyperpipe += neuro_branch
            
# Add transformer elements
preprocessing_pipe = Preprocessing()
hyperpipe += preprocessing_pipe
preprocessing_pipe += PipelineElement("LabelEncoder") 
                        
hyperpipe += PipelineElement("PCA", hyperparameters={}, 
                             test_disabled=False, n_components=0.8)
hyperpipe += PipelineElement("SVC", hyperparameters={}, C=1, gamma='scale', max_iter=1000000.0, kernel='linear')