Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Added seed for random test #608

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 7, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion tests/test_learning.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,14 +152,16 @@ def test_decision_tree_learner():


def test_random_forest():
random.seed("aima-python")
iris = DataSet(name="iris")
rF = RandomForest(iris)
assert rF([5, 3, 1, 0.1]) == "setosa"
assert rF([6, 5, 3, 1.5]) == "versicolor"
assert rF([6, 5, 3, 1]) == "versicolor"
assert rF([7.5, 4, 6, 2]) == "virginica"


def test_neural_network_learner():
random.seed("aima-python")
iris = DataSet(name="iris")
classes = ["setosa", "versicolor", "virginica"]
iris.classes_to_numbers(classes)
Expand Down