machine-learning.data-sets: adding the linnerud dataset.

db4
John Benediktsson 2012-12-04 10:21:04 -08:00
parent bb3d028d30
commit 4487cf3976
4 changed files with 79 additions and 2 deletions

View File

@ -1,8 +1,8 @@
! Copyright (C) 2012 John Benediktsson
! See http://factorcode.org/license.txt for BSD license
USING: assocs csv io.encodings.utf8 io.files kernel math.parser
sequences ;
USING: accessors ascii assocs csv io.encodings.utf8 io.files
kernel math.parser sequences splitting ;
IN: machine-learning.data-sets
@ -17,6 +17,11 @@ C: <data-set> data-set
"resource:extra/machine-learning/data-sets/" prepend
utf8 file-contents ;
: load-table ( name -- data names )
load-file [ blank? ] trim string-lines
[ [ blank? ] split-when ] map unclip
[ [ [ string>number ] map ] map ] dip ;
PRIVATE>
: load-iris ( -- data-set )
@ -32,3 +37,12 @@ PRIVATE>
"sepal length (cm)" "sepal width (cm)"
"petal length (cm)" "petal width (cm)"
} <data-set> ;
: load-linnerud ( -- data-set )
data-set new
"linnerud_exercise.csv" load-table
[ >>data ] [ >>feature-names ] bi*
"linnerud_physiological.csv" load-table
[ >>target ] [ >>target-names ] bi*
"linnerud.rst" load-file >>description ;

View File

@ -0,0 +1,21 @@
Linnerrud dataset
Notes
-----
Data Set Characteristics:
:Number of Instances: 20
:Number of Attributes: 3
:Missing Attribute Values: None
The Linnerud dataset constains two small dataset:
- *exercise*: A list containing the following components: exercise data with
20 observations on 3 exercise variables: Weight, Waist and Pulse.
- *physiological*: Data frame with 20 observations on 3 physiological variables:
Chins, Situps and Jumps.
References
----------
* http://rgm2.lab.nig.ac.jp/RGM2/func.php?rd_id=mixOmics:linnerud
* Tenenhaus, M. (1998). La regression PLS: theorie et pratique. Paris: Editions Technic.

View File

@ -0,0 +1,21 @@
Chins Situps Jumps
5 162 60
2 110 60
12 101 101
12 105 37
13 155 58
4 101 42
8 101 38
6 125 40
15 200 40
17 251 250
17 120 38
13 210 115
14 215 105
1 50 50
6 70 31
12 210 120
4 60 25
11 230 80
15 225 73
2 110 43
1 Chins Situps Jumps
2 5 162 60
3 2 110 60
4 12 101 101
5 12 105 37
6 13 155 58
7 4 101 42
8 8 101 38
9 6 125 40
10 15 200 40
11 17 251 250
12 17 120 38
13 13 210 115
14 14 215 105
15 1 50 50
16 6 70 31
17 12 210 120
18 4 60 25
19 11 230 80
20 15 225 73
21 2 110 43

View File

@ -0,0 +1,21 @@
Weight Waist Pulse
191 36 50
189 37 52
193 38 58
162 35 62
189 35 46
182 36 56
211 38 56
167 34 60
176 31 74
154 33 56
169 34 50
166 33 52
154 34 64
247 46 50
193 36 46
202 37 62
176 37 54
157 32 52
156 33 54
138 33 68
1 Weight Waist Pulse
2 191 36 50
3 189 37 52
4 193 38 58
5 162 35 62
6 189 35 46
7 182 36 56
8 211 38 56
9 167 34 60
10 176 31 74
11 154 33 56
12 169 34 50
13 166 33 52
14 154 34 64
15 247 46 50
16 193 36 46
17 202 37 62
18 176 37 54
19 157 32 52
20 156 33 54
21 138 33 68