Skip to content
Gustavo Rosa edited this page Sep 29, 2016 · 3 revisions

The LibOPF package contains a directory LibOPF/tools, in which you can find some useful tools. At this moment, we have available:

  • runOPF.sh: a script that executes the supervised OPF several times (defined by the user) and outputs the mean accuracy and the mean training and test execution times (seconds), with their respectively standard deviations.

  • runLearning.sh: a script that executes the supervised OPF with and without learning several times (defined by the user) and outputs the mean accuracy and the mean training and test execution times (seconds), with their respectively standard deviations. This script allow you to compare the OPF performance with and without learning algorithm.

  • txt2opf: a program to convert OPF files written in ASCII format to binary format.

  • opf2txt: a program to convert OPF files written in binary format to ASCII format.

  • opf_check: a program to check whether a file is in the OPF required format.

  • statistics: a program that computes basic information such as mean average and standard deviation. The user can output the accuracies in a TEXT file and then use 'statistics' to compute the mean accuracy and standard deviation of the results.

  • opf2svm: a program to convert binary OPF files to LibSVM format.

  • svm2opf: a program to convert LibSVM files to binary OPF format.

  • kmeans: a program to find cluster centroids by kmeans clustering.


runOPF.sh Usage

Usage: run_sh <P1> <P2> <P3> <P4> <P5>

P1: dataset file name
P2: percentage for the training set size [0,1]
P3: percentage for the test set size [0,1]
P4: normalize features? 1 - Yes 0 - No
P5: running times

runLearning.sh Usage

Usage: run_sh <P1> <P2> <P3> <P4> <P5> <P6>

P1: dataset file name
P2: percentage for the training set size [0,1]
P3: percentage for the evaluating set size [0,1]
P4: percentage for the test set size [0,1]
P5: normalize features? 1 - Yes 0 - No
P6: running times

txt2opf Usage

Usage: txt2opf <P1> <P2>

P1: input OPF file name in the ASCII format
P2: output OPF file name in the binary format

opf2txt Usage

Usage: opf2txt <P1> <P2>

P1: input OPF file name in the binary format
P2: output OPF file name in the ASCII format

opf_check Usage

Usage: opf_check <P1>

P1: input OPF file name in the ASCII format

Notice the input to opf_check is a txt file.

statistics Usage

Usage: statistics <P1> <P2> <P3>

P1: file name
P2: running times
P3: message (the user may need to output some message in the screen)

Therefore, a recommended pipeline to create and to check the correctness of your OPF file can performed as follows:

(1) create your txt file in the LibOPF required format;
(2) use tools/opf_check to check if it is in the proper format; and
(3) if your file format has passed through opf_check requirements, use tools/txt2opf to convert your txt file to a binary version to be used in LibOPF.

opf2svm Usage

Usage: opf2svm <P1> <P2>

P1: input binary OPF file name
P2: output LibSVM file name

svm2opf Usage

Usage: svm2opf <P1> <P2>

P1: input LibSVM file name
P2: output binary OPF file name

kmeans Usage

Usage: kmeans <P1> <P2> <P3>

P1: input LibOPF file name
P2: number of clusters (k)
P3: output file name that will contain clusters centroids values