data = read.csv("test.csv")
samplesize = 0.6* nrow(data)
set.seed(80)
index = sample( seq_len(nrow(data)), size=samplesize)
trainset = data[index,]
testset = data[-index,]
max = apply(data , 2 , max)
min = apply(data , 2 , min)
scaled = as.data.frame(scale(data, center = min , scale = max - min))
str(data)
data$Adj.Close = as.numeric(data$Adj.Close)
install.packages("neuralnet")
library(neuralnet)
trainNN =scaled[index,]
testNN = scaled[-index,]
set.seed(2)
NN = neuralnet(Adj.Close ~ Inflation + GDP.growth.rate + Unemployment.Rate + House.Price.index + Construction.Output,
trainNN, hidden = 3, linear.output = F )