Postingan

Menampilkan postingan dari Mei, 2018

KNN on RStudio Studi Kasus

Gambar
Download Data Training Lakukan perintah dasar pada Rstudio > getwd() [1] "C:/Users/ACER/Documents" > MyData <- read.csv(file="dataTraining.csv", header=TRUE, sep=",") > View(MyData) > names(MyData)  [1] "Win.Loss"       "Optimism"       "Pessimism"      "PastUsed"       "FutureUsed"     "PresentUsed"   [7] "OwnPartyCount"  "OppPartyCount"  "NumericContent" "Extra"          "Emoti"          "Agree"        [13] "Consc"          "Openn"       > attributes(MyData) $names  [1] "Win.Loss"       "Optimism"       "Pessimism"      "PastUsed"       "FutureUsed"     "PresentUsed"   [7] "OwnPartyCount"  "OppPartyCount"  "...

Pengujian NaiveBayes data External

Copykan file uji  datafixastrid.xlsx  ke working directory,  > getwd() [1] "C:/Users/ACER/Documents" > datafixastrid <- read_excel("datafixastrid.xlsx") > View(datafixastrid) #lihat isi > datafixastrid # A tibble: 34 x 96     X__1    DSR  X__2   DUR  X__3     GSR  X__4    DGR  X__5      PKR   X__6   KPR   X__7   KBR    <dbl>  <dbl> <dbl> <dbl> <dbl>   <dbl> <dbl>  <dbl> <dbl>    <dbl>  <dbl> <dbl>  <dbl> <dbl>  1 1316. 0.258  1602. 0.314   20. 0.00392  301. 0.0591   50. 0.00981  10466. 2.05   8788. 1.72   2 3477. 0.247  2871. 0.204   37. 0.00262  815. 0.0578   26. 0.00184  14824. 1.05  ...

Review RSTUDIO

Gambar
#membuat fungsi ->#cara panggilnya: bersih() bersih <- function() cat("\014")  closeAllConnections() rm(list=ls()) >v=212 >typeof(v) [1] "double" #membuat random 10 bilangan antara 5 s/d 7.5 > x1 <- runif(10, 5.0, 7.5) > x1  [1] 7.092883 7.291221 6.348377 5.123613 5.302045 6.137085 6.814298  [8] 5.741372 7.090372 5.509627 #membuat random 1 s/d 10 sebanyak 10 bilangan unique > x3 <- sample(1:10, 10) > x3  [1]  8  9  6  7  3  4  2  5  1 10 > x4 <- sample(1:10, 10, replace=T) > x4  [1]  9  2  5  9  8  8  9 10  4  4 > typeof(x4) [1] "integer" (WD <- getwd()) if (!is.null(WD)) setwd(WD) list.files(R.home()) list.files(WD) #hasil > (WD <- getwd()) [1] "C:/Users/ACER/Documents" > if (!is.null(WD)) setwd(WD) > list.files(R.home())  [1] "bin"            "...