reconstructNetDefinition: Reconstruct the NET# net definition from an neuralNet object

Description Usage Arguments Value See Also Examples

View source: R/reconstructNetDefinition.R

Description

Reconstruct the NET# net definition from an neuralNet object

Usage

1
reconstructNetDefinition(modelObject, filename = NULL)

Arguments

modelObject

A neuralNet model object

filename

Optional file name. If supplied, write model specification to file.

Value

A character vector containing the net definition

See Also

readNetDefinition

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
library(MicrosoftML)
neuralNet(isCase ~ age + parity + education + spontaneous + induced,
                     transforms = list(isCase = case == 1),
                     data = infert,
                     numHiddenNodes = 3, 
                     verbose = 1, 
                     reportProgress = 0,
            numIterations = 20
)
model <- neuralNet(isCase ~ age + parity + education + spontaneous + induced,
                    transforms = list(isCase = case == 1),
                    data = infert,
                    numHiddenNodes = 3, 
                    verbose = 1, 
                    reportProgress = 0,
                    numIterations = 10
)
reconstructNetDefinition(model)
cat(reconstructNetDefinition(model))
tf <- tempfile(fileext = ".nn")

reconstructNetDefinition(model, filename = tf)
cat(
  readNetDefinition(tf)
)


neuralNet(isCase ~ age + parity + education + spontaneous + induced,
            transforms = list(isCase = case == 1),
            data = infert, 
            netDefinition = readNetDefinition(tf),
            numIterations = 10
            )

andrie/mxNeuralNetExtra documentation built on June 3, 2017, 7:02 p.m.