Commit 55058799 authored by Mariam.Kherbek's avatar Mariam.Kherbek

(3) Edit on N-grams

parent 01b469f3
......@@ -276,6 +276,104 @@
"evaluate_method(3)"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Train Accuracy: 1.0\n",
"Test Accuracy: 0.8008658008658008\n",
"+---------------------------------+--------------------+--------------------+------------+-----------+\n",
"| Class | Precision | Recall | F1-score | Support |\n",
"|---------------------------------+--------------------+--------------------+------------+-----------|\n",
"| acne | 0.9473684210526315 | 0.9473684210526315 | 0.947368 | 19.0 |\n",
"| allergy | 0.7777777777777778 | 0.7368421052631579 | 0.756757 | 19.0 |\n",
"| arthritis | 0.7368421052631579 | 1.0 | 0.848485 | 14.0 |\n",
"| bronchial asthma | 0.5714285714285714 | 0.9411764705882353 | 0.711111 | 17.0 |\n",
"| cervical spondylosis | 1.0 | 1.0 | 1 | 21.0 |\n",
"| chicken pox | 0.5789473684210527 | 0.5789473684210527 | 0.578947 | 19.0 |\n",
"| common cold | 0.7777777777777778 | 0.7777777777777778 | 0.777778 | 18.0 |\n",
"| dengue | 0.2765957446808511 | 0.8125 | 0.412698 | 16.0 |\n",
"| diabetes | 1.0 | 0.5789473684210527 | 0.733333 | 19.0 |\n",
"| dimorphic hemorrhoids | 0.8947368421052632 | 1.0 | 0.944444 | 17.0 |\n",
"| drug reaction | 0.631578947368421 | 0.75 | 0.685714 | 16.0 |\n",
"| fungal infection | 0.9473684210526315 | 1.0 | 0.972973 | 18.0 |\n",
"| gastroesophageal reflux disease | 0.9333333333333333 | 0.6363636363636364 | 0.756757 | 22.0 |\n",
"| hypertension | 0.8947368421052632 | 0.9444444444444444 | 0.918919 | 18.0 |\n",
"| impetigo | 1.0 | 0.72 | 0.837209 | 25.0 |\n",
"| jaundice | 0.9444444444444444 | 1.0 | 0.971429 | 17.0 |\n",
"| malaria | 1.0 | 0.8695652173913043 | 0.930233 | 23.0 |\n",
"| migraine | 0.9444444444444444 | 0.8947368421052632 | 0.918919 | 19.0 |\n",
"| peptic ulcer disease | 0.9166666666666666 | 0.5 | 0.647059 | 22.0 |\n",
"| pneumonia | 1.0 | 0.7083333333333334 | 0.829268 | 24.0 |\n",
"| psoriasis | 0.9473684210526315 | 0.8181818181818182 | 0.878049 | 22.0 |\n",
"| typhoid | 1.0 | 0.4583333333333333 | 0.628571 | 24.0 |\n",
"| urinary tract infection | 0.7 | 0.875 | 0.777778 | 16.0 |\n",
"| varicose veins | 0.9444444444444444 | 1.0 | 0.971429 | 17.0 |\n",
"| accuracy | | | 0.800866 | |\n",
"| macro avg | 0.8485775238924734 | 0.8145215890282099 | 0.809801 | |\n",
"| weighted avg | 0.8647288526187902 | 0.8008658008658008 | 0.810413 | |\n",
"+---------------------------------+--------------------+--------------------+------------+-----------+\n"
]
}
],
"source": [
"evaluate_method(4)"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Train Accuracy: 1.0\n",
"Test Accuracy: 0.7077922077922078\n",
"+---------------------------------+---------------------+---------------------+------------+-----------+\n",
"| Class | Precision | Recall | F1-score | Support |\n",
"|---------------------------------+---------------------+---------------------+------------+-----------|\n",
"| acne | 0.9 | 0.9473684210526315 | 0.923077 | 19.0 |\n",
"| allergy | 0.7692307692307693 | 0.5263157894736842 | 0.625 | 19.0 |\n",
"| arthritis | 0.7647058823529411 | 0.9285714285714286 | 0.83871 | 14.0 |\n",
"| bronchial asthma | 0.6521739130434783 | 0.8823529411764706 | 0.75 | 17.0 |\n",
"| cervical spondylosis | 0.9545454545454546 | 1.0 | 0.976744 | 21.0 |\n",
"| chicken pox | 0.45 | 0.47368421052631576 | 0.461538 | 19.0 |\n",
"| common cold | 0.8666666666666667 | 0.7222222222222222 | 0.787879 | 18.0 |\n",
"| dengue | 0.16091954022988506 | 0.875 | 0.271845 | 16.0 |\n",
"| diabetes | 1.0 | 0.5263157894736842 | 0.689655 | 19.0 |\n",
"| dimorphic hemorrhoids | 0.9411764705882353 | 0.9411764705882353 | 0.941176 | 17.0 |\n",
"| drug reaction | 0.2857142857142857 | 0.5 | 0.363636 | 16.0 |\n",
"| fungal infection | 0.9 | 1.0 | 0.947368 | 18.0 |\n",
"| gastroesophageal reflux disease | 1.0 | 0.5909090909090909 | 0.742857 | 22.0 |\n",
"| hypertension | 0.8421052631578947 | 0.8888888888888888 | 0.864865 | 18.0 |\n",
"| impetigo | 1.0 | 0.28 | 0.4375 | 25.0 |\n",
"| jaundice | 0.9444444444444444 | 1.0 | 0.971429 | 17.0 |\n",
"| malaria | 1.0 | 0.8695652173913043 | 0.930233 | 23.0 |\n",
"| migraine | 1.0 | 0.7894736842105263 | 0.882353 | 19.0 |\n",
"| peptic ulcer disease | 1.0 | 0.45454545454545453 | 0.625 | 22.0 |\n",
"| pneumonia | 1.0 | 0.7083333333333334 | 0.829268 | 24.0 |\n",
"| psoriasis | 0.875 | 0.6363636363636364 | 0.736842 | 22.0 |\n",
"| typhoid | 1.0 | 0.375 | 0.545455 | 24.0 |\n",
"| urinary tract infection | 0.9 | 0.5625 | 0.692308 | 16.0 |\n",
"| varicose veins | 0.9375 | 0.8823529411764706 | 0.909091 | 17.0 |\n",
"| accuracy | | | 0.707792 | |\n",
"| macro avg | 0.8393409454155857 | 0.723372479995974 | 0.739326 | |\n",
"| weighted avg | 0.8568198474957226 | 0.7077922077922078 | 0.737445 | |\n",
"+---------------------------------+---------------------+---------------------+------------+-----------+\n"
]
}
],
"source": [
"evaluate_method(5)"
]
},
{
"cell_type": "code",
"execution_count": null,
......
......@@ -70,4 +70,12 @@
- **Applying classification task using POS tagger to perform task using only one tag, this includes:**
1. Testing ***Verbs*** only
1. Testing ***Adjectives*** only
1. Testing ***Nouns*** only
\ No newline at end of file
1. Testing ***Nouns*** only
**`3.3.N-Grams.ipynb`**
- **Applying classification task using n-gram to perform task using only TF-IDF with different grams, this includes:**
1. `1-Gram`
1. `2-Gram`
1. `3-Gram`
1. `4-Gram`
1. `5-Gram`
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment