-
Notifications
You must be signed in to change notification settings - Fork 2
/
SVM_forest.R
54 lines (39 loc) · 1.78 KB
/
SVM_forest.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
forest_fire <- mydata
forest_fire <- read.csv("")
forest_fire <- forest_fire[,c(-1,-2)]
head(forest_fire)
str(forest_fire)
options(warn=-1)
library(ggplot2)
library(ggforce)
ggplot(forest_fire,aes(forest_fire$size_category,forest_fire$temp))+
geom_sina(aes(color=forest_fire$size_category), size=0.7)+
scale_color_manual(values = c("#34d800","#d80400"))
ggplot(forest_fire,aes(forest_fire$size_category,forest_fire$wind))+
geom_sina(aes(color=forest_fire$size_category), size=0.7)+
scale_color_manual(values = c("#34d800","#d80400"))
ggplot(forest_fire,aes(forest_fire$size_category,forest_fire$rain))+
geom_sina(aes(color=forest_fire$size_category), size=0.7)+
scale_color_manual(values = c("#34d800","#d80400"))
ggplot(forest_fire,aes(forest_fire$size_category,forest_fire$area))+
geom_sina(aes(color=forest_fire$size_category), size=0.7)+
scale_color_manual(values = c("#34d800","#d80400"))
sum(is.na(forest_fire))
forest_fire[,29] <- ifelse(forest_fire[,29]=="small",0,1)
forest_fire[,29] <- as.factor(forest_fire[,29])
forest_train <- forest_fire[1:300,]