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=['mean_squared_error', 'mean_absolute_error', 'explained_variance'],
                      best_config_metric="mean_absolute_error",
                      outer_cv = KFold(n_splits=5,shuffle=True),
                      inner_cv = KFold(n_splits=3, shuffle=True))
        
# Add transformer elements
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("RandomForestRegressor", hyperparameters={}, n_estimators=50, criterion='mse', max_depth=None, min_samples_split=2, min_samples_leaf=1)
estimator_switch += PipelineElement("GaussianProcessRegressor", hyperparameters={}, optimizer='fmin_l_bfgs_b', n_restarts_optimizer=0, alpha=1e-10)
estimator_switch += PipelineElement("AdaBoostRegressor", hyperparameters={}, n_estimators=50, learning_rate=1, loss='linear')
estimator_switch += PipelineElement("SVR", hyperparameters={}, C=1, gamma='scale', max_iter=1000000.0, kernel='linear', epsilon=0.1)
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=['mean_squared_error', 'mean_absolute_error', 'explained_variance'],
                      best_config_metric="mean_absolute_error",
                      outer_cv = KFold(n_splits=5,shuffle=True),
                      inner_cv = KFold(n_splits=3, shuffle=True))
        
# Add transformer elements
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("RandomForestRegressor", hyperparameters={}, n_estimators=50, criterion='mse', max_depth=None, min_samples_split=2, min_samples_leaf=1)
estimator_switch += PipelineElement("GaussianProcessRegressor", hyperparameters={}, optimizer='fmin_l_bfgs_b', n_restarts_optimizer=0, alpha=1e-10)
estimator_switch += PipelineElement("AdaBoostRegressor", hyperparameters={}, n_estimators=50, learning_rate=1, loss='linear')
estimator_switch += PipelineElement("SVR", hyperparameters={}, C=1, gamma='scale', max_iter=1000000.0, kernel='linear', epsilon=0.1)
hyperpipe += estimator_switch