guofei9987 / guofei9987/scikit-opt

np.argsort(np.argsort(-self.Y))

Open
#142 1 comment 0 reactions 0 assignees View on GitHub
question resolved
Dominant language
Python
Stars
6.7k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Description

https://github.com/guofei9987/scikit-opt/blob/b1f147af996f9839b7c107c17a8dd8c7098cdef0/sko/operators/ranking.py#L19, 请问这行代码是不是有点问题: “np.argsort(np.argsort(-self.Y))”? np.argsort()已经是对最后一维排序了,为什么需要再次np.argsort,感觉多余,是不是应该修改成 np.argsort(-self.Y)

还有一个小的建议,如 https://github.com/guofei9987/scikit-opt/blob/b1f147af996f9839b7c107c17a8dd8c7098cdef0/sko/operators/crossover.py#L7 既然“Chrom, size_pop, len_chrom = self.Chrom, self.size_pop, self.len_chrom”,后面的代码再使用"self.Chrom”, “self.size_pop”, “self.len_chrom“时建议统一改成"Chrom”, “size_pop”, “len_chrom“,而代码中有时使用带self的变量,有时使用不带self的变量,感觉有点怪怪的

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.