Persist Options

With the class persist options you can specify different locations where the result log of the hyperparameter search can be stored. You can save them into a file OR into a MongoDB (you can have both or you leave out one of the parameters). You also have the possibility to choose if you want to save all the predictions (Beware - may be infinitely large) and/or to store the feature importances of your models.

from photonai.base.PhotonBase import Hyperpipe, PersistOptions

mongo_settings = PersistOptions(mongodb_connect_url="mongodb://localhost:27017/photon_db",
                                save_predictions=False,
                                save_feature_importances=False,
                                local_file="my_tree.p",
                                log_filename="my_tree.log")


my_pipe = Hyperpipe('perfect_pipe',
                    ...,
                    persist_options=mongo_settings)

class PersistOptions

class PersistOptions:

    def __init__(self, mongodb_connect_url: str = None,
                 save_predictions: bool = False,
                 save_feature_importances: bool = False,
                 local_file: str = '',
                 log_filename: str = ''):

        self.mongodb_connect_url = mongodb_connect_url
        self.save_predictions = save_predictions
        # coef_ or feature_importances
        self.save_feature_importances = save_feature_importances
        self.local_file = local_file
        self.log_file = log_filename

Ancestors (in MRO)

Static methods

def __init__(self, mongodb_connect_url=None, save_predictions=False, save_feature_importances=False, local_file='', log_filename='')

Initialize self. See help(type(self)) for accurate signature.

def __init__(self, mongodb_connect_url: str = None,
             save_predictions: bool = False,
             save_feature_importances: bool = False,
             local_file: str = '',
             log_filename: str = ''):
    self.mongodb_connect_url = mongodb_connect_url
    self.save_predictions = save_predictions
    # coef_ or feature_importances
    self.save_feature_importances = save_feature_importances
    self.local_file = local_file
    self.log_file = log_filename

Instance variables

var local_file

var log_file

var mongodb_connect_url

var save_feature_importances

var save_predictions