Description Usage Arguments Details Value Examples
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
.
1 2 3 | read.fcnndataset(fname)
write.fcnndataset(fname, input, output)
|
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 |
Files are organised as follows:
The first comment (beginning with #
) is the dataset information (ignored on read),
three numbers determine: number of records, no. of inputs and no. of outputs,
each data record has two or three lines:
(optional) record information in a comment (beginning with #
),
line with input values,
line with output values.
read.fcnndataset
returns a dataframe.
write.fcnndataset
does not return.
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.