Beginning Anomaly Detection Using



Download 26,57 Mb.
Pdf ko'rish
bet57/283
Sana12.07.2021
Hajmi26,57 Mb.
#116397
1   ...   53   54   55   56   57   58   59   60   ...   283
Bog'liq
Beginning Anomaly Detection Using Python-Based Deep Learning

random_state is just a seed for initializing the 

random number generator, similar to the isolation forest model. The next parameter, 



nu

specifies how much of the training set contains outliers. Again, you set this to 0.1, similar 

to the isolation forest model. This acts similar to the regularization parameter that you 

saw earlier, since it tells the model approximately how many data points you expect the 

model to misclassify.

Now let’s train the model and evaluate predictions (see Figure 

2-49

).

Figure 2-47.  Printing the output shapes of the training, testing, and validation sets



ocsvm = OneClassSVM(kernel='rbf', gamma=0.00005, random_state = 

42, nu=0.1)



Figure 2-48.  Defining your OC-SVM model

Chapter 2   traditional Methods of anoMaly deteCtion




67

One thing to note is that you can’t get the values for an AUC curve for x_test and 

x_validation since they comprise entirely of normal data values. You can’t get values for 

true negative or for false positive since there are no anomalies in the data set to classify 

falsely as normal or correctly as anomalies.

However, you can still measure the accuracy of the model on the test and validation 

sets. Even though accuracy is not the best metric to go by, it can still give you a good 

indicator of the model’s performance.

Also one thing to note: Accuracy in this case is a measure of the percentage of 

data points in the predictions that are normal data points. Remember, you assumed 

that around 10% of the data points in the data set are anomalies, so the most optimal 

“accuracy” to obtain is 90%.

Run the code in Figure 

2-50


.

RFVYPILW [BWUDLQ




Download 26,57 Mb.

Do'stlaringiz bilan baham:
1   ...   53   54   55   56   57   58   59   60   ...   283




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

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish