Commit 56496f1 1 parent 1126df0 commit 56496f1 Copy full SHA for 56496f1
File tree 4 files changed +20
-2
lines changed
4 files changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ object App {
36
36
val tfilename = " train" + i + " .csv"
37
37
val efilename = " estimate" + i + " .csv"
38
38
val train = DataReader .trainRead(tfilename)
39
- val wlist = LeastSquares .estimate(train, 10.0 )
39
+ val wlist = LeastSquares .estimate(train, 0.000000001 )
40
40
val test = DataReader .testRead(" test.csv" )
41
41
val estimate = new PrintWriter (efilename)
42
42
Original file line number Diff line number Diff line change 7
7
from pylab import *
8
8
9
9
if __name__ == "__main__" :
10
+ sumts = []
11
+ sumxs = []
12
+ for j in range (0 , 500 ):
13
+ sumts .append (0 )
14
+
10
15
for i in range (0 , 19 ):
11
16
estimate = open ('estimate' + str (i ) + '.csv' , 'rb' )
12
17
13
18
estreader = csv .reader (estimate )
14
19
estxs = []
15
20
estts = []
21
+ k = 0
16
22
for row in estreader :
17
23
estxs .append (row [0 ])
18
24
estts .append (row [1 ])
25
+ if len (sumxs ) < 500 :
26
+ sumxs .append (row [0 ])
27
+ sumts [k ] = float (row [1 ]) + sumts [k ]
28
+ k += 1
19
29
estxs = array (estxs )
20
30
estts = array (estts )
21
31
25
35
xlim (0.0 , 1.0 )
26
36
ylim (- 1.5 , 1.5 )
27
37
estimate .close ()
28
-
38
+
39
+ for i in range (0 , 500 ):
40
+ sumts [i ] = sumts [i ] / 20
41
+
42
+ sumts = array (sumts )
43
+ sumxs = array (sumxs )
44
+ print len (sumts )
45
+ print len (sumxs )
46
+ plot (sumxs , sumts , 'r|' )
29
47
show ()
30
48
31
49
You can’t perform that action at this time.
0 commit comments