-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
readthedocs integration, matplotlib added for 10-fold cross validatio…
…n results, tests fixed, fitness names added
- Loading branch information
1 parent
7fe889a
commit 1300818
Showing
15 changed files
with
117 additions
and
50 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
requirements_file: docs/requirements.txt | ||
build: | ||
image: latest | ||
python: | ||
version: 3.8 |
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
Binary file not shown.
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,32 @@ | ||
from niaaml.utilities import OptimizationStats | ||
import numpy as np | ||
|
||
""" | ||
In this example, we show how the OptimizationStats class can be used. Normally, it is used in the background when the Pipeline's optimize method is called. | ||
You may also use it on its own if you find any use. | ||
""" | ||
|
||
# dummy array with expected results of classification process | ||
y = np.array(['Class 1', 'Class 1', 'Class 1', 'Class 2', 'Class 1', 'Class 2', | ||
'Class 2', 'Class 2', 'Class 2', 'Class 1', 'Class 1', 'Class 2', | ||
'Class 1', 'Class 2', 'Class 1', 'Class 1', 'Class 1', 'Class 1', | ||
'Class 2', 'Class 1']) | ||
|
||
# dummy array with predicted classes | ||
predicted = np.array(['Class 1', 'Class 1', 'Class 1', 'Class 2', 'Class 2', 'Class 2', | ||
'Class 1', 'Class 1', 'Class 1', 'Class 2', 'Class 1', 'Class 1', | ||
'Class 2', 'Class 2', 'Class 1', 'Class 2', 'Class 1', 'Class 2', | ||
'Class 2', 'Class 2']) | ||
|
||
# let's say these are fitness scores of the 10-fold cross validation | ||
fitness_scores = np.array([0.5, 0.55, 0.45, 0.57, 0.6, 0.47, 0.53, 0.52, 0.58, 0.44]) | ||
|
||
# instantiate OptimizationStats | ||
# let's say the used fitness function's name is Accuracy | ||
stats = OptimizationStats(predicted, y, fitness_scores, 'Accuracy') | ||
|
||
# export boxplot of the 10-fold cross validation scores | ||
stats.export_boxplot('boxplot.png') | ||
|
||
# print user-friendly text representation | ||
print(stats.to_string()) |
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
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
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
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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