Beginning Anomaly Detection Using



Download 26,57 Mb.
Pdf ko'rish
bet47/283
Sana12.07.2021
Hajmi26,57 Mb.
#116397
1   ...   43   44   45   46   47   48   49   50   ...   283
Bog'liq
Beginning Anomaly Detection Using Python-Based Deep Learning

n_estimators is the number of trees to use in the forest. The default  

is 100.

• 

max_samples is the maximum number of data points that the 

tree should build on. The default is whatever is smaller: 256 or the 

number of samples in the data set.

• 

contamination is an estimate of the percentage of the entire data set 

that should be considered an anomaly/outlier. It is 0.1 by default.

• 

random_state is the number it will initialize the random number 

generator with to use during the training process. An isolation forest 

utilizes the random number generator quite extensively during the 

training process.

Now, let’s train your isolation forest model by running

isolation_forest.fit(x_train)

This process will take some time, so get up and stretch for a bit!

Once it’s finished, you can go about calculating the anomaly scores. Let’s create a 

histogram of the anomaly scores when tested on the validation set.

Run the code in Figure 

2-22

.

Figure 2-21.  Getting the shapes of the training, testing, and validation data sets



Chapter 2   traditional Methods of anoMaly deteCtion


48

You should see a graph that looks like Figure 

2-23

.

anomaly_scores = isolation_forest.decision_function(x_val)



plt.figure(figsize=(15, 10))

plt.hist(anomaly_scores, bins=100)

plt.xlabel('Average Path Lengths', fontsize=14)

plt.ylabel('Number of Data Points', fontsize=14)

plt.show()


Download 26,57 Mb.

Do'stlaringiz bilan baham:
1   ...   43   44   45   46   47   48   49   50   ...   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