PHOTONAI

A high level Python API for designing and optimizing machine learning pipelines.

Learn more

Features

1

Easy Access to ML Implementations

We pre-registered diverse preprocessing and learning algorithms from state-of-the-art toolboxes e.g. scikit-learn, keras and imbalanced learn, which you can choose to rapidly build custom pipelines.

2

Hyperparameter Optimization

With PHOTONAI you can seamlessly switch between diverse hyperparameter optimization strategies, such as (random) grid-search or bayesian optimization (scikit-optimize, smac3).

3

Model Sharing

PHOTONAI provides a standardized format for sharing and loading optimized models and pipelines across platforms with only one line of code.

4

Extended ML Pipeline

You can build custom sequences of processing and learning algorithms with a simple syntax. PHOTONAI offers extended pipeline functionality such as parallel sequences, custom callbacks in-between pipeline elements, AND- and OR-Operations, as well as the possibility to flexibly position data augmentation, class balancing or learning algorithms anywhere in the pipeline.

5

Automation

While you concentrate on selecting appropriate processing steps, learning algorithms, hyperparameters and training parameters, PHOTONAI automates the nested cross-validated optimization and evaluation loop for any custom pipeline.

6

Result Logging

PHOTONAI comes with extensive logging of all information in the training, testing and hyperparameter optimization process. In addition, optimum performances and the hyperparameter optimization progress are visualized in the PHOTONAI Explorer.

Our software comes with a convenient way to explore and visualize your results.

The PHOTONAI Explorer visualize prepares your results, so you can explore your performance metrics, the best hyperparameter configuration, the hyperparameter optimization progress as well as other valuable figures!

Code Example

                               
imports ...

# DESIGN YOUR PIPELINE
my_pipe = Hyperpipe('basic_svm_pipe',  # the name of your pipeline
                    # which optimizer PHOTON shall use
                    optimizer='sk_opt',
                    optimizer_params={'n_configurations': 10},
                    # the performance metrics of your interest
                    metrics=['accuracy', 'precision', 'recall', 'balanced_accuracy'],
                    # this metric declares the winner hyperparameter config
                    best_config_metric='accuracy',
                    # repeat hyperparameter optimization three times
                    outer_cv=KFold(n_splits=3),
                    # test each configuration five times respectively,
                    inner_cv=KFold(n_splits=5))


# all algorithms are accessed via keyword and imported from scikit-learn
# first normalize all features
my_pipe.add(PipelineElement('StandardScaler'))

# then do feature selection using a PCA
my_pipe += PipelineElement('PCA',
                            hyperparameters={'n_components': IntegerRange(5, 20)},
                            test_disabled=True)

# engage and optimize the good old SVM for Classification
my_pipe += PipelineElement('SVC',
                            hyperparameters={'kernel': Categorical(['rbf', 'linear']),
                                             'C': FloatRange(0.5, 2)}, gamma='scale')

# train pipeline
X, y = load_breast_cancer(True)
my_pipe.fit(X, y)

                                
                         

Featured Examples

EASY ACCESS TO ESTABLISHED ML IMPLEMENTATIONS

PHOTONAI is especially well-suited in contexts such as applied machine learning research in medicine and the Life Sciences, which require iterative evaluation of novel approaches.

See our mission statement and give us a star on Github!

PHOTONAI ML ECOSYSTEM

Model Repository

Science needs exchange and cooperation.

We re-invented the wheel so many times in our work, that we feel the need to create a place where we can all share our best ideas - not as a paper, but in a form usable right away for everyone. Let others benefit from your work - benefit from others' work.


Explore the model repository