-
Notifications
You must be signed in to change notification settings - Fork 1
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
Switched inverse function to run pseudo-inverse, to account for correlated and 0 variance variables #5
Merged
Merged
Switched inverse function to run pseudo-inverse, to account for correlated and 0 variance variables #5
Changes from 6 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
e349040
Added code and spec to remove 0 variance values before running Kruskals
e448988
Updated the documentation
1bf189a
Reset kruskals.py to master and swapped out np.linalg.inv for np.lina…
df53139
Resubstitute 0.0 for nan when issue encountered
f7c9e54
Updated tox.ini and circle.yml to match CHAID and increase continuous…
df43cf2
Updated the readme
7dfc164
Added new line to end of file
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
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 |
---|---|---|
|
@@ -9,5 +9,3 @@ dependencies: | |
test: | ||
override: | ||
- detox | ||
- py.test --cov=./ | ||
- codecov --token=88ffd259-37b7-4c79-89a2-b4a00b83b519 |
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 |
---|---|---|
|
@@ -121,3 +121,26 @@ def test_that_direction_is_applied_on_directional_drivers_analysis(): | |
series = Kruskals.Kruskals(ndarr, arr).driver_score_to_series(True) | ||
|
||
assert (series.values < 0).any() | ||
|
||
def test_ability_to_handle_all_same_type(): | ||
""" | ||
Test to make sure that kruskals can handle data | ||
when all the values for and independent set are 0 | ||
""" | ||
ndarr = np.array([ | ||
[10, 0, 3, 4, 5, 6], | ||
[6, 0, 4, 3, 5, 1], | ||
[1, 0, 9, 1, 5, 1], | ||
[9, 0, 2, 2, 5, 2], | ||
[3, 0, 3, 9, 5, 3], | ||
[1, 0, 2, 9, 5, 4], | ||
[1, 0, 2, 9, 5, 4], | ||
[1, 0, 2, 9, 5, 4] | ||
]) | ||
|
||
arr = np.array([1, 2, 3, 4, 5, 6, 7, 8]) | ||
|
||
series = Kruskals.Kruskals(ndarr, arr).driver_score() | ||
|
||
assert series[1] == 0.0 | ||
assert series[4] == 0.0 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. New line at end of file There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
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 |
---|---|---|
@@ -1,7 +1,12 @@ | ||
[tox] | ||
skipsdist = True | ||
skipsdist = true | ||
envlist = py27,py34,py35,py36 | ||
[testenv] | ||
# necessary to make cov find the .coverage file | ||
# see http://blog.ionelmc.ro/2014/05/25/python-packaging/ | ||
usedevelop = true | ||
skip_install = true | ||
commands = | ||
py.test | ||
py.test --cov=./ | ||
codecov --token=88ffd259-37b7-4c79-89a2-b4a00b83b519 | ||
publish: python setup.py sdist upload --sign -r pypi |
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.
Also I think this should be a double newline
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.
Not given that the others aren't. We can correct in a different PR if you feel strongly