-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Add parameter "progress file" #1038
Merged
weixuanfu
merged 13 commits into
EpistasisLab:development
from
Jaimecclin:add_progress_file
Apr 10, 2020
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
74a6162
Add an API to output progress message
Jaimecclin c671b52
Add unit test.
Jaimecclin 123ebab
Update api.md
Jaimecclin 715cea5
Update api.md
Jaimecclin d2cc038
Add docstring in my unit test.
Jaimecclin bb030fe
Merge branch 'add_progress_file' of https://github.com/Jaimecclin/tpo…
Jaimecclin 824f86b
Add docstring in my unit test.
Jaimecclin 241d67c
Rename progress_file to log_file.
Jaimecclin 3fb5889
Add progress parameter unit tests.
Jaimecclin edde89a
Make log_file test3 back.
Jaimecclin a3a936f
Rename unit test file.
Jaimecclin f3cb002
Rename a variable in base.py.
Jaimecclin 36c38ab
Merge branch 'development' into add_progress_file
weixuanfu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
"""This file is part of the TPOT library. | ||
|
||
TPOT was primarily developed at the University of Pennsylvania by: | ||
- Randal S. Olson (rso@randalolson.com) | ||
- Weixuan Fu (weixuanf@upenn.edu) | ||
- Daniel Angell (dpa34@drexel.edu) | ||
- and many more generous open source contributors | ||
|
||
TPOT is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU Lesser General Public License as | ||
published by the Free Software Foundation, either version 3 of | ||
the License, or (at your option) any later version. | ||
|
||
TPOT is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU Lesser General Public License for more details. | ||
|
||
You should have received a copy of the GNU Lesser General Public | ||
License along with TPOT. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
""" | ||
|
||
from tpot import TPOTClassifier | ||
from sklearn.datasets import load_iris | ||
from nose.tools import assert_equal | ||
import os | ||
|
||
data = load_iris() | ||
X = data['data'] | ||
y = data['target'] | ||
|
||
def test_log_file_verbosity_1(): | ||
""" Set verbosity as 1. Assert log_file parameter to generate log file. """ | ||
file_name = "progress_verbose_1.log" | ||
tracking_progress_file = open(file_name, "w") | ||
tpot_obj = TPOTClassifier( | ||
population_size=10, | ||
generations=10, | ||
verbosity=1, | ||
log_file=tracking_progress_file | ||
) | ||
tpot_obj.fit(X, y) | ||
assert_equal(os.path.getsize(file_name), 0) | ||
|
||
def test_log_file_verbosity_2(): | ||
""" Set verbosity as 2. Assert log_file parameter to generate log file. """ | ||
file_name = "progress_verbose_2.log" | ||
tracking_progress_file = open(file_name, "w") | ||
tpot_obj = TPOTClassifier( | ||
population_size=10, | ||
generations=10, | ||
verbosity=2, | ||
log_file=tracking_progress_file | ||
) | ||
tpot_obj.fit(X, y) | ||
assert_equal(os.path.getsize(file_name) > 0, True) | ||
|
||
def test_log_file_verbose_3(): | ||
""" Set verbosity as 3. Assert log_file parameter to generate log file. """ | ||
file_name = "progress_verbosity_3.log" | ||
tracking_progress_file = open(file_name, "w") | ||
tpot_obj = TPOTClassifier( | ||
population_size=10, | ||
generations=10, | ||
verbosity=3, | ||
log_file=tracking_progress_file | ||
) | ||
tpot_obj.fit(X, y) | ||
assert_equal(os.path.getsize(file_name) > 0, True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please rename the
progress_file
tolog_file
? I think there are some log infos whenverbosity=3
.