Package parsimony :: Package datasets :: Module Russett
[hide private]
[frames] | no frames]

Source Code for Module parsimony.datasets.Russett

  1  # -*- coding: utf-8 -*- 
  2  """ 
  3  Created on Mon Apr 22 11:13:02 2013 
  4   
  5  Copyright (c) 2013-2014, CEA/DSV/I2BM/Neurospin. All rights reserved. 
  6   
  7  @author:  Tommy Löfstedt 
  8  @email:   tommy.loefstedt@cea.fr 
  9  @license: BSD 3-clause. 
 10  """ 
 11  import numpy as np 
 12   
 13  __all__ = ['load', 'labels'] 
 14   
 15   
16 -def load():
17 X_agric = np.asarray([[86.3, 98.2, 3.52], 18 [92.9, 99.6, 3.27], 19 [74.0, 97.4, 2.46], 20 [58.7, 85.8, 4.15], 21 [93.8, 97.7, 3.04], 22 [83.7, 98.5, 2.31], 23 [49.7, 82.9, 2.10], 24 [93.8, 99.7, 2.67], 25 [84.9, 98.1, 2.57], 26 [88.1, 99.1, 1.86], 27 [79.2, 97.8, 4.00], 28 [45.8, 79.3, 1.50], 29 [79.5, 98.5, 3.08], 30 [86.4, 99.3, 2.75], 31 [74.0, 98.1, 2.53], 32 [82.8, 98.8, 2.78], 33 [59.9, 86.3, 1.22], 34 [58.3, 86.1, 3.30], 35 [86.0, 99.7, 2.89], 36 [74.7, 99.4, 2.93], 37 [75.7, 97.4, 2.87], 38 [52.2, 86.9, 3.99], 39 [88.1, 99.3, 4.33], 40 [59.8, 85.9, 1.25], 41 [80.3, 98.0, 3.21], 42 [47.0, 81.5, 1.36], 43 [70.0, 93.0, 2.25], 44 [63.8, 87.7, 2.99], 45 [60.5, 86.2, 3.99], 46 [77.3, 95.5, 3.15], 47 [75.7, 96.4, 2.39], 48 [66.9, 87.5, 2.14], 49 [73.7, 95.0, 2.59], 50 [87.5, 96.9, 2.61], 51 [56.4, 88.2, 3.65], 52 [45.0, 77.7, 0.00], 53 [67.1, 94.6, 3.04], 54 [78.0, 99.5, 3.80], 55 [57.7, 87.2, 2.99], 56 [49.8, 81.5, 2.99], 57 [65.2, 94.1, 3.71], 58 [71.0, 93.4, 3.82], 59 [70.5, 95.4, 3.06], 60 [81.7, 96.6, 3.58], 61 [90.9, 99.3, 3.07], 62 [67.4, 93.0, 1.90], 63 [43.7, 79.8, 0.00]]) 64 65 X_ind = np.asarray([[5.92, 3.22], 66 [7.10, 2.64], 67 [6.28, 3.47], 68 [6.92, 2.30], 69 [4.19, 4.28], 70 [5.57, 4.11], 71 [7.42, 2.48], 72 [5.19, 3.40], 73 [5.80, 4.01], 74 [5.73, 4.01], 75 [5.89, 3.74], 76 [6.82, 3.14], 77 [5.32, 4.03], 78 [5.32, 3.97], 79 [4.89, 4.16], 80 [5.50, 4.14], 81 [6.85, 3.83], 82 [6.95, 3.26], 83 [5.19, 4.22], 84 [5.48, 3.87], 85 [4.92, 4.19], 86 [4.28, 4.26], 87 [5.27, 4.39], 88 [6.23, 3.69], 89 [6.09, 3.37], 90 [5.48, 3.69], 91 [4.50, 4.32], 92 [7.09, 3.14], 93 [6.56, 2.40], 94 [7.14, 2.77], 95 [5.54, 4.22], 96 [6.88, 3.26], 97 [5.86, 3.99], 98 [4.94, 4.09], 99 [5.30, 4.08], 100 [6.15, 4.04], 101 [4.89, 4.17], 102 [5.54, 3.91], 103 [7.06, 2.56], 104 [7.11, 2.30], 105 [4.88, 3.91], 106 [6.91, 1.61], 107 [7.76, 2.30], 108 [6.34, 3.61], 109 [6.64, 3.74], 110 [6.64, 2.64], 111 [5.69, 4.20]]) 112 113 X_polit = np.asarray([[0, 0], 114 [1, 0], 115 [0, 0], 116 [1, 0], 117 [0, 1], 118 [0, 0], 119 [1, 0], 120 [0, 0], 121 [0, 0], 122 [0, 0], 123 [0, 1], 124 [1, 0], 125 [0, 1], 126 [0, 1], 127 [0, 1], 128 [0, 1], 129 [0, 0], 130 [0, 0], 131 [0, 1], 132 [0, 0], 133 [0, 1], 134 [1, 0], 135 [0, 1], 136 [1, 0], 137 [0, 0], 138 [0, 0], 139 [0, 1], 140 [1, 0], 141 [1, 0], 142 [1, 0], 143 [0, 1], 144 [1, 0], 145 [0, 1], 146 [0, 1], 147 [0, 1], 148 [0, 1], 149 [0, 1], 150 [0, 1], 151 [1, 0], 152 [1, 0], 153 [0, 1], 154 [1, 0], 155 [1, 0], 156 [1, 0], 157 [0, 1], 158 [0, 0], 159 [0, 1]]) 160 161 return X_agric, X_ind, X_polit
162 163
164 -def labels():
165 return [("gini", "farm", "rent"), 166 ("gnpr", "labo"), 167 ("demostab", "dictatur")]
168