import imp


def load_model(model_name, X_train, y_train, optimization_parameters, sklearn_model=None):
    """
    Loads the base model model with the specific parameters

    :param model_name: the name of the model
    :param X_train: training data (# of samples x # of features)
    :param y_train: labels for the training data (# of samples * 1)
    :return: model object
   """

    model_source = imp.load_source(model_name, 'models/%s.py' % (model_name))
    model = model_source.Model(X_train, y_train, optimization_parameters, sklearn_model)
    return model