Skip to content
Snippets Groups Projects
Commit 2fcf1370 authored by igraf's avatar igraf
Browse files

Update paths and file names

parent 68905859
No related branches found
No related tags found
No related merge requests found
......@@ -7,7 +7,7 @@
This directory contains the scripts used for the project:
- `classify_with_baseline.py` - Classify images using a random and a majority classifier.
- `classify_with_basic_classifiers.py` - Classify images using a decision tree, random forest or a naive bayes classifier.
- `find_optimal_parameters.py` - Helper script to find the optimal parameters for a decision tree, random forest or a naive bayes classifier.
- `find_optimal_parameters_basic.py` - Helper script to find the optimal parameters for a decision tree, random forest or a naive bayes classifier.
- `classify_with_CNN.py` - Classify images using a convolutional neural network.
- `evaluate_cnn.py` Evaluate the trained models and create plots
......
......@@ -26,7 +26,7 @@ from sklearn.metrics import accuracy_score, confusion_matrix, precision_recall_f
# Local imports for hyperparameter optimization
from find_optimal_parameters import find_best_params_for_decision_tree, find_best_params_for_random_forest, find_best_params_for_naive_bayes
from find_optimal_parameters_basic import find_best_params_for_decision_tree, find_best_params_for_random_forest, find_best_params_for_naive_bayes
def read_and_resize_image(image_path: str, resize: tuple) -> np.ndarray:
......@@ -324,7 +324,7 @@ def train_and_evaluate_classifier(classifier, dataset, feature_description, resi
logging.info(f"Confusion matrix saved to ../figures/{classifier_name[classifier.__name__]}/{classifier.__name__}_{feature_description}_confusion_matrix_{params_as_string}.png")
# Save the results to a simple text file
with open ("results.txt", "a") as f:
with open ("results_basic_classifiers.txt", "a") as f:
f.write(f"Results for {classifier.__name__} classifier on {feature_description} images:\n")
f.write(f"Optimal parameters: {params}\n")
f.write(str(results) + "\n\n")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment