Prediksi Curah Hujan di Australia Menggunakan Decision Tree

Moh. Ainur Rohman dan Prof. Dr. Suhartono, M.Kom.

UIN Maulana Malik Ibrahim Malang

Magister Informatika
26 November 2021

Decision tree (pohon keputusan) kerap kali dipakai untuk mengklasifikasikan suatu masalah dan menemukan solusi akhir yang digambarkan ke dalam bentuk pohon. Decision tree dapat dengan mudah diubah ke aturan konversi, dapat dilakukan secara otomatis dengan program komputer. Sebenarnya algoritma machine learning dapat mengekstraksi pohon keputusan secara otomatis dan mengkonversinya ke rule-based. Definisi decision tree adalah pohon yang ada dalam analisa pemecahan masalah, pemetaan mengenai alternatif-alternatif pemecahan masalah yang dapat diambil dari masalah tersebut. Simpul ke akar ke simpul daun digunakan memprediksi class dalam penelusuran rule pada decision tree [1][2]. Berikut persamaan decision tree:

\(Entropy(S)=\sum\limits_{i=1}^n -\mathcal{P_i}\log_{2}(\mathcal{P_i})\)

Dimana:
S = Himpunan kasus
n = jumlah partisi S
Pi = proporsi Si terhadap S

menghitung nilai gain menggunakan formula sebagai berikut:

\(Gain(S,A)=entropy(S)-\sum\limits_{i=1}^n \frac{|S_i|}{S} * Entropy(S_i)\)

Dimana:
S = Himpunan kasus
A = Fitur
n = Jumlah partisi atribut A
|Si| = Proporsi Si terhadap S
|S| = Jumlah kasus dalam S

Pada materi kali ini penerapan algoritma decision tree diterapkan pada prediksi curah hujan di Australia dan untuk dataset dari kaggle user “Joe Young”

Import Library

library(dplyr) #Data preprocessing
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
library(party) #Decision tree
## Loading required package: grid
## Loading required package: mvtnorm
## Loading required package: modeltools
## Loading required package: stats4
## Loading required package: strucchange
## Loading required package: zoo
## 
## Attaching package: 'zoo'
## The following objects are masked from 'package:base':
## 
##     as.Date, as.Date.numeric
## Loading required package: sandwich

Import Dataset

data = read.csv("data/weatherAUS.csv", header = TRUE)

Data Preprocessing

Sebelum data dianalisis, data harus melewati tahap preprocessing terlebih dahulu. Kenapa begitu ? karena datanya masih kotor. Kotor dalam artian terdapat missing value, outlier, dll

Untuk menangani missing value, kita menggunakan metode mean, yaitu mencari nilai rata-rata dari atribute tersebut

rawdata1=data
for(i in 1:ncol(rawdata1)){
  rawdata1[is.na(rawdata1[,i]), i] <- mean(rawdata1[,i], na.rm = TRUE)
}
## Warning in mean.default(rawdata1[, i], na.rm = TRUE): argument is not numeric or
## logical: returning NA

## Warning in mean.default(rawdata1[, i], na.rm = TRUE): argument is not numeric or
## logical: returning NA

## Warning in mean.default(rawdata1[, i], na.rm = TRUE): argument is not numeric or
## logical: returning NA

## Warning in mean.default(rawdata1[, i], na.rm = TRUE): argument is not numeric or
## logical: returning NA

## Warning in mean.default(rawdata1[, i], na.rm = TRUE): argument is not numeric or
## logical: returning NA

## Warning in mean.default(rawdata1[, i], na.rm = TRUE): argument is not numeric or
## logical: returning NA

## Warning in mean.default(rawdata1[, i], na.rm = TRUE): argument is not numeric or
## logical: returning NA

Dan untuk menangani missing value pada data kategorial kita menangani dengan cara menghapus data tersebut

rawdata2 = rawdata1
rawdata2 <- na.omit(rawdata1)

Perlu diketahui, bahwasanya decision tree ini tidak menerima data bertipe “chr / character”. Oleh karena itu, data bertipe chr tersebut harus kita konversi ke data bertipe factor

Data sebelum dikonversi ke factor:

str(rawdata2)
## 'data.frame':    123710 obs. of  23 variables:
##  $ Date         : chr  "2008-12-01" "2008-12-02" "2008-12-03" "2008-12-04" ...
##  $ Location     : chr  "Albury" "Albury" "Albury" "Albury" ...
##  $ MinTemp      : num  13.4 7.4 12.9 9.2 17.5 14.6 14.3 7.7 9.7 13.1 ...
##  $ MaxTemp      : num  22.9 25.1 25.7 28 32.3 29.7 25 26.7 31.9 30.1 ...
##  $ Rainfall     : num  0.6 0 0 0 1 0.2 0 0 0 1.4 ...
##  $ Evaporation  : num  5.47 5.47 5.47 5.47 5.47 ...
##  $ Sunshine     : num  7.61 7.61 7.61 7.61 7.61 ...
##  $ WindGustDir  : chr  "W" "WNW" "WSW" "NE" ...
##  $ WindGustSpeed: num  44 44 46 24 41 56 50 35 80 28 ...
##  $ WindDir9am   : chr  "W" "NNW" "W" "SE" ...
##  $ WindDir3pm   : chr  "WNW" "WSW" "WSW" "E" ...
##  $ WindSpeed9am : num  20 4 19 11 7 19 20 6 7 15 ...
##  $ WindSpeed3pm : num  24 22 26 9 20 24 24 17 28 11 ...
##  $ Humidity9am  : num  71 44 38 45 82 55 49 48 42 58 ...
##  $ Humidity3pm  : num  22 25 30 16 33 23 19 19 9 27 ...
##  $ Pressure9am  : num  1008 1011 1008 1018 1011 ...
##  $ Pressure3pm  : num  1007 1008 1009 1013 1006 ...
##  $ Cloud9am     : num  8 4.45 4.45 4.45 7 ...
##  $ Cloud3pm     : num  4.51 4.51 2 4.51 8 ...
##  $ Temp9am      : num  16.9 17.2 21 18.1 17.8 20.6 18.1 16.3 18.3 20.1 ...
##  $ Temp3pm      : num  21.8 24.3 23.2 26.5 29.7 28.9 24.6 25.5 30.2 28.2 ...
##  $ RainToday    : chr  "No" "No" "No" "No" ...
##  $ RainTomorrow : chr  "No" "No" "No" "No" ...
##  - attr(*, "na.action")= 'omit' Named int [1:21750] 15 16 27 65 66 76 87 89 90 96 ...
##   ..- attr(*, "names")= chr [1:21750] "15" "16" "27" "65" ...

Proses konversi data chr ke factor:

rawdata2 <- rawdata2 %>%
  mutate(across(where(is.character), as.factor))

Data setelah dikonversi ke factor:

str(rawdata2)
## 'data.frame':    123710 obs. of  23 variables:
##  $ Date         : Factor w/ 3417 levels "2007-11-01","2007-11-02",..: 378 379 380 381 382 383 384 385 386 387 ...
##  $ Location     : Factor w/ 47 levels "Adelaide","Albury",..: 2 2 2 2 2 2 2 2 2 2 ...
##  $ MinTemp      : num  13.4 7.4 12.9 9.2 17.5 14.6 14.3 7.7 9.7 13.1 ...
##  $ MaxTemp      : num  22.9 25.1 25.7 28 32.3 29.7 25 26.7 31.9 30.1 ...
##  $ Rainfall     : num  0.6 0 0 0 1 0.2 0 0 0 1.4 ...
##  $ Evaporation  : num  5.47 5.47 5.47 5.47 5.47 ...
##  $ Sunshine     : num  7.61 7.61 7.61 7.61 7.61 ...
##  $ WindGustDir  : Factor w/ 16 levels "E","ENE","ESE",..: 14 15 16 5 14 15 14 14 7 14 ...
##  $ WindGustSpeed: num  44 44 46 24 41 56 50 35 80 28 ...
##  $ WindDir9am   : Factor w/ 16 levels "E","ENE","ESE",..: 14 7 14 10 2 14 13 11 10 9 ...
##  $ WindDir3pm   : Factor w/ 16 levels "E","ENE","ESE",..: 15 16 16 1 8 14 14 14 8 11 ...
##  $ WindSpeed9am : num  20 4 19 11 7 19 20 6 7 15 ...
##  $ WindSpeed3pm : num  24 22 26 9 20 24 24 17 28 11 ...
##  $ Humidity9am  : num  71 44 38 45 82 55 49 48 42 58 ...
##  $ Humidity3pm  : num  22 25 30 16 33 23 19 19 9 27 ...
##  $ Pressure9am  : num  1008 1011 1008 1018 1011 ...
##  $ Pressure3pm  : num  1007 1008 1009 1013 1006 ...
##  $ Cloud9am     : num  8 4.45 4.45 4.45 7 ...
##  $ Cloud3pm     : num  4.51 4.51 2 4.51 8 ...
##  $ Temp9am      : num  16.9 17.2 21 18.1 17.8 20.6 18.1 16.3 18.3 20.1 ...
##  $ Temp3pm      : num  21.8 24.3 23.2 26.5 29.7 28.9 24.6 25.5 30.2 28.2 ...
##  $ RainToday    : Factor w/ 2 levels "No","Yes": 1 1 1 1 1 1 1 1 1 2 ...
##  $ RainTomorrow : Factor w/ 2 levels "No","Yes": 1 1 1 1 1 1 1 1 2 1 ...
##  - attr(*, "na.action")= 'omit' Named int [1:21750] 15 16 27 65 66 76 87 89 90 96 ...
##   ..- attr(*, "names")= chr [1:21750] "15" "16" "27" "65" ...

Data Analisis

Pada tahap analisis, data dibagi menjadi 2 yaitu data untuk training (belajar) data untuk testing (pengujian). Untuk proporsinya sendiri 80:20. Yakni 80% data training 20% data testing.

set.seed(1234)
hujan <- sample(2, nrow(rawdata2), replace = TRUE, prob = c(0.8, 0.2))

trainData <- rawdata2[hujan==1,]
testData <- rawdata2[hujan==2,]

Kemudian kita membuat predictor, attribute RainTomorrow sebagai class/label, attribute yang lain sebagai parameter. Akan tetapi pada attribute RISK_MM tidak digunakan. Kenapa bisa begitu ? Permasalahan ini sudah dibahas Disini.

#Membuat model
predictor <- RainTomorrow~MinTemp+MaxTemp+Rainfall+Evaporation+Sunshine+WindGustDir+WindGustSpeed+WindDir9am+WindDir3pm+WindSpeed9am+WindSpeed3pm+Humidity9am+Humidity3pm+Pressure9am+Pressure3pm+Cloud9am+Cloud3pm+Temp9am+Temp3pm+RainToday

Data training yang sudah diambil 80% dari dataset kemudian dimasukkan pada model decision tree

tree <- ctree(predictor, data = trainData)

Dan membentuk sebuah rule

Catatan: untuk hasil plot karena saking banyaknya attribute dan keterbatasan ukuran LCD maka bentuknya seakan-akan abstrak

tree
## 
##   Conditional inference tree with 289 terminal nodes
## 
## Response:  RainTomorrow 
## Inputs:  MinTemp, MaxTemp, Rainfall, Evaporation, Sunshine, WindGustDir, WindGustSpeed, WindDir9am, WindDir3pm, WindSpeed9am, WindSpeed3pm, Humidity9am, Humidity3pm, Pressure9am, Pressure3pm, Cloud9am, Cloud3pm, Temp9am, Temp3pm, RainToday 
## Number of observations:  99100 
## 
## 1) Humidity3pm <= 71; criterion = 1, statistic = 20110.855
##   2) Humidity3pm <= 51; criterion = 1, statistic = 4702.75
##     3) WindGustSpeed <= 52; criterion = 1, statistic = 2199.95
##       4) Sunshine <= 7.5; criterion = 1, statistic = 1189.503
##         5) Pressure3pm <= 1015; criterion = 1, statistic = 229.143
##           6) WindDir3pm == {E, ENE, ESE, SE, SSE, SSW, SW, WSW}; criterion = 1, statistic = 88.651
##             7) MinTemp <= 14.1; criterion = 0.999, statistic = 33.149
##               8)*  weights = 270 
##             7) MinTemp > 14.1
##               9) WindGustDir == {E, ENE, ESE, NE, NNW, NW, S, SE, SSE, SSW, SW, WSW}; criterion = 0.986, statistic = 38.677
##                 10) WindSpeed9am <= 7; criterion = 0.986, statistic = 11.53
##                   11) Evaporation <= 10; criterion = 0.965, statistic = 21.758
##                     12)*  weights = 50 
##                   11) Evaporation > 10
##                     13)*  weights = 9 
##                 10) WindSpeed9am > 7
##                   14)*  weights = 362 
##               9) WindGustDir == {N, NNE, W, WNW}
##                 15)*  weights = 65 
##           6) WindDir3pm == {N, NE, NNE, NNW, NW, S, W, WNW}
##             16) Humidity3pm <= 26; criterion = 1, statistic = 42.479
##               17)*  weights = 165 
##             16) Humidity3pm > 26
##               18) Sunshine <= 2; criterion = 1, statistic = 41.39
##                 19)*  weights = 138 
##               18) Sunshine > 2
##                 20) Pressure3pm <= 1004.4; criterion = 0.998, statistic = 24.358
##                   21)*  weights = 76 
##                 20) Pressure3pm > 1004.4
##                   22) Cloud3pm <= 4; criterion = 0.999, statistic = 29.003
##                     23)*  weights = 115 
##                   22) Cloud3pm > 4
##                     24)*  weights = 533 
##         5) Pressure3pm > 1015
##           25) Pressure3pm <= 1020.4; criterion = 1, statistic = 65.117
##             26) WindDir3pm == {E, SE, SSW, SW, W}; criterion = 0.999, statistic = 47.561
##               27)*  weights = 437 
##             26) WindDir3pm == {ENE, ESE, N, NE, NNE, NNW, NW, S, SSE, WNW, WSW}
##               28) Sunshine <= 0.8; criterion = 1, statistic = 36.005
##                 29)*  weights = 41 
##               28) Sunshine > 0.8
##                 30) Rainfall <= 10.4; criterion = 0.999, statistic = 38.579
##                   31) WindGustDir == {NNE, NW, SSW, WNW}; criterion = 0.988, statistic = 39.271
##                     32) Sunshine <= 4.6; criterion = 0.995, statistic = 20.398
##                       33)*  weights = 67 
##                     32) Sunshine > 4.6
##                       34)*  weights = 136 
##                   31) WindGustDir == {E, ENE, ESE, N, NE, NNW, S, SE, SSE, SW, W, WSW}
##                     35)*  weights = 616 
##                 30) Rainfall > 10.4
##                   36)*  weights = 11 
##           25) Pressure3pm > 1020.4
##             37) Rainfall <= 2.8; criterion = 1, statistic = 31.287
##               38) WindGustDir == {ENE, ESE, N, NE, NNE, NW, S, SE, SSE, SSW, SW, W, WNW, WSW}; criterion = 0.968, statistic = 36.29
##                 39) Sunshine <= 3.2; criterion = 0.95, statistic = 23.903
##                   40)*  weights = 162 
##                 39) Sunshine > 3.2
##                   41)*  weights = 681 
##               38) WindGustDir == {E, NNW}
##                 42) WindDir3pm == {E, ENE, ESE, N, NE, NNW, S, SE, SW, W, WSW}; criterion = 0.951, statistic = 33.387
##                   43)*  weights = 108 
##                 42) WindDir3pm == {NNE, NW, SSE, WNW}
##                   44)*  weights = 24 
##             37) Rainfall > 2.8
##               45) Sunshine <= 5.1; criterion = 0.989, statistic = 22.271
##                 46)*  weights = 25 
##               45) Sunshine > 5.1
##                 47)*  weights = 44 
##       4) Sunshine > 7.5
##         48) Pressure3pm <= 1011.4; criterion = 1, statistic = 477.881
##           49) Humidity3pm <= 27; criterion = 1, statistic = 214.154
##             50) Sunshine <= 9.3; criterion = 1, statistic = 56.408
##               51) Humidity3pm <= 17; criterion = 1, statistic = 36.521
##                 52) Cloud3pm <= 6; criterion = 0.999, statistic = 22.791
##                   53) Pressure3pm <= 1004.3; criterion = 1, statistic = 20.363
##                     54)*  weights = 69 
##                   53) Pressure3pm > 1004.3
##                     55)*  weights = 700 
##                 52) Cloud3pm > 6
##                   56)*  weights = 58 
##               51) Humidity3pm > 17
##                 57) WindGustSpeed <= 46; criterion = 0.975, statistic = 34.175
##                   58)*  weights = 768 
##                 57) WindGustSpeed > 46
##                   59)*  weights = 193 
##             50) Sunshine > 9.3
##               60)*  weights = 1814 
##           49) Humidity3pm > 27
##             61) Sunshine <= 10.2; criterion = 1, statistic = 94.649
##               62) WindDir3pm == {E, ENE, ESE, S, SE, SSE, SSW, SW, W, WNW, WSW}; criterion = 1, statistic = 75.662
##                 63) Cloud3pm <= 5; criterion = 1, statistic = 26.177
##                   64) Humidity3pm <= 38; criterion = 1, statistic = 26.362
##                     65) WindGustDir == {ENE, N, NE, NNE, NNW, SSE}; criterion = 0.976, statistic = 37.111
##                       66)*  weights = 153 
##                     65) WindGustDir == {E, ESE, NW, S, SE, SSW, SW, W, WNW, WSW}
##                       67) MaxTemp <= 27.4; criterion = 0.97, statistic = 27.166
##                         68) WindDir9am == {ESE, N, NE, NNE, NNW, S, SE, SSE, SSW, SW, W, WNW, WSW}; criterion = 1, statistic = 126.366
##                           69)*  weights = 268 
##                         68) WindDir9am == {E, ENE, NW}
##                           70) WindGustDir == {E, NW, S, SSW, WNW, WSW}; criterion = 0.997, statistic = 30.986
##                             71)*  weights = 33 
##                           70) WindGustDir == {SE, SW, W}
##                             72)*  weights = 14 
##                       67) MaxTemp > 27.4
##                         73)*  weights = 353 
##                   64) Humidity3pm > 38
##                     74) Humidity9am <= 65; criterion = 0.999, statistic = 24.624
##                       75)*  weights = 481 
##                     74) Humidity9am > 65
##                       76)*  weights = 576 
##                 63) Cloud3pm > 5
##                   77) WindGustSpeed <= 46; criterion = 0.962, statistic = 18.498
##                     78)*  weights = 332 
##                   77) WindGustSpeed > 46
##                     79)*  weights = 93 
##               62) WindDir3pm == {N, NE, NNE, NNW, NW}
##                 80) WindGustSpeed <= 37; criterion = 1, statistic = 36.108
##                   81) Temp9am <= 21.7; criterion = 0.997, statistic = 14.859
##                     82)*  weights = 254 
##                   81) Temp9am > 21.7
##                     83)*  weights = 194 
##                 80) WindGustSpeed > 37
##                   84) Rainfall <= 17.4; criterion = 0.993, statistic = 12.843
##                     85)*  weights = 575 
##                   84) Rainfall > 17.4
##                     86)*  weights = 17 
##             61) Sunshine > 10.2
##               87) Pressure3pm <= 1002.7; criterion = 0.999, statistic = 25.233
##                 88)*  weights = 37 
##               87) Pressure3pm > 1002.7
##                 89)*  weights = 1855 
##         48) Pressure3pm > 1011.4
##           90) Humidity3pm <= 38; criterion = 1, statistic = 230.636
##             91) WindDir3pm == {N, NE, NNE, NNW, NW}; criterion = 1, statistic = 142.684
##               92) WindGustSpeed <= 37; criterion = 1, statistic = 49.735
##                 93) WindSpeed3pm <= 19; criterion = 0.999, statistic = 17.749
##                   94) Pressure3pm <= 1020.8; criterion = 0.974, statistic = 14.085
##                     95) MaxTemp <= 19.3; criterion = 1, statistic = 19.32
##                       96)*  weights = 122 
##                     95) MaxTemp > 19.3
##                       97)*  weights = 1799 
##                   94) Pressure3pm > 1020.8
##                     98) RainToday == {Yes}; criterion = 1, statistic = 37.504
##                       99)*  weights = 8 
##                     98) RainToday == {No}
##                       100)*  weights = 615 
##                 93) WindSpeed3pm > 19
##                   101)*  weights = 272 
##               92) WindGustSpeed > 37
##                 102) Humidity3pm <= 29; criterion = 1, statistic = 35.363
##                   103)*  weights = 1181 
##                 102) Humidity3pm > 29
##                   104) Pressure3pm <= 1019.5; criterion = 0.998, statistic = 29.627
##                     105)*  weights = 500 
##                   104) Pressure3pm > 1019.5
##                     106) WindDir9am == {ESE, S, SW, WSW}; criterion = 1, statistic = 55.908
##                       107)*  weights = 7 
##                     106) WindDir9am == {E, ENE, N, NE, NNE, NNW, NW, SE, SSW, W, WNW}
##                       108)*  weights = 131 
##             91) WindDir3pm == {E, ENE, ESE, S, SE, SSE, SSW, SW, W, WNW, WSW}
##               109) Sunshine <= 9.8; criterion = 1, statistic = 47.86
##                 110) Pressure3pm <= 1015.4; criterion = 0.992, statistic = 35.459
##                   111) Humidity3pm <= 27; criterion = 0.993, statistic = 27.485
##                     112)*  weights = 1480 
##                   111) Humidity3pm > 27
##                     113)*  weights = 1661 
##                 110) Pressure3pm > 1015.4
##                   114)*  weights = 3487 
##               109) Sunshine > 9.8
##                 115) WindGustDir == {E, ENE, ESE, N, NE, NNE, NNW, S, SE, SSE, SSW, SW, W, WNW, WSW}; criterion = 0.999, statistic = 47.561
##                   116)*  weights = 4864 
##                 115) WindGustDir == {NW}
##                   117)*  weights = 83 
##           90) Humidity3pm > 38
##             118) WindDir3pm == {E, ENE, S, SE, SSE, SSW, SW, WSW}; criterion = 1, statistic = 133.335
##               119) Rainfall <= 14.6; criterion = 1, statistic = 46.081
##                 120) Sunshine <= 9.2; criterion = 1, statistic = 40.554
##                   121) MinTemp <= 14.8; criterion = 1, statistic = 42.424
##                     122) Pressure3pm <= 1015.3; criterion = 1, statistic = 29.67
##                       123) Humidity3pm <= 48; criterion = 0.997, statistic = 35.409
##                         124)*  weights = 760 
##                       123) Humidity3pm > 48
##                         125)*  weights = 223 
##                     122) Pressure3pm > 1015.3
##                       126) RainToday == {No}; criterion = 0.975, statistic = 35.316
##                         127)*  weights = 2472 
##                       126) RainToday == {Yes}
##                         128)*  weights = 305 
##                   121) MinTemp > 14.8
##                     129)*  weights = 754 
##                 120) Sunshine > 9.2
##                   130) WindGustDir == {N, WNW}; criterion = 0.99, statistic = 39.781
##                     131)*  weights = 51 
##                   130) WindGustDir == {E, ENE, ESE, NE, NNE, NNW, NW, S, SE, SSE, SSW, SW, W, WSW}
##                     132) MinTemp <= 17.6; criterion = 0.977, statistic = 18.378
##                       133)*  weights = 2467 
##                     132) MinTemp > 17.6
##                       134)*  weights = 319 
##               119) Rainfall > 14.6
##                 135)*  weights = 94 
##             118) WindDir3pm == {ESE, N, NE, NNE, NNW, NW, W, WNW}
##               136) Pressure3pm <= 1016; criterion = 1, statistic = 84.707
##                 137) WindGustSpeed <= 33; criterion = 1, statistic = 44.628
##                   138) Cloud3pm <= 6; criterion = 0.989, statistic = 25.462
##                     139)*  weights = 1023 
##                   138) Cloud3pm > 6
##                     140)*  weights = 57 
##                 137) WindGustSpeed > 33
##                   141) WindDir3pm == {ESE, NE, W, WNW}; criterion = 0.997, statistic = 40.259
##                     142)*  weights = 741 
##                   141) WindDir3pm == {N, NNE, NNW, NW}
##                     143)*  weights = 444 
##               136) Pressure3pm > 1016
##                 144) Pressure3pm <= 1022.1; criterion = 1, statistic = 27.723
##                   145) Sunshine <= 9.2; criterion = 1, statistic = 29.373
##                     146)*  weights = 1325 
##                   145) Sunshine > 9.2
##                     147)*  weights = 554 
##                 144) Pressure3pm > 1022.1
##                   148) WindGustSpeed <= 48; criterion = 0.997, statistic = 32.968
##                     149)*  weights = 1028 
##                   148) WindGustSpeed > 48
##                     150)*  weights = 24 
##     3) WindGustSpeed > 52
##       151) Sunshine <= 7.5; criterion = 1, statistic = 548.452
##         152) Pressure3pm <= 1006.4; criterion = 1, statistic = 67.125
##           153) Humidity3pm <= 23; criterion = 1, statistic = 26.085
##             154) WindSpeed9am <= 37; criterion = 0.961, statistic = 14.867
##               155)*  weights = 69 
##             154) WindSpeed9am > 37
##               156)*  weights = 13 
##           153) Humidity3pm > 23
##             157)*  weights = 473 
##         152) Pressure3pm > 1006.4
##           158) WindSpeed9am <= 26; criterion = 0.987, statistic = 26.397
##             159) Sunshine <= 5.2; criterion = 0.99, statistic = 24.375
##               160)*  weights = 231 
##             159) Sunshine > 5.2
##               161)*  weights = 306 
##           158) WindSpeed9am > 26
##             162)*  weights = 309 
##       151) Sunshine > 7.5
##         163) WindDir3pm == {E, ESE, S, SE, SSE, SSW, SW, W, WNW, WSW}; criterion = 1, statistic = 354.343
##           164) Humidity3pm <= 41; criterion = 1, statistic = 96.859
##             165) WindGustDir == {E, ENE, ESE, NNW, NW, S, SE, SSE, SSW, SW, W, WNW, WSW}; criterion = 1, statistic = 95.251
##               166) Cloud3pm <= 5; criterion = 1, statistic = 47.736
##                 167) Cloud9am <= 3; criterion = 1, statistic = 35.227
##                   168) WindGustSpeed <= 74; criterion = 1, statistic = 35.051
##                     169) WindGustDir == {ENE, NNW, NW, SSW, SW, WSW}; criterion = 1, statistic = 47.729
##                       170) WindSpeed3pm <= 13; criterion = 0.972, statistic = 26.834
##                         171)*  weights = 22 
##                       170) WindSpeed3pm > 13
##                         172)*  weights = 292 
##                     169) WindGustDir == {E, ESE, S, SE, SSE, W, WNW}
##                       173)*  weights = 684 
##                   168) WindGustSpeed > 74
##                     174)*  weights = 75 
##                 167) Cloud9am > 3
##                   175) MinTemp <= 25.4; criterion = 0.999, statistic = 25.756
##                     176) Rainfall <= 3.2; criterion = 0.999, statistic = 25.956
##                       177) MaxTemp <= 31.4; criterion = 0.996, statistic = 24.158
##                         178)*  weights = 1023 
##                       177) MaxTemp > 31.4
##                         179) Sunshine <= 9.5; criterion = 0.999, statistic = 26.798
##                           180)*  weights = 302 
##                         179) Sunshine > 9.5
##                           181) WindDir9am == {E, ENE, ESE, N, NE, NNE, NNW, NW, SE, SSE}; criterion = 0.998, statistic = 42.333
##                             182)*  weights = 122 
##                           181) WindDir9am == {S, SSW, SW, W, WNW}
##                             183)*  weights = 8 
##                     176) Rainfall > 3.2
##                       184) WindDir3pm == {ESE, SE, SSW}; criterion = 1, statistic = 41.597
##                         185)*  weights = 14 
##                       184) WindDir3pm == {S, SSE, SW, W, WNW, WSW}
##                         186)*  weights = 116 
##                   175) MinTemp > 25.4
##                     187)*  weights = 23 
##               166) Cloud3pm > 5
##                 188) Pressure3pm <= 998.7; criterion = 0.995, statistic = 19.763
##                   189)*  weights = 19 
##                 188) Pressure3pm > 998.7
##                   190)*  weights = 350 
##             165) WindGustDir == {N, NE, NNE}
##               191)*  weights = 73 
##           164) Humidity3pm > 41
##             192) Pressure3pm <= 1001.2; criterion = 1, statistic = 43.593
##               193)*  weights = 31 
##             192) Pressure3pm > 1001.2
##               194) RainToday == {Yes}; criterion = 1, statistic = 36.817
##                 195)*  weights = 325 
##               194) RainToday == {No}
##                 196) Pressure3pm <= 1008.5; criterion = 0.999, statistic = 33.526
##                   197)*  weights = 127 
##                 196) Pressure3pm > 1008.5
##                   198)*  weights = 500 
##         163) WindDir3pm == {ENE, N, NE, NNE, NNW, NW}
##           199) WindGustDir == {E, ENE, ESE, N, NE, NNE, NNW, NW, S, WNW}; criterion = 1, statistic = 130.361
##             200) Sunshine <= 9.3; criterion = 1, statistic = 99.795
##               201) Humidity3pm <= 17; criterion = 1, statistic = 36.401
##                 202)*  weights = 252 
##               201) Humidity3pm > 17
##                 203) Pressure3pm <= 1008.7; criterion = 1, statistic = 33.165
##                   204) WindDir3pm == {N, NE, NW}; criterion = 0.994, statistic = 23.269
##                     205)*  weights = 246 
##                   204) WindDir3pm == {ENE, NNE, NNW}
##                     206)*  weights = 139 
##                 203) Pressure3pm > 1008.7
##                   207) WindSpeed9am <= 22; criterion = 0.952, statistic = 13.63
##                     208)*  weights = 267 
##                   207) WindSpeed9am > 22
##                     209)*  weights = 203 
##             200) Sunshine > 9.3
##               210) Pressure3pm <= 1007.1; criterion = 1, statistic = 40.889
##                 211) Sunshine <= 10; criterion = 0.975, statistic = 13.289
##                   212)*  weights = 44 
##                 211) Sunshine > 10
##                   213)*  weights = 133 
##               210) Pressure3pm > 1007.1
##                 214) WindGustDir == {NNW, S, WNW}; criterion = 0.964, statistic = 26.282
##                   215)*  weights = 82 
##                 214) WindGustDir == {E, ENE, ESE, N, NE, NNE, NW}
##                   216) Rainfall <= 1.2; criterion = 0.999, statistic = 16.44
##                     217)*  weights = 407 
##                   216) Rainfall > 1.2
##                     218)*  weights = 14 
##           199) WindGustDir == {SE, SSE, SSW, SW, W, WSW}
##             219) WindGustSpeed <= 70; criterion = 1, statistic = 23.661
##               220) Humidity3pm <= 26; criterion = 0.987, statistic = 21.256
##                 221)*  weights = 132 
##               220) Humidity3pm > 26
##                 222)*  weights = 155 
##             219) WindGustSpeed > 70
##               223) Sunshine <= 9.9; criterion = 0.991, statistic = 17.111
##                 224)*  weights = 70 
##               223) Sunshine > 9.9
##                 225)*  weights = 26 
##   2) Humidity3pm > 51
##     226) WindGustSpeed <= 46; criterion = 1, statistic = 2717.258
##       227) Pressure3pm <= 1014.1; criterion = 1, statistic = 769.974
##         228) Sunshine <= 6.6; criterion = 1, statistic = 436.013
##           229) Humidity3pm <= 62; criterion = 1, statistic = 68.099
##             230) WindGustDir == {ENE, NNW, S, SE, SSE, SSW, SW, W, WNW, WSW}; criterion = 0.999, statistic = 47.107
##               231)*  weights = 599 
##             230) WindGustDir == {E, ESE, N, NE, NNE, NW}
##               232) WindGustSpeed <= 33; criterion = 0.988, statistic = 27.77
##                 233)*  weights = 110 
##               232) WindGustSpeed > 33
##                 234)*  weights = 182 
##           229) Humidity3pm > 62
##             235) WindGustSpeed <= 30; criterion = 1, statistic = 30.013
##               236)*  weights = 239 
##             235) WindGustSpeed > 30
##               237) Pressure3pm <= 1010.6; criterion = 0.986, statistic = 21.541
##                 238)*  weights = 436 
##               237) Pressure3pm > 1010.6
##                 239)*  weights = 323 
##         228) Sunshine > 6.6
##           240) Cloud3pm <= 4; criterion = 1, statistic = 234.413
##             241) Sunshine <= 8.6; criterion = 1, statistic = 54.819
##               242) WindDir3pm == {E, ENE, ESE, N, NE, S, SE, SSE, SSW, SW, WSW}; criterion = 1, statistic = 53.668
##                 243) Humidity3pm <= 54; criterion = 0.999, statistic = 18.491
##                   244)*  weights = 147 
##                 243) Humidity3pm > 54
##                   245)*  weights = 352 
##               242) WindDir3pm == {NNE, NNW, NW, W, WNW}
##                 246)*  weights = 152 
##             241) Sunshine > 8.6
##               247) Cloud3pm <= 2; criterion = 1, statistic = 24.932
##                 248) Pressure3pm <= 1006.6; criterion = 0.989, statistic = 29.642
##                   249)*  weights = 120 
##                 248) Pressure3pm > 1006.6
##                   250) RainToday == {No}; criterion = 0.96, statistic = 31.044
##                     251)*  weights = 900 
##                   250) RainToday == {Yes}
##                     252)*  weights = 92 
##               247) Cloud3pm > 2
##                 253)*  weights = 568 
##           240) Cloud3pm > 4
##             254) Humidity9am <= 74; criterion = 1, statistic = 126.1
##               255) MaxTemp <= 21.1; criterion = 1, statistic = 64.974
##                 256)*  weights = 373 
##               255) MaxTemp > 21.1
##                 257) Cloud3pm <= 6; criterion = 1, statistic = 44.437
##                   258) Cloud9am <= 1; criterion = 1, statistic = 41.079
##                     259) WindDir3pm == {NNE, NNW, SSE, SSW, WSW}; criterion = 0.997, statistic = 43.051
##                       260)*  weights = 37 
##                     259) WindDir3pm == {E, ENE, ESE, N, NE, NW, S, SE, SW, W, WNW}
##                       261) Cloud3pm <= 4.50993; criterion = 0.988, statistic = 25.765
##                         262)*  weights = 204 
##                       261) Cloud3pm > 4.50993
##                         263)*  weights = 61 
##                   258) Cloud9am > 1
##                     264) Pressure9am <= 1010.9; criterion = 0.998, statistic = 31.262
##                       265)*  weights = 427 
##                     264) Pressure9am > 1010.9
##                       266) WindGustDir == {E, ENE, ESE, NE, NNE, NW, S, SSE, SSW, WNW}; criterion = 0.99, statistic = 39.781
##                         267)*  weights = 796 
##                       266) WindGustDir == {N, NNW, SE, SW, W, WSW}
##                         268)*  weights = 293 
##                 257) Cloud3pm > 6
##                   269) Sunshine <= 8.6; criterion = 0.996, statistic = 29.877
##                     270)*  weights = 254 
##                   269) Sunshine > 8.6
##                     271) RainToday == {Yes}; criterion = 0.982, statistic = 24.646
##                       272)*  weights = 23 
##                     271) RainToday == {No}
##                       273)*  weights = 163 
##             254) Humidity9am > 74
##               274) Pressure3pm <= 1005.5; criterion = 1, statistic = 47.59
##                 275)*  weights = 272 
##               274) Pressure3pm > 1005.5
##                 276) Humidity3pm <= 64; criterion = 1, statistic = 39.355
##                   277)*  weights = 992 
##                 276) Humidity3pm > 64
##                   278) RainToday == {No}; criterion = 0.999, statistic = 32.563
##                     279) WindGustSpeed <= 41; criterion = 0.976, statistic = 34.164
##                       280)*  weights = 254 
##                     279) WindGustSpeed > 41
##                       281)*  weights = 47 
##                   278) RainToday == {Yes}
##                     282)*  weights = 258 
##       227) Pressure3pm > 1014.1
##         283) Humidity3pm <= 64; criterion = 1, statistic = 350.275
##           284) Sunshine <= 7.6; criterion = 1, statistic = 178.05
##             285) WindGustSpeed <= 35; criterion = 1, statistic = 63.741
##               286) Temp3pm <= 18.8; criterion = 1, statistic = 50.545
##                 287) Pressure3pm <= 1021.9; criterion = 1, statistic = 31.604
##                   288) WindDir9am == {E, ENE, NW, S, SE, SSE, SSW, SW, W, WNW, WSW}; criterion = 0.951, statistic = 34.92
##                     289)*  weights = 385 
##                   288) WindDir9am == {ESE, N, NE, NNE, NNW}
##                     290) WindGustSpeed <= 30; criterion = 0.982, statistic = 19.224
##                       291)*  weights = 149 
##                     290) WindGustSpeed > 30
##                       292)*  weights = 83 
##                 287) Pressure3pm > 1021.9
##                   293) WindGustSpeed <= 20; criterion = 0.986, statistic = 16.774
##                     294)*  weights = 160 
##                   293) WindGustSpeed > 20
##                     295)*  weights = 654 
##               286) Temp3pm > 18.8
##                 296) WindGustDir == {ESE, S, SSE, SSW, SW, W}; criterion = 0.973, statistic = 36.788
##                   297)*  weights = 341 
##                 296) WindGustDir == {E, ENE, N, NE, NNE, NNW, NW, SE, WNW, WSW}
##                   298)*  weights = 409 
##             285) WindGustSpeed > 35
##               299) Rainfall <= 8; criterion = 1, statistic = 57.431
##                 300) WindDir9am == {N, NE, NNE}; criterion = 1, statistic = 55.627
##                   301) Pressure9am <= 1019.6; criterion = 1, statistic = 27.22
##                     302)*  weights = 54 
##                   301) Pressure9am > 1019.6
##                     303)*  weights = 137 
##                 300) WindDir9am == {E, ENE, ESE, NNW, NW, S, SE, SSE, SSW, SW, W, WNW, WSW}
##                   304)*  weights = 921 
##               299) Rainfall > 8
##                 305) Cloud3pm <= 6; criterion = 0.967, statistic = 18.621
##                   306)*  weights = 68 
##                 305) Cloud3pm > 6
##                   307)*  weights = 46 
##           284) Sunshine > 7.6
##             308) Rainfall <= 0.3; criterion = 1, statistic = 105.381
##               309) Pressure3pm <= 1018.2; criterion = 1, statistic = 43.086
##                 310) Sunshine <= 9.8; criterion = 1, statistic = 64.837
##                   311) Pressure9am <= 1020.6; criterion = 1, statistic = 48.959
##                     312) WindGustSpeed <= 31; criterion = 1, statistic = 32.509
##                       313)*  weights = 988 
##                     312) WindGustSpeed > 31
##                       314) WindSpeed3pm <= 22; criterion = 0.997, statistic = 27.237
##                         315) Humidity3pm <= 56; criterion = 0.974, statistic = 27.309
##                           316)*  weights = 343 
##                         315) Humidity3pm > 56
##                           317)*  weights = 393 
##                       314) WindSpeed3pm > 22
##                         318)*  weights = 396 
##                   311) Pressure9am > 1020.6
##                     319) Temp9am <= 16; criterion = 0.998, statistic = 22.669
##                       320)*  weights = 129 
##                     319) Temp9am > 16
##                       321) WindSpeed3pm <= 15; criterion = 0.994, statistic = 26.033
##                         322)*  weights = 57 
##                       321) WindSpeed3pm > 15
##                         323)*  weights = 88 
##                 310) Sunshine > 9.8
##                   324)*  weights = 559 
##               309) Pressure3pm > 1018.2
##                 325) Humidity3pm <= 58; criterion = 1, statistic = 26.86
##                   326)*  weights = 2316 
##                 325) Humidity3pm > 58
##                   327)*  weights = 1413 
##             308) Rainfall > 0.3
##               328) Sunshine <= 9.2; criterion = 1, statistic = 54.959
##                 329) Pressure3pm <= 1017.3; criterion = 1, statistic = 46.337
##                   330) WindGustDir == {ENE, NE, S, SE, SSE, SSW, SW, W, WSW}; criterion = 0.971, statistic = 36.581
##                     331)*  weights = 489 
##                   330) WindGustDir == {E, ESE, N, NNE, NNW, NW, WNW}
##                     332)*  weights = 299 
##                 329) Pressure3pm > 1017.3
##                   333) Rainfall <= 12.2; criterion = 1, statistic = 27.055
##                     334)*  weights = 1105 
##                   333) Rainfall > 12.2
##                     335)*  weights = 82 
##               328) Sunshine > 9.2
##                 336)*  weights = 359 
##         283) Humidity3pm > 64
##           337) RainToday == {No}; criterion = 1, statistic = 118.095
##             338) Pressure3pm <= 1022.7; criterion = 1, statistic = 42.615
##               339) Sunshine <= 4.3; criterion = 1, statistic = 43.382
##                 340)*  weights = 351 
##               339) Sunshine > 4.3
##                 341) WindSpeed3pm <= 19; criterion = 0.998, statistic = 37.956
##                   342)*  weights = 1146 
##                 341) WindSpeed3pm > 19
##                   343) Temp3pm <= 20.4; criterion = 0.995, statistic = 35.747
##                     344) Humidity3pm <= 69; criterion = 0.966, statistic = 15.512
##                       345)*  weights = 270 
##                     344) Humidity3pm > 69
##                       346)*  weights = 81 
##                   343) Temp3pm > 20.4
##                     347) WindGustDir == {ENE, NE, NNE, SW, WNW}; criterion = 0.99, statistic = 38.108
##                       348) Rainfall <= 0.3; criterion = 1, statistic = 29.87
##                         349)*  weights = 195 
##                       348) Rainfall > 0.3
##                         350)*  weights = 10 
##                     347) WindGustDir == {E, ESE, N, NNW, NW, S, SE, SSE, SSW, WSW}
##                       351)*  weights = 234 
##             338) Pressure3pm > 1022.7
##               352) MinTemp <= 10.1; criterion = 1, statistic = 31.519
##                 353) WindGustSpeed <= 37; criterion = 0.968, statistic = 16.097
##                   354)*  weights = 579 
##                 353) WindGustSpeed > 37
##                   355)*  weights = 70 
##               352) MinTemp > 10.1
##                 356)*  weights = 300 
##           337) RainToday == {Yes}
##             357) WindGustSpeed <= 33; criterion = 1, statistic = 47.231
##               358) MinTemp <= 10.8; criterion = 1, statistic = 21.531
##                 359)*  weights = 290 
##               358) MinTemp > 10.8
##                 360)*  weights = 338 
##             357) WindGustSpeed > 33
##               361) Temp3pm <= 15; criterion = 0.955, statistic = 20.566
##                 362)*  weights = 260 
##               361) Temp3pm > 15
##                 363)*  weights = 373 
##     226) WindGustSpeed > 46
##       364) Pressure3pm <= 1012.1; criterion = 1, statistic = 523.366
##         365) WindDir3pm == {N, NNW, NW, SW, W, WNW, WSW}; criterion = 1, statistic = 196.25
##           366) Humidity3pm <= 57; criterion = 1, statistic = 59.238
##             367) RainToday == {Yes}; criterion = 1, statistic = 27.563
##               368) Sunshine <= 8.8; criterion = 0.994, statistic = 17.246
##                 369)*  weights = 344 
##               368) Sunshine > 8.8
##                 370)*  weights = 31 
##             367) RainToday == {No}
##               371)*  weights = 416 
##           366) Humidity3pm > 57
##             372) WindGustSpeed <= 54; criterion = 1, statistic = 46.64
##               373)*  weights = 518 
##             372) WindGustSpeed > 54
##               374) Rainfall <= 8.4; criterion = 0.995, statistic = 14.125
##                 375) Sunshine <= 9; criterion = 0.961, statistic = 23.657
##                   376)*  weights = 638 
##                 375) Sunshine > 9
##                   377)*  weights = 35 
##               374) Rainfall > 8.4
##                 378)*  weights = 240 
##         365) WindDir3pm == {E, ENE, ESE, NE, NNE, S, SE, SSE, SSW}
##           379) Sunshine <= 4.5; criterion = 1, statistic = 79.534
##             380) WindGustSpeed <= 65; criterion = 0.994, statistic = 33.833
##               381)*  weights = 194 
##             380) WindGustSpeed > 65
##               382) Rainfall <= 14.8; criterion = 0.985, statistic = 11.31
##                 383)*  weights = 29 
##               382) Rainfall > 14.8
##                 384)*  weights = 7 
##           379) Sunshine > 4.5
##             385) Humidity9am <= 78; criterion = 1, statistic = 42.395
##               386) WindSpeed3pm <= 31; criterion = 1, statistic = 26.441
##                 387) Sunshine <= 9.9; criterion = 0.988, statistic = 29.672
##                   388) WindDir9am == {ESE, NNW, NW, S, SSE}; criterion = 0.985, statistic = 38.439
##                     389) Evaporation <= 7.6; criterion = 0.953, statistic = 13.635
##                       390)*  weights = 107 
##                     389) Evaporation > 7.6
##                       391)*  weights = 34 
##                   388) WindDir9am == {E, ENE, N, NE, NNE, SE, SSW, SW, W, WNW, WSW}
##                     392)*  weights = 275 
##                 387) Sunshine > 9.9
##                   393)*  weights = 72 
##               386) WindSpeed3pm > 31
##                 394)*  weights = 281 
##             385) Humidity9am > 78
##               395)*  weights = 185 
##       364) Pressure3pm > 1012.1
##         396) RainToday == {Yes}; criterion = 1, statistic = 167.067
##           397) Humidity9am <= 68; criterion = 1, statistic = 45.289
##             398) Humidity3pm <= 67; criterion = 1, statistic = 34.036
##               399) WindGustSpeed <= 70; criterion = 0.989, statistic = 26.584
##                 400)*  weights = 410 
##               399) WindGustSpeed > 70
##                 401)*  weights = 38 
##             398) Humidity3pm > 67
##               402)*  weights = 45 
##           397) Humidity9am > 68
##             403) Sunshine <= 9; criterion = 1, statistic = 46.368
##               404) WindDir3pm == {ENE, ESE, N, NNW, SE, WSW}; criterion = 0.996, statistic = 42.497
##                 405) Pressure3pm <= 1019.5; criterion = 0.975, statistic = 26.1
##                   406)*  weights = 278 
##                 405) Pressure3pm > 1019.5
##                   407)*  weights = 73 
##               404) WindDir3pm == {E, NE, NNE, NW, S, SSE, SSW, SW, W, WNW}
##                 408) WindGustSpeed <= 57; criterion = 0.955, statistic = 32.341
##                   409)*  weights = 594 
##                 408) WindGustSpeed > 57
##                   410)*  weights = 283 
##             403) Sunshine > 9
##               411) Cloud3pm <= 6; criterion = 0.958, statistic = 12.308
##                 412)*  weights = 48 
##               411) Cloud3pm > 6
##                 413)*  weights = 9 
##         396) RainToday == {No}
##           414) Sunshine <= 6.9; criterion = 1, statistic = 98.218
##             415) WindDir9am == {E, ENE, ESE, N, NE, NNE, NNW, NW, SW}; criterion = 1, statistic = 62.393
##               416) Pressure3pm <= 1014.8; criterion = 0.997, statistic = 15.806
##                 417)*  weights = 150 
##               416) Pressure3pm > 1014.8
##                 418)*  weights = 240 
##             415) WindDir9am == {S, SE, SSE, SSW, W, WNW, WSW}
##               419)*  weights = 314 
##           414) Sunshine > 6.9
##             420) WindGustSpeed <= 56; criterion = 1, statistic = 68.92
##               421) Humidity3pm <= 62; criterion = 1, statistic = 39.59
##                 422)*  weights = 953 
##               421) Humidity3pm > 62
##                 423) Rainfall <= 0.1; criterion = 1, statistic = 35.516
##                   424) WindSpeed3pm <= 24; criterion = 0.979, statistic = 27.374
##                     425)*  weights = 104 
##                   424) WindSpeed3pm > 24
##                     426)*  weights = 240 
##                 423) Rainfall > 0.1
##                   427)*  weights = 141 
##             420) WindGustSpeed > 56
##               428) WindDir3pm == {E, ESE, NE, NNE, SE, SSE, W, WNW, WSW}; criterion = 0.994, statistic = 40.998
##                 429) Humidity9am <= 62; criterion = 0.995, statistic = 16.999
##                   430)*  weights = 149 
##                 429) Humidity9am > 62
##                   431)*  weights = 274 
##               428) WindDir3pm == {ENE, N, NNW, NW, S, SSW, SW}
##                 432) WindSpeed9am <= 13; criterion = 0.994, statistic = 20.542
##                   433)*  weights = 29 
##                 432) WindSpeed9am > 13
##                   434)*  weights = 186 
## 1) Humidity3pm > 71
##   435) Humidity3pm <= 82; criterion = 1, statistic = 1910.563
##     436) WindGustSpeed <= 44; criterion = 1, statistic = 689.708
##       437) Pressure3pm <= 1012.8; criterion = 1, statistic = 222.671
##         438) Sunshine <= 4.6; criterion = 1, statistic = 100.315
##           439) WindGustSpeed <= 28; criterion = 1, statistic = 23.671
##             440)*  weights = 127 
##           439) WindGustSpeed > 28
##             441) Humidity3pm <= 74; criterion = 0.964, statistic = 30.054
##               442)*  weights = 128 
##             441) Humidity3pm > 74
##               443)*  weights = 314 
##         438) Sunshine > 4.6
##           444) Cloud3pm <= 6; criterion = 1, statistic = 48.456
##             445) RainToday == {Yes}; criterion = 1, statistic = 47.838
##               446)*  weights = 323 
##             445) RainToday == {No}
##               447)*  weights = 454 
##           444) Cloud3pm > 6
##             448)*  weights = 352 
##       437) Pressure3pm > 1012.8
##         449) RainToday == {No}; criterion = 1, statistic = 104.471
##           450) Sunshine <= 1.4; criterion = 1, statistic = 56.166
##             451) Pressure3pm <= 1022.8; criterion = 1, statistic = 22.287
##               452)*  weights = 208 
##             451) Pressure3pm > 1022.8
##               453)*  weights = 85 
##           450) Sunshine > 1.4
##             454) Pressure3pm <= 1018.6; criterion = 1, statistic = 43.199
##               455) Cloud3pm <= 6; criterion = 1, statistic = 38.431
##                 456) Sunshine <= 9.4; criterion = 0.99, statistic = 31.942
##                   457) Humidity3pm <= 79; criterion = 0.962, statistic = 32.03
##                     458)*  weights = 644 
##                   457) Humidity3pm > 79
##                     459)*  weights = 144 
##                 456) Sunshine > 9.4
##                   460)*  weights = 40 
##               455) Cloud3pm > 6
##                 461)*  weights = 305 
##             454) Pressure3pm > 1018.6
##               462) WindGustSpeed <= 35; criterion = 1, statistic = 21.266
##                 463)*  weights = 715 
##               462) WindGustSpeed > 35
##                 464)*  weights = 295 
##         449) RainToday == {Yes}
##           465) WindGustSpeed <= 35; criterion = 1, statistic = 26.591
##             466) MaxTemp <= 14.6; criterion = 1, statistic = 20.371
##               467)*  weights = 224 
##             466) MaxTemp > 14.6
##               468)*  weights = 626 
##           465) WindGustSpeed > 35
##             469) Sunshine <= 5.8; criterion = 0.989, statistic = 14.637
##               470)*  weights = 238 
##             469) Sunshine > 5.8
##               471)*  weights = 377 
##     436) WindGustSpeed > 44
##       472) WindDir3pm == {E, ENE, ESE, NE, NNE, S, SSE}; criterion = 1, statistic = 153.376
##         473) Sunshine <= 3.6; criterion = 1, statistic = 81.493
##           474) Humidity3pm <= 76; criterion = 0.994, statistic = 28.546
##             475)*  weights = 111 
##           474) Humidity3pm > 76
##             476)*  weights = 161 
##         473) Sunshine > 3.6
##           477) RainToday == {No}; criterion = 1, statistic = 63.149
##             478) Cloud3pm <= 5; criterion = 1, statistic = 42.176
##               479)*  weights = 419 
##             478) Cloud3pm > 5
##               480) MinTemp <= 13.8; criterion = 0.996, statistic = 19.476
##                 481)*  weights = 38 
##               480) MinTemp > 13.8
##                 482)*  weights = 146 
##           477) RainToday == {Yes}
##             483) WindGustSpeed <= 65; criterion = 0.978, statistic = 22.931
##               484) Cloud3pm <= 6; criterion = 0.983, statistic = 23.322
##                 485)*  weights = 218 
##               484) Cloud3pm > 6
##                 486)*  weights = 117 
##             483) WindGustSpeed > 65
##               487)*  weights = 46 
##       472) WindDir3pm == {N, NNW, NW, SE, SSW, SW, W, WNW, WSW}
##         488) Pressure3pm <= 1014.5; criterion = 1, statistic = 95.707
##           489) Sunshine <= 7.5; criterion = 1, statistic = 45.285
##             490) Pressure3pm <= 1010.3; criterion = 0.992, statistic = 31.913
##               491)*  weights = 423 
##             490) Pressure3pm > 1010.3
##               492)*  weights = 183 
##           489) Sunshine > 7.5
##             493) RainToday == {No}; criterion = 0.998, statistic = 25.885
##               494) Rainfall <= 0; criterion = 0.981, statistic = 21.516
##                 495) WindSpeed3pm <= 19; criterion = 0.986, statistic = 21.278
##                   496)*  weights = 42 
##                 495) WindSpeed3pm > 19
##                   497)*  weights = 126 
##               494) Rainfall > 0
##                 498)*  weights = 78 
##             493) RainToday == {Yes}
##               499)*  weights = 334 
##         488) Pressure3pm > 1014.5
##           500) MinTemp <= 4.9; criterion = 1, statistic = 27.006
##             501)*  weights = 117 
##           500) MinTemp > 4.9
##             502) WindGustSpeed <= 69; criterion = 0.995, statistic = 20.913
##               503)*  weights = 509 
##             502) WindGustSpeed > 69
##               504)*  weights = 53 
##   435) Humidity3pm > 82
##     505) Pressure3pm <= 1014.9; criterion = 1, statistic = 353.352
##       506) Humidity3pm <= 88; criterion = 1, statistic = 129.156
##         507) Pressure3pm <= 1011; criterion = 1, statistic = 57.382
##           508) Sunshine <= 4.1; criterion = 1, statistic = 34.995
##             509)*  weights = 438 
##           508) Sunshine > 4.1
##             510) Temp3pm <= 20.8; criterion = 1, statistic = 30.904
##               511) Pressure3pm <= 1006; criterion = 0.98, statistic = 24.205
##                 512)*  weights = 186 
##               511) Pressure3pm > 1006
##                 513)*  weights = 217 
##             510) Temp3pm > 20.8
##               514) Cloud3pm <= 4.50993; criterion = 0.995, statistic = 20.81
##                 515)*  weights = 105 
##               514) Cloud3pm > 4.50993
##                 516)*  weights = 101 
##         507) Pressure3pm > 1011
##           517) Temp3pm <= 20.1; criterion = 0.999, statistic = 46.203
##             518) WindGustSpeed <= 44; criterion = 0.998, statistic = 21.637
##               519)*  weights = 193 
##             518) WindGustSpeed > 44
##               520)*  weights = 169 
##           517) Temp3pm > 20.1
##             521) WindGustDir == {E, SE, SSE, W, WNW}; criterion = 0.988, statistic = 39.263
##               522)*  weights = 46 
##             521) WindGustDir == {ENE, ESE, N, NE, NNE, NNW, NW, S, SSW, SW, WSW}
##               523)*  weights = 134 
##       506) Humidity3pm > 88
##         524) Cloud9am <= 3; criterion = 1, statistic = 56.312
##           525) Temp3pm <= 26.9; criterion = 1, statistic = 30.325
##             526)*  weights = 46 
##           525) Temp3pm > 26.9
##             527)*  weights = 16 
##         524) Cloud9am > 3
##           528) Sunshine <= 2.5; criterion = 1, statistic = 29.573
##             529)*  weights = 956 
##           528) Sunshine > 2.5
##             530) Temp3pm <= 27.6; criterion = 1, statistic = 22.724
##               531) WindGustSpeed <= 48; criterion = 0.997, statistic = 24.529
##                 532) WindSpeed3pm <= 20; criterion = 0.976, statistic = 27.874
##                   533)*  weights = 556 
##                 532) WindSpeed3pm > 20
##                   534)*  weights = 120 
##               531) WindGustSpeed > 48
##                 535) RainToday == {Yes}; criterion = 0.981, statistic = 17.33
##                   536)*  weights = 371 
##                 535) RainToday == {No}
##                   537)*  weights = 202 
##             530) Temp3pm > 27.6
##               538)*  weights = 17 
##     505) Pressure3pm > 1014.9
##       539) MinTemp <= 7.3; criterion = 1, statistic = 292.475
##         540) RainToday == {Yes}; criterion = 1, statistic = 50.969
##           541) Humidity3pm <= 95; criterion = 0.987, statistic = 35.005
##             542) Evaporation <= 2.8; criterion = 0.996, statistic = 22.878
##               543) Humidity3pm <= 83; criterion = 0.972, statistic = 16.984
##                 544)*  weights = 13 
##               543) Humidity3pm > 83
##                 545)*  weights = 84 
##             542) Evaporation > 2.8
##               546) Cloud9am <= 7; criterion = 0.973, statistic = 24.633
##                 547)*  weights = 130 
##               546) Cloud9am > 7
##                 548)*  weights = 43 
##           541) Humidity3pm > 95
##             549) MinTemp <= -3; criterion = 0.984, statistic = 29.462
##               550)*  weights = 40 
##             549) MinTemp > -3
##               551)*  weights = 182 
##         540) RainToday == {No}
##           552) Cloud3pm <= 7; criterion = 1, statistic = 42.098
##             553) Humidity3pm <= 96; criterion = 0.978, statistic = 29.63
##               554) MaxTemp <= 14.3; criterion = 1, statistic = 26.827
##                 555)*  weights = 276 
##               554) MaxTemp > 14.3
##                 556)*  weights = 63 
##             553) Humidity3pm > 96
##               557)*  weights = 153 
##           552) Cloud3pm > 7
##             558) Pressure3pm <= 1020.5; criterion = 1, statistic = 23.891
##               559)*  weights = 82 
##             558) Pressure3pm > 1020.5
##               560)*  weights = 76 
##       539) MinTemp > 7.3
##         561) Humidity3pm <= 89; criterion = 1, statistic = 67.436
##           562) WindGustSpeed <= 39; criterion = 1, statistic = 43.341
##             563) RainToday == {No}; criterion = 0.984, statistic = 28.605
##               564) Humidity9am <= 96; criterion = 1, statistic = 26.314
##                 565)*  weights = 228 
##               564) Humidity9am > 96
##                 566)*  weights = 29 
##             563) RainToday == {Yes}
##               567)*  weights = 308 
##           562) WindGustSpeed > 39
##             568) RainToday == {No}; criterion = 0.999, statistic = 26.419
##               569)*  weights = 201 
##             568) RainToday == {Yes}
##               570)*  weights = 337 
##         561) Humidity3pm > 89
##           571) MinTemp <= 11; criterion = 1, statistic = 42.773
##             572) Cloud3pm <= 7; criterion = 0.972, statistic = 22.595
##               573)*  weights = 260 
##             572) Cloud3pm > 7
##               574)*  weights = 116 
##           571) MinTemp > 11
##             575) RainToday == {No}; criterion = 0.998, statistic = 24.763
##               576)*  weights = 269 
##             575) RainToday == {Yes}
##               577)*  weights = 559
plot(tree)

Evaluasi

Pada tahap evaluasi dibagi menjadi 2 pengujian. Pengujian berdasarkan data training dan pengujian berdasarkan data testing. Dalam tahap evaluasi menggunakan metode confusion matrix

Pengujian berdasarkan data training

table(predict(tree), trainData$RainTomorrow)
##      
##          No   Yes
##   No  73206 10535
##   Yes  3962 11397

Pengujian berdasarkan data testing

testPred <- predict(tree, testData)
table(testPred, testData$RainTomorrow)
##         
## testPred    No   Yes
##      No  18075  2727
##      Yes  1075  2733

Referensi

[1] E. B. Pratama and A. Hendini, “Sistem Pakar Diagnosa Penyakit Kulit Pada Kucing Berbasis Web Menggunakan Metode Decision Tree,” Sistemasi, vol. 8, no. 2, p. 254, 2019, doi: 10.32520/stmsi.v8i2.459.
[2] P. Handayani, E. Nurlelah, M. Raharjo, and P. M. Ramdani, “Prediksi Penyakit Liver Dengan Menggunakan Metode Decision Tree dan Neural Network,” Comput. Eng. Sci. Syst. J., vol. 4, no. 1, p. 55, 2019, doi: 10.24114/cess.v4i1.11528.
[3] https://www.youtube.com/Irwansight
[4] https://www.kaggle.com/jsphyg/weather-dataset-rattle-package