Store model parameters in class as dictionaries and modify/add values

Viewed 445

I am running a set of different machine learning models and I want to create an object that can be sent throughout the code where things such as model parameters and directories are stored like this:

class model_parameters(object):
    def __init__(self):
        self.flags = {'clean': True,
                      'sampling': True}
        self.dirs  = {'inputs': '/inputs/',
                      'features': '/features/'} 

Most of these parameters are constant, but some I need to modify while running the code and for some dictionaries I also add values. I am not proficient enough with object-oriented programming to say first of all if this is the best way to go about this, and secondly how I would modify values,

for example change value of dirs['features'] to '/features/reduced/',

or adding values, for example to dirs add the key 'labels': '/labels/'.

1 Answers
Related