def get_model(x, y, model_config): if model_config["model"]["type"] == "regression": regression_model = PolynomialRegressionModel( model_config["model_name"], model_config["model"]["polynomial_degree"]) regression_model.train(x, y) return regression_model elif model_config["model"]["type"] == "neural_net": neural_net_model = NeuralNetModel(model_config["model_name"]) neural_net_model.train(x, y, model_config["model"]) return neural_net_model return None
def get_model(x, y, model_config): if model_config["model"]["type"] == "regression": regression_model = PolynomialRegressionModel( model_config["model_name"], model_config["model"]["polynomial_degree"]) regression_model.train(x, y) return regression_model elif model_config["model"]["type"] == "neural_net": neural_net_model = NeuralNetModel(model_config["model_name"]) neural_net_model.train(x, y, model_config["model"]["hidden_layer_sizes"], model_config["model"]["learning_rate"], model_config["model"]["max_iter"]) return neural_net_model return None