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

Update README.md

parent 7a9ca316
No related branches found
No related tags found
No related merge requests found
......@@ -34,9 +34,9 @@ The script `classify_with_baseline.py` classifies our image dataset using a rand
python classify_with_baseline.py [--include_sklearn]
```
| Parameter | Description | Choices / Examples |
| --------- | ----------- | ------- |
| `--include_sklearn` | Whether to include baseline implementation from scikit-learn in the plot. | |
| Parameter | Description |
| --------- | ----------- |
| `--include_sklearn` | Whether to include baseline implementation from scikit-learn in the plot. |
### 📊 Outputs
......@@ -48,7 +48,7 @@ Each run of the script will ...
## `classify_with_basic_classifiers.py`
The script `classify_with_basic_classifiers.py` is used to classify images using a decision tree, random forest or a naive bayes classifier. The script can be used to classify images using different filters and resizing the images to different image sizes. Additionally, the optimal parameters for the classifiers can be found using GridSearch.
The script `classify_with_basic_classifiers.py` is used to classify images using a decision tree, random forest or a naive bayes classifier. The script can be used to classify images using different filters and resizing the images to different image sizes. Additionally, the optimal parameters for the classifiers can be found using GridSearch. The script also allows for training on different subsets of the training data.
### 💻 Usage
......@@ -57,7 +57,7 @@ python classify_with_basic_classifiers.py --classifier <classifier_name> [--filt
```
**Example call:**
- Classify images using a decision tree classifier with the filters hsv and sobel and find the optimal parameters.
- Classify images using a decision tree classifier with the HSV and sobel filters and find the optimal parameters.
```bash
python classify_with_basic_classifiers.py -c DecisionTree --filters hsv sobel -o
......@@ -77,10 +77,10 @@ python classify_with_basic_classifiers.py -c DecisionTree --filters hsv sobel -o
Each run of the script will ...
- store the features and labels in a pickle file in the `../features` directory, if the file does not exist yet.
- write the accuracy, precision, recall and F1 scores to the console and to a simple text file `results.txt`
- write the accuracy, precision, recall and F1 scores to the console and to a simple text file `results_basic_classifiers.txt`
- save the **confusion matrix** to the respective classifier's directory in `../figures/`.
- save a heatmap showing the **feature importances** to the respective classifier's directory in `../figures/` (for random forest and decision tree classifiers).
- if the `--optimize` flag is set, a plot with the GridSearch results will be generated and saved.
- if the `--optimize` flag is set, the optimal hyperparameters will be found and a plot with the GridSearch results will be generated and saved.
- save the trained classifier to a pickle file in the `../trained_classifiers` directory.
## `classify_with_cnn.py`
......@@ -124,7 +124,7 @@ python evaluate_cnn.py <subset>
### 📊 Outputs
For the specified model subset, the script will:
- Print accuracy, precision (macro), recall (macro), and F1 score (macro) to the console for each data split (Train, Dev, Test).
- Print accuracy, precision (macro), recall (macro), and F1 score (macro) to the console for each data split (train, dev, test).
- Save plots of these metrics in `../figures/cnn/fruit_classifier_<subset>/`.
- Save a confusion matrix for each data split in the same directory.
- Display and save images of misclassified samples from the Test set.
- Display and save images of misclassified samples from the test set.
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