Hadin La Ariandi, Arief Setyanto, Sudarmawan
Jurnal Indonesia Sosial Teknologi, Vol. 5, No. 5, Mei 2024 2320
accuracy 0.99 129
macro avg 1.00 0.96 0.98 129
weighted avg 0.99 0.99 0.99 129
Accuracy value possessed by the model: 99.22 %
The above results can be explained. Precision is the ratio of correctly predicted
positive observations to predicted positive totals. The precision for the Ovale class is 1.00,
which means all class data predicted as the Ovale class is correct. The precision for the
Quartana class is 1.00, which means all class data predicted as the Quartana class is
correct. The precision for the Tertiana class is 0.98, which means that 98% of the class
data predicted as the Tertiana class is the Tertiana class. The precision for the Tropica
class is 1.00, which means all class data predicted as the Tropica class is correct. Recall
is the ratio of correctly predicted positive observations to all actual positives. The recall
for the Ovale, Quartana, and Tropica classes is 1.00, indicating that the model correctly
identifies all instances of those classes. The recall for the Tertiana class is 0.98, which
means the model manages to capture 98% of the actual instances of the Tertiana class.
The F1-Score is a weighted average of precision and recall. The range is from 0 to 1,
where 1 is the best F1-Score. The F1-Score for the Ovale and Tropica classes is 0.97,
reflecting a good balance between precision and recall for the Ovale and Tropica classes.
The F1-score for the Quartana class is 0.92, and the Tertiana class is 0.99, indicating a
somewhat lower balance between precision and recall for the Quartana class Tertiana
class compared to the Ovale class and Tropica class. Support indicates the actual number
of class occurrences in the specified dataset. There are 5 Ovale class data, 7 Quartana
class data, 61 Tertiana class data and 56 Tropica class data. The overall accuracy is
99.22%, representing the ratio of correctly predicted class data to total class data. Overall,
the model performs well, especially for Ovale-class, Tertiana-class and Tropica-class
data, achieving high precision and recall. For the Quartana class, the precision is perfect,
but the recall is slightly lower, showing some difficulty in capturing all the data for the
Quartana class (Shen & Shafiq, 2020).
Testing the naïve Bayes algorithm with split or 80/20 data division for code and
output results can be seen below.
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size = 0.20, random_state =
0)
y_pred = gnb.predict(X_test)
from sklearn import metrics
from sklearn.metrics import classification_report
cr1 = classification_report(y_test, y_pred)
akurasi = metrics.accuracy_score(y_test, y_pred)
print(cr1)
print ('The accuracy value possessed by the model: %0.2f ' %(akurasi*100),'%')