Commit c588872 1 parent 0c1f8e4 commit c588872 Copy full SHA for c588872
File tree 1 file changed +4
-4
lines changed
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -47,9 +47,9 @@ def test_population(ml):
47
47
sample_idx = np .random .choice (np .arange (len (X_train )), size = 10 )
48
48
49
49
y_train = y_train [sample_idx ]
50
- X_train = X_train .iloc [sample_idx ]. values
50
+ X_train = X_train .iloc [sample_idx ]
51
51
52
- algorithm .est .fit (X_train , y_train )
52
+ algorithm .est .fit (X_train . values , y_train )
53
53
54
54
if 'get_population' not in dir (algorithm ):
55
55
algorithm .get_population = lambda est : [est ]
@@ -59,11 +59,11 @@ def test_population(ml):
59
59
population = algorithm .get_population (algorithm .est )
60
60
best_model = algorithm .get_best_solution (algorithm .est )
61
61
print (algorithm .model (best_model , X_train ))
62
- print (algorithm .est .predict (X_train ))
62
+ print (algorithm .est .predict (X_train . values ))
63
63
64
64
# assert that population has at least 1 and no more than 100 individuals
65
65
assert 1 <= len (population ) <= 100 , "Population size is not within the expected range"
66
66
67
67
for p in population :
68
68
print (algorithm .model (p , X_train ))
69
- print (p .predict (X_train ))
69
+ print (p .predict (X_train . values ))
You can’t perform that action at this time.
0 commit comments