Data preparation with command line » Historique » Révision 2
Révision 1 (François Rioult, 03/12/2020 14:40) → Révision 2/3 (François Rioult, 03/12/2020 14:42)
h1. Data preparation with command line
h2. Pré-requis
* "Installer les pré-requis de KDAriane":https://forge.greyc.fr/projects/kdariane/wiki/Prerequisite (laisser tomber le côté Java, nous n'en aurons pas besoin)
* "Installer KDAriane"
h1. Data preparation
This is a tutorial for designing your first scenario with KDAriane.
!https://forge.greyc.fr/attachments/355/dataPreparationGeneric.png!
* launch Ariane with
<pre>
java -jar ariane.jar
</pre>
* click on the "New graph" icon (or in the File menu)
!https://forge.greyc.fr/attachments/14/a1.png!
* in the left column, in the operator list, in the file category, drag a _loader_ operator on the design chart.
!https://forge.greyc.fr/attachments/15/a2.png!
* set the file to be loaded by double-clicking on the operator, then click on _load_ and find the @zoo.csv@ file.
!https://forge.greyc.fr/attachments/16/a3.png!
* execute the operator by right-clicking on the operator for showing the contextual menu, then left-click on _execute_.
!https://forge.greyc.fr/attachments/17/a4.png!
* the operator state went to green. You can now visualize the result (the input file) by double-clicking on the operator the press _show_.
<pre>
1,1,0,0,1,0,0,1,1,1,1,0,0,4,0,0,1
1,1,0,0,1,0,0,0,1,1,1,0,0,4,1,0,1
4,0,0,1,0,0,1,1,1,1,0,0,1,0,1,0,0
1,1,0,0,1,0,0,1,1,1,1,0,0,4,0,0,1
1,1,0,0,1,0,0,1,1,1,1,0,0,4,1,0,1
1,1,0,0,1,0,0,0,1,1,1,0,0,4,1,0,1
1,1,0,0,1,0,0,0,1,1,1,0,0,4,1,1,1
...
</pre>
!https://forge.greyc.fr/attachments/18/a5.png!
* add a second file loader for @zoo.col@, that contains the description of the columns. Each line starts with an integer telling how much intervals with homogeneous population should be computed. It is zero is the attribute is qualitative. Then the name of the attribute appears.
<pre>
0 Class
0 hair
0 feathers
0 eggs
0 milk
0 airborne
0 aquatic
0 predator
0 toothed
0 backbone
0 breathes
0 venomous
0 fins
0 legs
0 tail
0 domestic
0 catsize
</pre>
* from the personal operators, category _shell_, drag an "eval121":[[eval121]] operator. It has two inputs, to which the file loaders should be connected: drag the small blue square from the left of the loader to the top input of @eval121@.
!https://forge.greyc.fr/attachments/10/a6.png!
* @eval121@ invokes a binary with the shell. Here we need to compute the dictionary of the data, given the columns description: double click on the operator and fill the parameter with @dictionary@.
!https://forge.greyc.fr/attachments/11/a7.png!
* the name of an operator can be changed in the contextual menu: change it here with @dictionary@.
!https://forge.greyc.fr/attachments/12/a8.png!
* you can now run the operator and view the result by double-clicking on it then press _show_.
<pre>
#Class
1
2
3
4
5
6
7
#hair
0
1
#feathers
0
1
#eggs
0
1
...
</pre>
* in order to complete the scenario, add an "eval122":[[eval122]] for invoking @segmentation@, that computes the binary data and the translation file (for further use) starting from the CSV data and the dictionary computed with the previous operator.
You may also add a viewer operator (and specify which viewer you want - gedit by default), and two saver operator for permanently writing the result.
The @zoo.bin@ file contains now the binary data:
<pre>
# binairisation du fichier /home/frioult/svn/kdariane/ariane/data/zoo.csv
1 9 10 12 15 16 18 21 23 25 27 28 30 34 38 40 43
1 9 10 12 15 16 18 20 23 25 27 28 30 34 39 40 43
4 8 10 13 14 16 19 21 23 25 26 28 31 32 39 40 42
1 9 10 12 15 16 18 21 23 25 27 28 30 34 38 40 43
1 9 10 12 15 16 18 21 23 25 27 28 30 34 39 40 43
1 9 10 12 15 16 18 20 23 25 27 28 30 34 39 40 43
1 9 10 12 15 16 18 20 23 25 27 28 30 34 39 41 43
</pre>
and the translation file:
<pre>
#0
1 Class<=1
2 Class<=2
3 Class<=3
4 Class<=4
5 Class<=5
6 Class<=6
7 Class<=7
#1
8 hair<=0
9 hair<=1
#2
10 feathers<=0
11 feathers<=1
#3
12 eggs<=0
13 eggs<=1
#4
14 milk<=0
15 milk<=1
</pre>
!https://forge.greyc.fr/attachments/13/a9.png!