- fann-1_2_0.zip
- fann-1.2.0
- aclocal.m4
- AUTHORS
- benchmarks
- .cvsignore
- benchmark.sh
- benchmarks.pdf
- ctimer.h
- datasets
- building.test
- building.train
- diabetes.test
- diabetes.train
- gene.test
- gene.train
- mushroom.test
- mushroom.train
- parity13.test
- parity13.train
- parity8.test
- parity8.train
- pumadyn-32fm.test
- pumadyn-32fm.train
- robot.test
- robot.train
- soybean.test
- soybean.train
- thyroid.test
- thyroid.train
- two-spiral.test
- two-spiral.train
- gnuplot
- Makefile
- parity.c
- performance.cc
- quality.cc
- quality_fixed.c
- README
- shuffle.c
- two-spirals.c
- ChangeLog
- config.guess
- config.in
- config.sub
- configure
- configure.in
- COPYING
- debian
- changelog
- compat
- control
- copyright
- docs
- libfann1.dirs
- libfann1.files
- libfann1.install
- libfann1-dev.dirs
- libfann1-dev.examples
- libfann1-dev.files
- libfann1-dev.install
- rules
- depcomp
- doc
- examples
- fann.pc.in
- fann.spec.in
- INSTALL
- install-sh
- ltmain.sh
- Makefile.am
- Makefile.in
- missing
- mkinstalldirs
- MSVC++
- all.dsw
- libfann.dsp
- simple_test.dsp
- simple_train.dsp
- steepness_train.dsp
- xor_test.dsp
- xor_train.dsp
- NEWS
- python
- README
- src
- TODO
- win32_dll
- vs_net2003.zip
- VS.NET2003
- all.sln
- libfann.vcproj
- simple_test.vcproj
- simple_train.vcproj
- steepness_train.vcproj
- xor_test.vcproj
- xor_train.vcproj
- fann_win32_dll-1_2_0.zip
|
#include "fann.h"
int main(int argc, char* argv[])
{
struct fann_train_data *train, *test, *all;
unsigned int i, j;
if(argc == 2){
train = fann_read_train_from_file(argv[1]);
fann_shuffle_train_data(train);
fann_save_train(train, argv[1]);
return;
}
if(argc != 3){
printf("usage: %s train_file test_file\n", argv[0]);
printf("will shuffle the data in the two files and save the new data back to them.\n\n");
printf("usage: %s train_file\n", argv[0]);
printf("will shuffle the data in the files.\n");
return -1;
}
train = fann_read_train_from_file(argv[1]);
test = fann_read_train_from_file(argv[2]);
all = fann_merge_train_data(train, test);
fann_shuffle_train_data(all);
for(i = 0; i < train->num_data; i++){
for(j = 0; j < train->num_input; j++){
train->input[i][j] = all->input[i][j];
}
for(j = 0; j < train->num_output; j++){
train->output[i][j] = all->output[i][j];
}
}
for(i = 0; i < test->num_data; i++){
for(j = 0; j < test->num_input; j++){
test->input[i][j] = all->input[i + train->num_data][j];
}
for(j = 0; j < test->num_output; j++){
test->output[i][j] = all->output[i + train->num_data][j];
}
}
fann_save_train(train, argv[1]);
fann_save_train(test, argv[2]);
return 0;
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.