-
Notifications
You must be signed in to change notification settings - Fork 0
/
PredictWithoutTweet.R
47 lines (37 loc) · 1.1 KB
/
PredictWithoutTweet.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
setwd("/home/omer-pc/")
fullData <- read.csv("matchesout.csv",header=TRUE)
setwd("/home/omer-pc/workspace/FootballPredict/data/csv/season-2015-2016")
engData <- read.csv("E0.csv",header=TRUE)
library(kernlab)
install.packages('aod')
library(aod)
install.packages('ggplot2')
library(ggplot2)
install.packages('party')
library("party")
install.packages('randomForest')
library(randomForest)
install.packages('e1071')
library(e1071)
library(caret)
library(NLP)
library(tm)
x<-na.omit(fullData)
lm_model<- lm(FTR ~ BWA + BWH + BWD , fullData)
mylogit <- glm(FTR ~ .,data = fullData)
model <- svm(FTR ~ BWH+BWD+BWA, data=engData,type="C-classification")
#model <- ctree(FTR ~ HC+AC+HF+AF+HY+AY+HR+AR+HS+AS+HST+AST, data=engData)
print(model)
summary(model)
pred <- predict(model)
table(pred,engData[,"FTR"])
# HC,AC,HF,AF,HO,AO,HY,AY,HR,AR,HS,AS,HST,AST,HHW,AHW,
# HC+AC+HF+AF+HY+AY+HR+AR+HS+AS+HST+AST
# BWH+ BWD+BWA
set.seed(415)
fit <- randomForest(FTR ~ HC+AC+HF+AF+HY+AY+HR+AR+HS+AS+HST+AST, data=engData,
importance=TRUE,#
ntree=500,proximity=TRUE)
fit
rpart::na.rpart()
score