-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathctree.r
More file actions
14 lines (12 loc) · 814 Bytes
/
ctree.r
File metadata and controls
14 lines (12 loc) · 814 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
library('varhandle')
dataset = read.csv("D:/SEMESTER V/B1_ECM2002/J/Football-Data-Analysis-and-Prediction-master/Football-Data-Analysis-and-Prediction-master/Datasets/final_dataset.csv")
test = read.csv("D:/SEMESTER V/B1_ECM2002/J/Football-Data-Analysis-and-Prediction-master/Football-Data-Analysis-and-Prediction-master/Datasets/test.csv")
library('party',warn.conflicts=FALSE)
ctree_model1<- ctree(FTR ~ ., data = dataset,controls=ctree_control(minsplit=30,minbucket=10,maxdepth=5))
ctree_predictions1 <- predict(ctree_model,data=test,type='response')
#ctree_prediction
round(mean(ctree_predictions==test$FTR),2)*100
ctree_model2<- ctree(FTR ~ ., data = dataset)
ctree_predictions2 <- predict(ctree_model,data=test,type='response')
#ctree_prediction
round(mean(ctree_predictions==test$FTR),2)*100