Skip to content
This repository was archived by the owner on Dec 6, 2023. It is now read-only.

Commit 19e14d2

Browse files
committed
Trying to get tests to pass on windows 32
1 parent 42ca541 commit 19e14d2

File tree

5 files changed

+43
-43
lines changed

5 files changed

+43
-43
lines changed

pyearth/test/earth_linvars_regress.txt

Lines changed: 22 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2,46 +2,40 @@ Forward Pass
22
---------------------------------------------------------------
33
iter parent var knot mse terms gcv rsq grsq
44
---------------------------------------------------------------
5-
0 - - - 3.138100 1 3.202 0.000 0.000
6-
1 0 1 -1 1.645176 2 1.731 0.476 0.459
7-
2 0 9 -1 1.550858 3 1.683 0.506 0.474
8-
3 0 2 -1 1.526423 4 1.709 0.514 0.466
9-
4 0 0 -1 1.506426 5 1.742 0.520 0.456
10-
5 0 3 -1 1.499933 6 1.792 0.522 0.440
11-
6 0 8 -1 1.493113 7 1.843 0.524 0.424
12-
7 0 5 -1 1.489506 8 1.902 0.525 0.406
13-
8 0 4 -1 1.488115 9 1.966 0.526 0.386
5+
0 - - - 1.446276 1 1.449 0.000 0.000
6+
1 0 2 -1 1.337676 2 1.344 0.075 0.072
7+
2 0 1 -1 1.243145 3 1.253 0.140 0.135
8+
3 0 9 -1 1.231652 4 1.245 0.148 0.141
9+
4 0 7 -1 1.226752 5 1.244 0.152 0.142
10+
5 0 6 -1 1.224424 6 1.246 0.153 0.141
11+
6 0 5 -1 1.224378 7 1.249 0.153 0.138
1412
---------------------------------------------------------------
1513
Stopping Condition 2: Improvement below threshold
1614

1715
Pruning Pass
1816
--------------------------------------------
1917
iter bf terms mse gcv rsq grsq
2018
--------------------------------------------
21-
0 - 9 1.49 1.966 0.526 0.386
22-
1 8 8 1.49 1.902 0.525 0.406
23-
2 7 7 1.49 1.843 0.524 0.424
24-
3 6 6 1.50 1.792 0.522 0.440
25-
4 5 5 1.51 1.742 0.520 0.456
26-
5 4 4 1.53 1.709 0.514 0.466
27-
6 3 3 1.55 1.683 0.506 0.474
28-
7 2 2 1.65 1.731 0.476 0.459
29-
8 1 1 3.14 3.202 0.000 0.000
19+
0 - 7 1.22 1.249 0.153 0.138
20+
1 6 6 1.22 1.246 0.153 0.141
21+
2 5 5 1.23 1.244 0.152 0.142
22+
3 4 4 1.23 1.245 0.148 0.141
23+
4 3 3 1.24 1.253 0.140 0.135
24+
5 2 2 1.34 1.344 0.075 0.072
25+
6 1 1 1.45 1.449 0.000 0.000
3026
--------------------------------------------
31-
Selected iteration: 6
27+
Selected iteration: 2
3228

3329
Earth Model
3430
-------------------------------------
3531
Basis Function Pruned Coefficient
3632
-------------------------------------
37-
(Intercept) No -0.724619
38-
x1 No -1.22789
39-
x9 No 0.312554
40-
x2 Yes None
41-
x0 Yes None
42-
x3 Yes None
43-
x8 Yes None
33+
(Intercept) No -0.175087
34+
x2 No -0.324883
35+
x1 No 0.323321
36+
x9 No 0.107659
37+
x7 No -0.0704048
38+
x6 Yes None
4439
x5 Yes None
45-
x4 Yes None
4640
-------------------------------------
47-
MSE: 1.5509, GCV: 1.6828, RSQ: 0.5058, GRSQ: 0.4744
41+
MSE: 1.2268, GCV: 1.2441, RSQ: 0.1518, GRSQ: 0.1415

pyearth/test/earth_regress.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.770192298381
1+
0.219175992389
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.736159939602
1+
0.178314473548
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.756056155003
1+
0.209074299412

pyearth/test/test_earth.py

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
import pyearth
2323
from numpy.testing.utils import assert_array_almost_equal
2424

25+
regenerate_target_files = False
26+
2527
numpy.random.seed(1)
2628
basis = Basis(10)
2729
constant = ConstantBasisFunction()
@@ -32,13 +34,13 @@
3234
basis.append(bf1)
3335
basis.append(bf2)
3436
basis.append(bf3)
35-
X = numpy.random.normal(size=(100, 10))
37+
X = numpy.random.normal(size=(1000, 10))
3638
missing = numpy.zeros_like(X, dtype=BOOL)
37-
B = numpy.empty(shape=(100, 4), dtype=numpy.float64)
39+
B = numpy.empty(shape=(1000, 4), dtype=numpy.float64)
3840
basis.transform(X, missing, B)
3941
beta = numpy.random.normal(size=4)
40-
y = numpy.empty(shape=100, dtype=numpy.float64)
41-
y[:] = numpy.dot(B, beta) + numpy.random.normal(size=100)
42+
y = numpy.empty(shape=1000, dtype=numpy.float64)
43+
y[:] = numpy.dot(B, beta) + numpy.random.normal(size=1000)
4244
default_params = {"penalty": 1}
4345

4446
@if_platform_not_win_32
@@ -160,8 +162,9 @@ def test_missing_data():
160162
res = str(earth.score(X_, y))
161163
filename = os.path.join(os.path.dirname(__file__),
162164
'earth_regress_missing_data.txt')
163-
# with open(filename, 'w') as fl:
164-
# fl.write(res)
165+
if regenerate_target_files:
166+
with open(filename, 'w') as fl:
167+
fl.write(res)
165168
with open(filename, 'r') as fl:
166169
prev = fl.read()
167170
try:
@@ -177,8 +180,9 @@ def test_fit():
177180
res = str(earth.rsq_)
178181
filename = os.path.join(os.path.dirname(__file__),
179182
'earth_regress.txt')
180-
# with open(filename, 'w') as fl:
181-
# fl.write(res)
183+
if regenerate_target_files:
184+
with open(filename, 'w') as fl:
185+
fl.write(res)
182186
with open(filename, 'r') as fl:
183187
prev = fl.read()
184188
assert_true(abs(float(res) - float(prev)) < .05)
@@ -191,8 +195,9 @@ def test_smooth():
191195
res = str(model.rsq_)
192196
filename = os.path.join(os.path.dirname(__file__),
193197
'earth_regress_smooth.txt')
194-
# with open(filename, 'w') as fl:
195-
# fl.write(res)
198+
if regenerate_target_files:
199+
with open(filename, 'w') as fl:
200+
fl.write(res)
196201
with open(filename, 'r') as fl:
197202
prev = fl.read()
198203
assert_true(abs(float(res) - float(prev)) < .05)
@@ -204,8 +209,9 @@ def test_linvars():
204209
res = str(earth.trace()) + '\n' + earth.summary()
205210
filename = os.path.join(os.path.dirname(__file__),
206211
'earth_linvars_regress.txt')
207-
# with open(filename, 'w') as fl:
208-
# fl.write(res)
212+
if regenerate_target_files:
213+
with open(filename, 'w') as fl:
214+
fl.write(res)
209215
with open(filename, 'r') as fl:
210216
prev = fl.read()
211217

0 commit comments

Comments
 (0)