Description Usage Arguments Value Slots See Also Examples
neuralnet
performs Neural Network on FLTable objects.
The DB Lytix function called is FLNNetUDT. Artificial neural networks are a family
of statistical learning algorithms inspired by biological neural networks
and are used to estimate or approximate transformations that depend on a
large number of inputs. Thesetransformation are then used to model the output.
In DB Lytix, neural network is implemented as a user-defined table function which takes
the input in deep format, the topography of the network along with some
hyper-parameters to calculate the neuron connection weights using the
back-propagation algorithm.
1 2 3 |
formula |
A symbolic description of model to be fitted |
data |
An object of class FLTable. |
hidden |
Number of neurons in the hidden layer |
layers |
Number of layers of Neural Net model as of now at Max 2 are alloed. |
epoch |
Maximum number of iterations |
Learningrate |
A symbolic description of model to be fitted |
isSigmoid |
Used to select execution mode: Regression or Classification |
neuralnet
returns an object of class FLNnet
results
cache list of results computed
table
Input data object
neuralnet
for R reference implementation.
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 | tbl <- FLTable("tblwinetrain", obs_id_colname = "OBSID")
rtbl <- as.R(tbl)
rtbl <- rtbl[, -c(1)]
n <- names(rtbl)
f <- as.formula(paste("Wine_Type ~", paste(n[!n %in% "Wine_Type"], collapse = " + ")))
For 1 layer.
flmod <- neuralnet(f, data = tbl, hidden = c(5), layers = 1)
rmod <- neuralnet(f, data = rtbl, hidden = c( 5))
For 2 layer
flmod <-neuralnet(f, data = tbl, hidden = c(10,5))
rmod <- neuralnet(f, data = rtbl, hidden = c(10, 5))
library(neuralnet)
flmod <- neuralnet(Wine_Type~.,data=tbl, hidden = c(10, 5))
flmod <- neuralnet(Wine_Type~ Alcohol + Ash,data=tbl)
rmod <- neuralnet(Wine_Type~ Alcohol + Ash,data=rtbl, hidden = c(5,5))
R Example:
library(MASS)
rdata <- Boston
n <- names(rdata)
f <- as.formula(paste("medv ~", paste(n[!n %in% "medv"], collapse = " + ")))
maxs <- apply(rdata, 2, max)
mins <- apply(rdata, 2, min)
rdata <- as.data.frame(scale(rdata, center = mins, scale = maxs - mins))
fltbl <- as.FL(rdata)
rmod <- neuralnet(f,data=rdata,hidden=c(5,3),linear.output=T)
flmod <- neuralnet(f, data = fltbl, hidden = c(5,3))
R example 2:
set.seed(100)
traininginput <- as.data.frame(runif(50, min=0, max=100))
trainingoutput <- sqrt(traininginput)
rtbl <- cbind(traininginput,trainingoutput)
colnames(rtbl) <- c("InputCol","OutputCol")
fltbl <- as.FL(rtbl)
rmod <- neuralnet(OutputCol~InputCol,data=rtbl,hidden=c(10),linear.output=T)
flmod <- neuralnet(OutputCol~InputCol,data=fltbl,hidden=c(10), IsSigmoid = 0, layers = 1)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.