-
Notifications
You must be signed in to change notification settings - Fork 875
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
109 additions
and
4 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
Binary file added
BIN
+16.9 KB
...re_selection/SequentialFeatureSelector_files/SequentialFeatureSelector_46_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+13.9 KB
...re_selection/SequentialFeatureSelector_files/SequentialFeatureSelector_77_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+162 KB
...es/user_guide/image/extract_face_landmarks_files/extract_face_landmarks_9_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+45.5 KB
.../user_guide/plotting/plot_decision_regions_files/plot_decision_regions_11_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-78 Bytes
(100%)
.../user_guide/plotting/plot_decision_regions_files/plot_decision_regions_13_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+67.7 KB
.../user_guide/plotting/plot_decision_regions_files/plot_decision_regions_19_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+37.5 KB
.../user_guide/plotting/plot_decision_regions_files/plot_decision_regions_21_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+83.3 KB
.../user_guide/plotting/plot_decision_regions_files/plot_decision_regions_23_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+8.21 KB
.../user_guide/plotting/plot_decision_regions_files/plot_decision_regions_25_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+17.9 KB
.../user_guide/plotting/plot_decision_regions_files/plot_decision_regions_27_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+40.3 KB
.../user_guide/plotting/plot_decision_regions_files/plot_decision_regions_29_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-56 Bytes
(100%)
.../user_guide/plotting/plot_decision_regions_files/plot_decision_regions_31_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+15.6 KB
.../user_guide/plotting/plot_decision_regions_files/plot_decision_regions_34_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+3 Bytes
(100%)
...s/user_guide/plotting/plot_decision_regions_files/plot_decision_regions_6_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+0 Bytes
(100%)
...s/user_guide/plotting/plot_decision_regions_files/plot_decision_regions_8_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+57.3 KB
.../sources/user_guide/plotting/scatterplotmatrix_files/scatterplotmatrix_10_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+28.3 KB
docs/sources/user_guide/plotting/scatterplotmatrix_files/scatterplotmatrix_8_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
|
@@ -4,4 +4,4 @@ | |
# | ||
# License: BSD 3 clause | ||
|
||
__version__ = '0.14.0dev' | ||
__version__ = '0.14.0' |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# Sebastian Raschka 2014-2018 | ||
# mlxtend Machine Learning Library Extensions | ||
# | ||
# Author: Sebastian Raschka <sebastianraschka.com> | ||
# | ||
# License: BSD 3 clause | ||
|
||
import numpy as np | ||
import scipy.stats | ||
|
||
|
||
def proportion_difference(proportion_1, proportion_2, n_1, n_2=None): | ||
""" | ||
Computes the test statistic and p-value for a difference of | ||
proportions test. | ||
Parameters | ||
----------- | ||
proportion_1 : float | ||
The first proportion | ||
proportion_2 : float | ||
The second proportion | ||
n_1 : int | ||
The sample size of the first test sample | ||
n_2 : int or None (default=None) | ||
The sample size of the second test sample. | ||
If `None`, `n_1`=`n_2`. | ||
Returns | ||
----------- | ||
z, p : float or None, float | ||
Returns the z-score and the p-value | ||
Examples | ||
----------- | ||
For usage examples, please see | ||
http://rasbt.github.io/mlxtend/user_guide/evaluate/proportion_difference/ | ||
""" | ||
if n_2 is None: | ||
n_2 = n_1 | ||
|
||
var_1 = proportion_1*(1. - proportion_1) / n_1 | ||
var_2 = proportion_2*(1. - proportion_2) / n_2 | ||
|
||
z = (proportion_1 - proportion_2) / np.sqrt(var_1 + var_2) | ||
p = scipy.stats.norm.cdf(z) | ||
|
||
return z, p |
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,53 @@ | ||
# Sebastian Raschka 2014-2018 | ||
# mlxtend Machine Learning Library Extensions | ||
# Author: Sebastian Raschka <sebastianraschka.com> | ||
# | ||
# License: BSD 3 clause | ||
|
||
from mlxtend.evaluate import proportion_difference | ||
import numpy as np | ||
|
||
|
||
def test_on_dataset(): | ||
y_true = np.array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | ||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | ||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | ||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | ||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | ||
0, 0, 0, 0, 0]) | ||
|
||
ym1 = np.array([1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, | ||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | ||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | ||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | ||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | ||
0, 0]) | ||
|
||
ym2 = np.array([1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | ||
1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | ||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | ||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | ||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | ||
0, 0]) | ||
|
||
ym3 = np.array([1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | ||
1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | ||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | ||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | ||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | ||
1, 1]) | ||
|
||
acc_1 = np.sum(y_true == ym1) / y_true.shape[0] | ||
acc_2 = np.sum(y_true == ym2) / y_true.shape[0] | ||
acc_3 = np.sum(y_true == ym3) / y_true.shape[0] | ||
assert round(acc_1, 2) == 0.84 | ||
assert round(acc_2, 2) == 0.92 | ||
assert round(acc_3, 2) == 0.92 | ||
|
||
z, p_value = proportion_difference(acc_1, acc_2, n_1=y_true.shape[0]) | ||
assert round(z, 3) == -1.754 | ||
assert round(p_value, 3) == 0.040 | ||
|
||
z, p_value = proportion_difference(acc_2, acc_3, n_1=y_true.shape[0]) | ||
assert round(z, 3) == 0.0 | ||
assert round(p_value, 3) == 0.5 |