Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions Logic 1.0

This file was deleted.

41 changes: 41 additions & 0 deletions The Predictors Logic 1.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#Logic for the ideation stage

1. Start
#we have used summary function to determine the number of Na's in the data given
summary(input_data)

#we also tried to fit normal distribution but it was not following its some basic properties such as the proportion of concentration of data corresponding to Z values.
#data is not plotted as belled shape

# we also tried to use the data as time series object but the main feature of multivariate time series data i.e the variable to be co-integrated is I(1) does not fulfilled.

2. Imputation process for missing values

#we have used mean imputation, but it was not following the trend and adhering to dataset.
#mean imputation
(data_i$M4[which(is.na(data_i$M4))]=mean(data_i$M4,na.rm=TRUE))

# imputing the missing values
# mice imputation using pmm method 'Predictive mean matching'
# we used pmm method as data doesn't follow normal distribution so this method
#gives us an egde over regression method

my_imp<-mice(input_data[,17:21],m=5,method="pmm",maxit = 200)
my_imp$imp$M4
summary(input_data$M4)
input_data[,17:21]=complete(my_imp,1)


3. Predicting future values

# prediction for the fifth week
#we have assumed that data of monday in week 5 will be dependent on previous weeks data.
M5<-lm(input_data$M4~input_data$M1+input_data$M2+input_data$M3,data = input_data)
# similarly we have computed the values for rest 4 days

4. Quality process for imputation
#we have observed linear trend within the week
#we check the quality of imputation used

5. End