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

Data Type

Choose the type of data you want to analyze.

Tabular Data

For simple data tables

Your data should be gathered in a single Excel table.

Nifti Data

Includes path to Nifti images

With this analysis you should provide Nifti images for every subject. Additionally, you can specify a brain mask to do a ROI-based analysis. The Nifti images will be loaded with the PHOTON Neuro module.

Data Quantity

Specify the number of samples available for this analysis.

Up to 100 samples

0 to 100

This will affect the recommended cross-validation strategy.

Between 101 and 500 samples

101 to 500

This will affect the recommended cross-validation strategy.

Between 501 and 5000 samples

501 to 5000

This will affect the recommended cross-validation strategy.

Between 5001 and 10000

5001 to 10000

This will affect the recommended cross-validation strategy.

More than 10000 examples

Lucky bastard

This will affect the recommended cross-validation strategy.

Analysis Type

Specify the type of your analysis.

Regression

continuous targets

Predicting a continuous-valued attribute associated with an object.

Classification

categorical targets

Identifying to which category an object belongs to.

                        
                            
# 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))
        
# Add transformer elements
preprocessing_pipe = Preprocessing()
hyperpipe += preprocessing_pipe
preprocessing_pipe += PipelineElement("LabelEncoder") 
                        
hyperpipe += PipelineElement("SimpleImputer", hyperparameters={}, 
                             test_disabled=False, missing_values=np.nan, strategy='mean', fill_value=0)
hyperpipe += PipelineElement("PCA", hyperparameters={}, 
                             test_disabled=False, n_components=0.8)
# Add estimator
estimator_switch = Switch('EstimatorSwitch')
estimator_switch += PipelineElement("RandomForestClassifier", hyperparameters={}, n_estimators=50, criterion='gini', max_depth=None, min_samples_split=2, min_samples_leaf=1)
estimator_switch += PipelineElement("GaussianProcessClassifier", hyperparameters={}, optimizer='fmin_l_bfgs_b', n_restarts_optimizer=0)
estimator_switch += PipelineElement("AdaBoostClassifier", hyperparameters={}, n_estimators=50, learning_rate=1)
estimator_switch += PipelineElement("SVC", hyperparameters={}, C=1, gamma='scale', max_iter=1000000.0, kernel='linear')
hyperpipe += estimator_switch                

                        
                    

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))
        
# Add transformer elements
preprocessing_pipe = Preprocessing()
hyperpipe += preprocessing_pipe
preprocessing_pipe += PipelineElement("LabelEncoder") 
                        
hyperpipe += PipelineElement("SimpleImputer", hyperparameters={}, 
                             test_disabled=False, missing_values=np.nan, strategy='mean', fill_value=0)
hyperpipe += PipelineElement("PCA", hyperparameters={}, 
                             test_disabled=False, n_components=0.8)
# Add estimator
estimator_switch = Switch('EstimatorSwitch')
estimator_switch += PipelineElement("RandomForestClassifier", hyperparameters={}, n_estimators=50, criterion='gini', max_depth=None, min_samples_split=2, min_samples_leaf=1)
estimator_switch += PipelineElement("GaussianProcessClassifier", hyperparameters={}, optimizer='fmin_l_bfgs_b', n_restarts_optimizer=0)
estimator_switch += PipelineElement("AdaBoostClassifier", hyperparameters={}, n_estimators=50, learning_rate=1)
estimator_switch += PipelineElement("SVC", hyperparameters={}, C=1, gamma='scale', max_iter=1000000.0, kernel='linear')
hyperpipe += estimator_switch