re-enable plotting tests (#209)
This commit is contained in:
committed by
GitHub
parent
c840b9b77b
commit
b504d3595f
@@ -23,7 +23,7 @@ fi
|
||||
|
||||
source activate test-environment
|
||||
|
||||
pip install nose nose-exclude;
|
||||
pip install nose;
|
||||
|
||||
if [ "${COVERAGE}" = "true" ]; then
|
||||
pip install coverage coveralls codecov;
|
||||
|
||||
+1
-3
@@ -4,9 +4,7 @@ set -e
|
||||
|
||||
|
||||
if [[ "$COVERAGE" == "true" ]]; then
|
||||
nosetests -s -v --with-coverage --exclude-dir=mlxtend/tf_classifier --exclude-dir=mlxtend/tf_regressor --exclude-dir=mlxtend/tf_cluster --exclude-dir=mlxtend/plotting
|
||||
else
|
||||
nosetests -s -v --exclude-dir=mlxtend/tf_classifier --exclude-dir=mlxtend/tf_regressor --exclude-dir=mlxtend/tf_cluster --exclude-dir=mlxtend/plotting
|
||||
nosetests -s -v --with-coverage
|
||||
fi
|
||||
|
||||
if [[ "$NOTEBOOKS" == "true" ]]; then
|
||||
|
||||
@@ -5,6 +5,27 @@
|
||||
The CHANGELOG for the current development version is available at
|
||||
[https://github.com/rasbt/mlxtend/blob/master/docs/sources/CHANGELOG.md](https://github.com/rasbt/mlxtend/blob/master/docs/sources/CHANGELOG.md).
|
||||
|
||||
### Version 0.7.1dev (TBD)
|
||||
|
||||
|
||||
|
||||
##### Downloads
|
||||
|
||||
- [Source code (zip)](https://github.com/rasbt/mlxtend/archive/v0.7.1.zip)
|
||||
- [Source code (tar.gz)](https://github.com/rasbt/mlxtend/archive/v0.7.1.tar.gz)
|
||||
|
||||
##### New Features
|
||||
|
||||
- /
|
||||
|
||||
##### Changes
|
||||
|
||||
- /
|
||||
|
||||
##### Bug Fixes
|
||||
|
||||
- /
|
||||
|
||||
|
||||
### Version 0.7.0 (2017-06-22)
|
||||
|
||||
|
||||
+1
-1
@@ -4,4 +4,4 @@
|
||||
#
|
||||
# License: BSD 3 clause
|
||||
|
||||
__version__ = '0.7.0'
|
||||
__version__ = '0.7.1dev'
|
||||
|
||||
@@ -5,8 +5,11 @@
|
||||
# License: BSD 3 clause
|
||||
|
||||
from mlxtend.plotting import checkerboard_plot
|
||||
import matplotlib.pyplot as plt
|
||||
import numpy as np
|
||||
|
||||
plt.switch_backend('agg')
|
||||
|
||||
|
||||
def test_runs():
|
||||
|
||||
|
||||
@@ -23,8 +23,8 @@ def test_training_size():
|
||||
training_errors, test_errors = (plot_learning_curves(X_train, y_train,
|
||||
X_test, y_test, clf, suppress_plot=True))
|
||||
|
||||
desired1 = [0.32, 0.33, 0.32, 0.33, 0.30, 0.31, 0.31, 0.22, 0.22, 0.22]
|
||||
desired2 = [0.35, 0.35, 0.35, 0.35, 0.43, 0.45, 0.35, 0.35, 0.45, 0.45]
|
||||
desired1 = [0.22, 0.22, 0.22, 0.31, 0.31, 0.3, 0.33, 0.32, 0.33, 0.32]
|
||||
desired2 = [0.45, 0.45, 0.35, 0.35, 0.45, 0.43, 0.35, 0.35, 0.35, 0.35]
|
||||
|
||||
np.testing.assert_almost_equal(training_errors, desired1, decimal=2)
|
||||
np.testing.assert_almost_equal(test_errors, desired2, decimal=2)
|
||||
@@ -34,22 +34,18 @@ def test_scikit_metrics():
|
||||
iris = datasets.load_iris()
|
||||
X = iris.data
|
||||
y = iris.target
|
||||
X_train, X_test, y_train, y_test = train_test_split(X,
|
||||
y,
|
||||
train_size=0.6,
|
||||
random_state=2)
|
||||
X_train, X_test, y_train, y_test = (train_test_split(X, y,
|
||||
train_size=0.6, random_state=2))
|
||||
|
||||
clf = DecisionTreeClassifier(max_depth=1, random_state=1)
|
||||
training_errors, test_errors = plot_learning_curves(X_train,
|
||||
y_train,
|
||||
X_test,
|
||||
y_test,
|
||||
clf,
|
||||
suppress_plot=True,
|
||||
scoring='accuracy')
|
||||
training_acc, test_acc = (plot_learning_curves(X_train, y_train,
|
||||
X_test, y_test, clf,
|
||||
scoring='accuracy',
|
||||
suppress_plot=True))
|
||||
|
||||
desired1 = [0.68, 0.67, 0.68, 0.67, 0.7, 0.69, 0.69, 0.78, 0.78, 0.78]
|
||||
desired2 = [0.65, 0.65, 0.65, 0.65, 0.57, 0.55, 0.65, 0.65, 0.55, 0.55]
|
||||
|
||||
np.testing.assert_almost_equal(training_errors, desired1, decimal=2)
|
||||
np.testing.assert_almost_equal(test_errors, desired2, decimal=2)
|
||||
desired1 = np.array([0.22, 0.22, 0.22, 0.31, 0.31,
|
||||
0.3, 0.33, 0.32, 0.33, 0.32])
|
||||
desired2 = np.array([0.45, 0.45, 0.35, 0.35, 0.45,
|
||||
0.43, 0.35, 0.35, 0.35, 0.35])
|
||||
np.testing.assert_almost_equal(training_acc, 1 - desired1, decimal=2)
|
||||
np.testing.assert_almost_equal(test_acc, 1 - desired2, decimal=2)
|
||||
|
||||
Reference in New Issue
Block a user