Skip to content

Commit aa96288

Browse files
authoredJun 8, 2023
Merge pull request #8 from DerikVo/readme
added more information to the conclusions in the evaluation notebook
2 parents e34a986 + 232fe86 commit aa96288

7 files changed

+60
-46
lines changed
 
-282 Bytes
Loading
Loading

‎Notebooks/01_EDA.ipynb

+3-9
Original file line numberDiff line numberDiff line change
@@ -634,17 +634,11 @@
634634
"metadata": {},
635635
"source": [
636636
"_________________________________________________________________________________________-\n",
637-
"# Conclusion"
638-
]
639-
},
640-
{
641-
"cell_type": "markdown",
642-
"id": "d267e36b-9eb2-4301-b186-c09e4ce65af0",
643-
"metadata": {},
644-
"source": [
637+
"# Conclusion\n",
638+
"\n",
645639
"Overall, our classes are balanced between the classes 'glioma', 'meningioma', 'notumor', and 'pituitary' in both our training and testing datasets. Additionally when looking at the average pixel value and the contrast between those average we can see some distinct features within those classes. This indicates that there are features that our model can learn to distinguish images into classes.\n",
646640
"\n",
647-
"We will know move onto building [A baseine model](../Notebooks/02_Baseline Model.ipynb)"
641+
"We will know move onto building [A baseline model](../Notebooks/01_EDA.ipynb) to compare our results."
648642
]
649643
}
650644
],

‎Notebooks/02_Baseline Model.ipynb

+3-1
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,9 @@
159159
"# Conclusion:\n",
160160
"\n",
161161
"\n",
162-
"Our baseline model has an accuracy of 46% which is better than simply guessing one class. This model simply compares which class an image belongs to by seeing the avg pixel value of a class and the image and seeing which class the image is closest to. \n",
162+
"Our baseline model has an accuracy of 46% which is better than simply guessing one class. This model simply compares which class an image belongs to by seeing the avg pixel value of a class and the image and seeing which class the image is closest to.\n",
163+
"\n",
164+
"With our baseline our most accurate classification is no tumor and glioma.\n",
163165
"\n",
164166
"We will now move into a more complex mode, a [neural network](../Notebooks/03_Neural_network.ipynb), to classify our images."
165167
]

‎Notebooks/04_Model_evaluation.ipynb

+40-29
Large diffs are not rendered by default.

‎Notebooks/scores.csv

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
,Accuracy,Precision,Recall,F1 Score
22
baseline,0.4698703279938978,0.4683084749604378,0.4698703279938978,0.4635669509975083
3-
Neural Network: No regularization,0.8779557589626239,0.875790866125634,0.8779557589626239,0.8729339270233065
4-
Neural Network: With Regularization,0.8527841342486652,0.849915756851124,0.8527841342486652,0.8447039064139434
5-
Neural Network,0.8749046529366895,0.8738431092045584,0.8749046529366895,0.8672969669842382
6-
Neural Network: regularization,0.8421052631578947,0.8403497250779882,0.8421052631578947,0.8293207661173666
3+
Neural Network: No regularization,0.8749046529366895,0.8738431092045584,0.8749046529366895,0.8672969669842382
4+
Neural Network: With Regularization,0.8421052631578947,0.8403497250779882,0.8421052631578947,0.8293207661173666

‎modules/model.py

+12-3
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def avg_images(class_name, dataset='Training'):
4646
'''
4747
The Code was originally developed by chat GPT 3 with the prompt: "I want to find the average pixel value of each class and then use the mean of an image to find which class it belongs to. The path to the class looks like '../Images/Training/glioma/' the classes are 'glioma', 'meningioma', 'notumor', 'pituitary'"
4848
49-
was later prompted to adjust the code to be able to pass a parameter to the classify_images function. Took a total of 8 prompts and manual adjustments.
49+
was later prompted to adjust the code to be able to pass a parameter to the classify_images function. Took a total of 8 prompts and 3 manual adjustments.
5050
'''
5151
def find_closest_class(mean_pixel_value, class_averages):
5252
'''
@@ -75,7 +75,7 @@ def find_closest_class(mean_pixel_value, class_averages):
7575
'''
7676
The Code was originally developed by chat GPT 3 with the prompt: "How do I dynamically classify images using the folder they are in as a class. Please use the OS module"
7777
78-
was later prompted to adjust the code to be able to pass a parameter to the find_closest_class function. Took a total of 8 prompts and manual adjustments.
78+
was later prompted to adjust the code to be able to pass a parameter to the find_closest_class function.
7979
'''
8080
def classify_images(test_folder_path, class_paths):
8181
'''
@@ -185,7 +185,16 @@ def plot_confusion_matrix(confusion_matrix, class_paths, title):
185185
#displays the image
186186
plt.show()
187187

188-
188+
'''
189+
190+
Creating a the data frame borrowed ideas from a one day hack-a-thon
191+
https://github.com/DerikVo/NN_hackathon
192+
193+
Converting a dictionary was taken from: https://stackoverflow.com/questions/18837262/convert-python-dict-into-a-dataframe
194+
195+
originally tried using functions that's only found in pandas 2.0
196+
197+
'''
189198

190199
def model_metrics(true_classes, predicted_classes, title):
191200
'''

0 commit comments

Comments
 (0)
Please sign in to comment.