Add error handling at model choice

This commit is contained in:
coolneng 2020-11-10 22:02:47 +01:00
parent 525d231838
commit dfe85ab6ce
Signed by: coolneng
GPG Key ID: 9893DA236405AF57
1 changed files with 8 additions and 0 deletions

View File

@ -22,6 +22,14 @@ def choose_model(model):
return DecisionTreeClassifier(random_state=42) return DecisionTreeClassifier(random_state=42)
elif model == "neuralnet": elif model == "neuralnet":
return MLPClassifier(hidden_layer_sizes=10) return MLPClassifier(hidden_layer_sizes=10)
else:
print("Unknown model selected. The choices are: ")
print("gnb: Gaussian Naive Bayes")
print("svc: Linear Support Vector Classification")
print("knn: K-neighbors")
print("tree: Decision tree")
print("neuralnet: MLP Classifier")
exit()
def predict_data(data, target, model): def predict_data(data, target, model):