-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #52 from AlonDaks/alon-dev
Packaged our code as a python module called stat159lambda
- Loading branch information
Showing
31 changed files
with
73 additions
and
52 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 |
---|---|---|
@@ -1,5 +1,7 @@ | ||
.DS_Store | ||
|
||
# Ignore Data files | ||
.nii | ||
|
||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
|
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,12 @@ | ||
import os | ||
import sys | ||
|
||
REPO_HOME_PATH = os.path.realpath(__file__).replace('/code/stat159lambda/config.py', '') | ||
|
||
USE_CACHED_DATA = os.environ.get('STAT159_CACHED_DATA', 'True') == 'True' | ||
|
||
NUM_PROCESSES = int(os.environ.get('STAT159_NUM_PROCESSES', 5)) | ||
|
||
NUM_VOXELS = 1108800 | ||
|
||
NUM_TOTAL_VOLUMES = 3543 |
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
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
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
2 changes: 1 addition & 1 deletion
2
code/utils/tests/test_parse_demographics.py → ...da/utils/tests/test_parse_demographics.py
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
2 changes: 1 addition & 1 deletion
2
code/utils/tests/test_plot.py → code/stat159lambda/utils/tests/test_plot.py
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,28 @@ | ||
from stat159lambda.utils import rf | ||
import numpy as np | ||
from sklearn.ensemble import RandomForestClassifier | ||
try: | ||
from mock import patch | ||
except: | ||
from unittest.mock import patch | ||
|
||
|
||
def test_prepare(): | ||
X = np.array([[10, 8, 8], [1, 11, 8], [4, 1, 1], [5, 0, 3], [7, 9, 1], | ||
[1, 5, 8], [6, 3, 0], [7, 10, 3], [5, 4, 3], [7, 0, 8]]) | ||
y = np.array([1, 0, 1, 1, 0, 2, 1, 1, 0, 0]) | ||
return X, y | ||
|
||
|
||
def test_cv_rf_accuracy(): | ||
X, y = test_prepare() | ||
assert rf.cv_rf_accuracy(X, y, 2, 2, 2, num_folds=5) > 0 | ||
|
||
|
||
# @patch.object(RandomForestClassifier, '__init__') | ||
# def test_rf_accuracy(mock_rf_init): | ||
# X, y = test_prepare() | ||
# rf.rf_accuracy(X, y, 2, 2, 2, num_folds=5) | ||
# assert_array_equal(mock_rf_init.call_args[0][0], | ||
# np.array([[10, 8, 8], [1, 11, 8], [4, 1, 1], [5, 0, 3], [7, 9, 1], | ||
# [1, 5, 8], [6, 3, 0], [7, 10, 3], [5, 4, 3], [7, 0, 8]])) |
2 changes: 1 addition & 1 deletion
2
code/utils/tests/test_scene_slicer.py → ...59lambda/utils/tests/test_scene_slicer.py
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
2 changes: 1 addition & 1 deletion
2
code/utils/tests/test_variance.py → ...tat159lambda/utils/tests/test_variance.py
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
File renamed without changes.
This file was deleted.
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