Skip to content

Commit 4613b78

Browse files
authored
Update ga.py
1 parent a2dfec9 commit 4613b78

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

FS/ga.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def jfs(xtrain, ytrain, opts):
8282
P1 = X[k1,:]
8383
P2 = X[k2,:]
8484
# Random one dimension from 1 to dim
85-
index = np.random.randint(low = 1, high = dim)
85+
index = np.random.randint(low = 1, high = dim-1)
8686
# Crossover
8787
x1[i,:] = np.concatenate((P1[0:index] , P2[index:]))
8888
x2[i,:] = np.concatenate((P2[0:index] , P1[index:]))
@@ -138,4 +138,4 @@ def jfs(xtrain, ytrain, opts):
138138

139139

140140

141-
141+

0 commit comments

Comments
 (0)