read-write-fcnndataset: Reading and writing datasets in the FCNN format

Description Usage Arguments Details Value Examples

Description

These functions can be used to read and write datasets from/to a text file in the FCNN format. Datasets in the similar FANN format (comments are not supported by FANN) can also be read by read.fcnndataset.

Usage

1
2
3
read.fcnndataset(fname)

write.fcnndataset(fname, input, output)

Arguments

fname

character string with the filename

input

numeric matrix, each row corresponds to one input vector

output

numeric matrix with rows corresponding to expected outputs, the number of rows must be equal to the number of input rows

Details

Files are organised as follows:

Value

read.fcnndataset returns a dataframe.

write.fcnndataset does not return.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# set up the XOR problem inputs and outputs
inp <- c(0, 0, 1, 1, 0, 1, 0, 1)
dim(inp) <- c(4, 2)
outp <- c(0, 1, 1, 0)
dim(outp) <- c(4, 1)
# write dataset
write.fcnndataset("xor.dat", inp, outp)
# show the output file
file.show("xor.dat")
# read dataset
xordf <- read.fcnndataset("xor.dat")
# show the imported dataset
show(xordf)

FCNN4R documentation built on May 29, 2017, 4:26 p.m.