Bajardi: Xayitov Zuhriddin Tekshirdi: Raximov Mexriddin Toshkent – 2022 Naif Bayes algoritmiga kirish Naif Bayes algoritmlari


library(caret) # Определим условия перекрестной проверки: train_control


Download 205.48 Kb.
bet5/5
Sana25.01.2023
Hajmi205.48 Kb.
#1121806
1   2   3   4   5
Bog'liq
1670645990 (2)

library(caret)
# Определим условия перекрестной проверки:
train_control <- trainControl(method = 'cv', number = 10)
Test <- train(Species ~ ., data = iris, trControl = train_control, method = "nb")
print(Test)


## Naive Bayes
##
## 150 samples
## 4 predictor
## 3 classes: 'setosa', 'versicolor', 'virginica'
##
## No pre-processing
## Resampling: Cross-Validated (10 fold)
## Summary of sample sizes: 135, 135, 135, 135, 135, 135, ...
## Resampling results across tuning parameters:
##
## usekernel Accuracy Kappa
## FALSE 0.9533333 0.93
## TRUE 0.9600000 0.94
##
## Tuning parameter 'fL' was held constant at a value of 0
## Tuning
## parameter 'adjust' was held constant at a value of 1
## Accuracy was used to select the optimal model using the largest value.
## The final values used for the model were fL = 0, usekernel = TRUE
## and adjust = 1.
Acc <- mean(predict(Test$finalModel, iris[, -5])$class == iris$Species)
paste("Точность=", round(100*Acc, 2), "%", sep="")
## [1] "Точность=96%"


O'zaro tekshirish natijasida yaxshiroq modelni yaratishning iloji bo'lmadi, ammo o'quv va nazorat namunalarida tasniflagichning aniqligi doimiy ravishda yuqori bo'lib qoldi.

Xulosa:

Naive Bayes sinflashtilari yuqori darajada masshtabli boʻlib, oʻquv muammosidagi oʻzgaruvchilar soni boʻyicha chiziqli qator parametrlarni talab qiladi. Maksimal ehtimollik o'rgatish boshqa ko'plab klassifikatorlar uchun qo'llaniladigan qimmat iterativ yaqinlashish yo'li bilan emas, balki chiziqli vaqtni talab qiladigan yopiq shakldagi ifodani [3]: 718 baholash orqali amalga oshirilishi mumkin. muammoli misollarga sinf belgilarini tayinlaydigan modellar, xususiyat qiymatlari vektorlari sifatida taqdim etiladi ba'zi bir chekli to'plamdan olinadi.




Adabiyotlar:

https://en.wikipedia.org/wiki/Naive_Bayes_classifier


http://gerardnico.com/wiki/data_mining/naive_bayes
http://scikit-learn.org/stable/modules/naive_bayes.html
https://ranalytics.github.io/data-mining/072-NBC.html
Download 205.48 Kb.

Do'stlaringiz bilan baham:
1   2   3   4   5




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling