Skip to content

Commit

Permalink
Updated to correct missing data bug
Browse files Browse the repository at this point in the history
  • Loading branch information
brettbj committed Jul 26, 2016
1 parent 7a96f9d commit 5fa2861
Show file tree
Hide file tree
Showing 34 changed files with 427 additions and 5,843 deletions.
1,521 changes: 412 additions & 1,109 deletions Figures.ipynb

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions README.md
Expand Up @@ -7,9 +7,9 @@ Denoising Autoencoder for Phenotype Stratification (DAPS) is a semi-supervised
technique for exploring phenotypes in the Electronic Health Record (EHR).

Upon build, figures are regenerated and saved in:
https://github.com/greenelab/DAPS/blob/master/shippable/buildoutput/Figures.html
[Images](https://github.com/greenelab/DAPS/tree/master/images)

![](<./images/cluster2.png>)
![](<./images/cluster.png>)

Controls and 2 artificial subtypes of cases were simulated from 2 different
models. The labels are the number of hidden nodes in the trained DAs. Principal
Expand Down Expand Up @@ -138,13 +138,13 @@ We've included 3 ipython notebook files to help analyze the results.
Selected Results
----------------

![](<./images/fig2.png>)
![](<./images/figure_3_patients_100.png>)![](<./images/figure_3_patients_200.png>)![](<./images/figure_3_patients_500.png>)![](<./images/figure_3_patients_1000.png>)![](<./images/figure_3_patients_2000.png>)

Classification AUC in relation to the number of labeled patients under
simulation model 1 (RF – Random Forest, NN – Nearest Neighbors, DA – 2-node DA +
Random Forest, SVM – Support vector machine).

![](<./images/fig5.png>)
![](<./images/fig2.png>)

Case vs. Control clustering via principal components analysis and t-distributed
stochastic neighbor embedding throughout the training of the DA (raw input to
Expand Down
Binary file removed classes/__pycache__/__init__.cpython-34.pyc
Binary file not shown.
Binary file removed classes/__pycache__/da.cpython-34.pyc
Binary file not shown.
Binary file removed classes/__pycache__/full_rf.cpython-34.pyc
Binary file not shown.
Binary file removed classes/__pycache__/nearest_neighbors.cpython-34.pyc
Binary file not shown.
Binary file removed classes/__pycache__/rfc.cpython-34.pyc
Binary file not shown.
Binary file removed classes/__pycache__/sim.cpython-34.pyc
Binary file not shown.
Binary file removed classes/__pycache__/svm.cpython-34.pyc
Binary file not shown.
Binary file removed classes/__pycache__/tree.cpython-34.pyc
Binary file not shown.
14 changes: 10 additions & 4 deletions classify_patients.py
Expand Up @@ -13,6 +13,7 @@

from sklearn.cross_validation import StratifiedKFold
from sklearn.metrics import roc_auc_score
from sklearn.preprocessing import Imputer

import classes.rfc as rfc
import classes.svm as svm
Expand All @@ -28,7 +29,7 @@ def run(run_name='test', patient_counts=[100, 200, 500],
# loop through patient files
np.random.seed(seed=123)
random.seed(123)

overall_time = time.time()
i = 0
path = './data/' + run_name + '/'
Expand All @@ -43,13 +44,18 @@ def run(run_name='test', patient_counts=[100, 200, 500],
patients = pkl.load(open(patients_path + '/' + file, 'rb'))

np.random.shuffle(patients)
X = patients[:, :-1]
y = patients[:, -1]

if d > 0:
missing_vector = add_missing(patients, d)
missing_vector = np.asarray(add_missing(patients, d))
X = np.array(X)
X[np.where(missing_vector == 0)] = 'NaN'
imp = Imputer(strategy='mean', axis=0)
X = imp.fit_transform(X)
else:
missing_vector = None

X = patients[:, :-1]
y = patients[:, -1]
print(sum(y), len(y))

dAs = {}
Expand Down
Binary file removed images/cluster2.png
Binary file not shown.
Binary file removed images/fig3.png
Binary file not shown.
Binary file removed images/fig4.png
Binary file not shown.
Binary file removed images/fig5.png
Binary file not shown.
Binary file modified images/supp_figure_4_a_0.0.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/supp_figure_4_a_0.1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/supp_figure_4_a_0.2.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/supp_figure_4_a_0.3.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/supp_figure_4_a_0.4.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/supp_figure_4_a_0.9.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/supp_figure_4_b_0.0.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/supp_figure_4_b_0.1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/supp_figure_4_b_0.2.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/supp_figure_4_b_0.3.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/supp_figure_4_b_0.4.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/supp_figure_4_b_0.9.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion shippable.yml
Expand Up @@ -22,7 +22,7 @@ build:
- cd /root/src/github.com/greenelab/DAPS
- nose2 --plugin nose2.plugins.junitxml --junit-xml test
- mv nose2-junit.xml shippable/testresults/tests.xml
- curl https://zenodo.org/record/46607/files/data.zip -o data.zip
- curl https://zenodo.org/record/58627/files/data.zip -o data.zip
- unzip data.zip -d .
- jupyter nbconvert --to html --execute ./Figures.ipynb
- cp Figures.html shippable/buildoutput/
Expand Down
98 changes: 0 additions & 98 deletions visualize/.ipynb_checkpoints/Cluster-checkpoint.ipynb

This file was deleted.

1,659 changes: 0 additions & 1,659 deletions visualize/.ipynb_checkpoints/VisSweep-checkpoint.ipynb

This file was deleted.

0 comments on commit 5fa2861

Please sign in to comment.