ANN Algorithm

The Artificial Neural Network (ANN) Algorithm is a computational model inspired by the structure and function of biological neural networks, which aims to mimic the human brain's ability to learn and process information. ANN algorithms consist of a large number of interconnected processing units called neurons or nodes, organized into layers. These layers include an input layer, one or more hidden layers, and an output layer. Each connection between the nodes carries a weight, which determines the strength of the connection. The primary function of an ANN is to receive input data, process it through the interconnected nodes, and generate an output based on the weights of the connections. The learning process in ANN involves adjusting the weights of the connections and biases to minimize the error between the predicted output and the actual output. This is typically achieved using a backpropagation algorithm, which calculates the gradient of the error with respect to each weight and adjusts the weights accordingly. The backpropagation process occurs iteratively, updating the weights in response to the input data and error feedback, eventually converging to the optimal set of weights that minimize the error. ANN algorithms have found wide-ranging applications in diverse fields such as computer vision, natural language processing, speech recognition, and game playing, owing to their ability to adapt to complex data patterns and make accurate predictions or classifications.
library(neuralnet)
concrete<-read.csv(file = "concrete.txt",stringsAsFactors = F)#get the data
normalize<-function(x){
  return((x-min(x))/(max(x)-min(x)))
}
concrete<-as.data.frame(lapply(concrete, normalize))
concrete_train<-concrete[1:773,]
concrete_test<-concrete[774:1030,]
concrete_model<-neuralnet(strength~cement+slag+ash+water+superplastic+coarseagg+fineagg+age,data = concrete_train,hidden = 5)
model_res<-compute(concrete_model,concrete_test[,1:8])
x=model_res$net.result
y=concrete_test$strength
cor(x,y)
plot(concrete_model)

LANGUAGE:

DARK MODE: