-
Notifications
You must be signed in to change notification settings - Fork 0
/
.Rhistory
90 lines (90 loc) · 2.86 KB
/
.Rhistory
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
Sys.which("make")
#installing required packages
install.packages("olsrr",type="source")
#package not opening coz of error
library("olsrr")
install.packages("installr")
library(installr)
updateR()
#installing required packages
install.packages("olsrr",type="source")
#package not opening coz of error
library("olsrr")
load("C:/Users/pande/Downloads/titanic/data.RData")
#taking awhile so might have to choose variables on own
ols_step_forward_p(mylogit2)
#will try again
#making model
mylogit2<- glm(Survived ~ ., data=train, family= "binomial")
#will try again
#making model
mylogit2<- glm(Survived ~ Pclass+Sex+SibSp+Fare+Embarked+Title, data=train, family= "binomial")
summary(mylogit2)
#package not opening coz of error
library("olsrr")
#taking awhile so might have to choose variables on own
ols_step_forward_p(mylogit2)
#will try again
#making model
mylogit2<- lm(Survived ~ Pclass+Sex+SibSp+Fare+Embarked+Title, data=train, family= "binomial")
summary(mylogit2)
#taking awhile so might have to choose variables on own
ols_step_forward_p(mylogit2)
#will try again
#making model
mylogit2<- lm(Survived ~ Pclass+Sex+SibSp+Fare+Embarked+Title, data=train)
summary(mylogit2)
#taking awhile so might have to choose variables on own
ols_step_forward_p(mylogit2)
summary(mylogit2)
#will try again
#making model
?lm
as.numeric(Pclass)
#will try again
#making model
?lm
mylogit2<- lm(Survived ~ as.numeric(Pclass)+as.numeric(Sex)+as.numeric(SibSp)+Fare+as.numeric(Embarked)+as.numeric(Title), data=train)
#for some reason it is not loading
library("caret")
#predicting train data to see accuracy
pre_tdt <- predict(dt_model, data=train, type="class")
#presently cant view this coz the library wont load
confusionMatrix(pre_tdt, train$Survived)
cv.10 <- createMultiFolds(train_val$Survived, k = 10, times = 10)
?createMultiFolds
cv.10 <- createMultiFolds(train$Survived, k = 10, times = 10)
# Control
ctrl <- trainControl(method = "repeatedcv", number = 10, repeats = 10,
index = cv.10)
?train
#i'll just make another submission
prediction7 <- predict(pre_tdt, test)
pre_tdt
#i'll just make another submission
prediction7 <- predict(pre_tdt, test)
prediction6
summary(caret_svm)
train_pre<- predict(caret_svm, newdata=test, type="response")
train_pre
prediction6<- predict(caret_svm, newdata=test[-2], type="response")
prediction6
#making a submission
solution6 <- data.frame(test$PassengerId, prediction6)
colnames(solution6)
#renaming columns
names(solution6)[names(solution6) == "test.PassengerId"] <- "PassengerId"
names(solution6)[names(solution6) == "prediction6"] <- "Survived"
#creating solution file
write.csv(solution6, file="solution6.csv", row.names = F)
#setting and checking working directory
setwd("C:/Users/pande/Downloads/titanic")
#creating solution file
write.csv(solution6, file="solution6.csv", row.names = F)
?read.csv
?gsub
?paste
?rep
?rpart.plot
save.image("C:/Users/pande/Downloads/titanic/data.RData")
q()