mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-05 09:21:13 +08:00
Enable ruff NPY002 rule (#11336)
This commit is contained in:
@ -187,7 +187,8 @@ def main():
|
||||
tree = DecisionTree(depth=10, min_leaf_size=10)
|
||||
tree.train(x, y)
|
||||
|
||||
test_cases = (np.random.rand(10) * 2) - 1
|
||||
rng = np.random.default_rng()
|
||||
test_cases = (rng.random(10) * 2) - 1
|
||||
predictions = np.array([tree.predict(x) for x in test_cases])
|
||||
avg_error = np.mean((predictions - test_cases) ** 2)
|
||||
|
||||
|
Reference in New Issue
Block a user