neuralnet.FLTable: 'neuralnet' performs Neural Network on FLTable objects. The...

Description Usage Arguments Value Slots See Also Examples

Description

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.

Usage

1
2
3
## S3 method for class 'FLNnet'
plot(formula, data, fetchID = TRUE, hidden = 5,
  layers = 2, learningrate = 0.2, epoch = 500, IsSigmoid = 1, ...)

Arguments

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

Value

neuralnet returns an object of class FLNnet

Slots

results

cache list of results computed

table

Input data object

See Also

neuralnet for R reference implementation.

Examples

 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)

Fuzzy-Logix/AdapteR documentation built on May 6, 2019, 5:07 p.m.