Beginning Anomaly Detection Using



Download 26,57 Mb.
Pdf ko'rish
bet140/283
Sana12.07.2021
Hajmi26,57 Mb.
#116397
1   ...   136   137   138   139   140   141   142   143   ...   283
Bog'liq
Beginning Anomaly Detection Using Python-Based Deep Learning

Figure 5-54.  The output shapes and some entries of y_test are displayed

Figure 5-55.  Initializing the model

The code to train the model is shown in Figure 

5-56

.

Figure 5-56.  Training the model on x_train, using x_test as validation data



Chapter 5   Boltzmann maChines


207

The output you should see is shown in Figure 

5-57

.

Figure 5-57.  The training output by the model for the code in Figure 



5-56

Since the labels aren’t binary, you want to redefine them as either normal, 0, or 

anomalous, 1. Run the code in Figure 

5-58


.

Chapter 5   Boltzmann maChines




208

The output you should see is shown in Figure 

5-59

.

Figure 5-58.  Code to change all labels that are 4 to 0, representing normal entries, 



and all labels that aren’t 4 to 1, representing anomalies

Figure 5-59.  The labels should now be transformed. Some of the entries in y_test 

are shown to make sure they were transformed correctly

Now that your labels have been corrected, you can get the free energy and find the 

AUC score (see Figure 

5-60


).

Figure 5-60.  Code to get the free energy for each model in x_test and then to find 

the AUC score based on that

Chapter 5   Boltzmann maChines




209

The output you should see is shown in Figure 

5-61

.

Figure 5-61.  The generated AUC score



That’s an even better AUC score than for the credit card data set! Let’s take a look 

at what happens when you plot the free energy vs. the probability. As with the previous 

example, let’s take a look at the five-number summary for the normal data to see how the 

distribution looks (Figure 

5-62

 and Figure 



5-63

).

Figure 5-62.  Code to check the five-number summary of the normal data

The output should look somewhat like Figure 

5-63


.

Figure 5-63.  It seems that the graph is skewed right, and that all of the values are 

under 1150

Chapter 5   Boltzmann maChines




210

Now let’s look at the five-number summary to see what the general distribution of 

the anomalous data looks like (see Figure 

5-64


 and Figure 

5-65


).


Download 26,57 Mb.

Do'stlaringiz bilan baham:
1   ...   136   137   138   139   140   141   142   143   ...   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