Projet

Général

Profil

Data preparation with command line » Historique » Version 2

François Rioult, 03/12/2020 14:42

1 1 François Rioult
h1. Data preparation with command line
2
3 2 François Rioult
h2. Pré-requis
4
5
* "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)
6
* "Installer KDAriane"
7
8
9
10 1 François Rioult
h1. Data preparation
11
12
This is a tutorial for designing your first scenario with KDAriane.
13
!https://forge.greyc.fr/attachments/355/dataPreparationGeneric.png!
14
15
* launch Ariane with
16
<pre>
17
java -jar ariane.jar
18
</pre>
19
20
* click on the "New graph" icon (or in the File menu)
21
!https://forge.greyc.fr/attachments/14/a1.png! 
22
23
* in the left column, in the operator list, in the file category, drag a _loader_ operator on the design chart.
24
!https://forge.greyc.fr/attachments/15/a2.png!
25
26
* set the file to be loaded by double-clicking on the operator, then click on _load_ and find the @zoo.csv@ file.
27
!https://forge.greyc.fr/attachments/16/a3.png!
28
29
* execute the operator by right-clicking on the operator for showing the contextual menu, then left-click on _execute_.
30
!https://forge.greyc.fr/attachments/17/a4.png!
31
32
* the operator state went to green. You can now visualize the result (the input file) by double-clicking on the operator the press _show_.
33
<pre>
34
1,1,0,0,1,0,0,1,1,1,1,0,0,4,0,0,1
35
1,1,0,0,1,0,0,0,1,1,1,0,0,4,1,0,1
36
4,0,0,1,0,0,1,1,1,1,0,0,1,0,1,0,0
37
1,1,0,0,1,0,0,1,1,1,1,0,0,4,0,0,1
38
1,1,0,0,1,0,0,1,1,1,1,0,0,4,1,0,1
39
1,1,0,0,1,0,0,0,1,1,1,0,0,4,1,0,1
40
1,1,0,0,1,0,0,0,1,1,1,0,0,4,1,1,1
41
...
42
</pre>
43
!https://forge.greyc.fr/attachments/18/a5.png!
44
45
* 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.
46
<pre>
47
0 Class
48
0 hair
49
0 feathers
50
0 eggs
51
0 milk
52
0 airborne
53
0 aquatic
54
0 predator
55
0 toothed
56
0 backbone
57
0 breathes
58
0 venomous
59
0 fins
60
0 legs
61
0 tail
62
0 domestic
63
0 catsize
64
</pre>
65
66
* 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@.
67
!https://forge.greyc.fr/attachments/10/a6.png!
68
69
* @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@.  
70
!https://forge.greyc.fr/attachments/11/a7.png!
71
* the name of an operator can be changed in the contextual menu: change it here with @dictionary@.
72
!https://forge.greyc.fr/attachments/12/a8.png!
73
* you can now run the operator and view the result by double-clicking on it then press _show_.
74
<pre>
75
#Class
76
1
77
2
78
3
79
4
80
5
81
6
82
7
83
#hair
84
0
85
1
86
#feathers
87
0
88
1
89
#eggs
90
0
91
1
92
...
93
</pre>
94
* 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.
95
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.
96
The @zoo.bin@ file contains now the binary data:
97
<pre>
98
# binairisation du fichier /home/frioult/svn/kdariane/ariane/data/zoo.csv
99
1 9 10 12 15 16 18 21 23 25 27 28 30 34 38 40 43 
100
1 9 10 12 15 16 18 20 23 25 27 28 30 34 39 40 43 
101
4 8 10 13 14 16 19 21 23 25 26 28 31 32 39 40 42 
102
1 9 10 12 15 16 18 21 23 25 27 28 30 34 38 40 43 
103
1 9 10 12 15 16 18 21 23 25 27 28 30 34 39 40 43 
104
1 9 10 12 15 16 18 20 23 25 27 28 30 34 39 40 43 
105
1 9 10 12 15 16 18 20 23 25 27 28 30 34 39 41 43
106
</pre>
107
and the translation file:
108
<pre>
109
#0
110
1 Class<=1
111
2 Class<=2
112
3 Class<=3
113
4 Class<=4
114
5 Class<=5
115
6 Class<=6
116
7 Class<=7
117
#1
118
8 hair<=0
119
9 hair<=1
120
#2
121
10 feathers<=0
122
11 feathers<=1
123
#3
124
12 eggs<=0
125
13 eggs<=1
126
#4
127
14 milk<=0
128
15 milk<=1
129
</pre>
130
!https://forge.greyc.fr/attachments/13/a9.png!