|
a |
|
b/docs/_build/html/usage.html |
|
|
1 |
|
|
|
2 |
|
|
|
3 |
<!DOCTYPE html> |
|
|
4 |
<html class="writer-html5" lang="en" > |
|
|
5 |
<head> |
|
|
6 |
<meta charset="utf-8" /> |
|
|
7 |
|
|
|
8 |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> |
|
|
9 |
|
|
|
10 |
<title>Tutorial: Simple DeepProg model — DeepProg documentation</title> |
|
|
11 |
|
|
|
12 |
|
|
|
13 |
|
|
|
14 |
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" /> |
|
|
15 |
<link rel="stylesheet" href="_static/pygments.css" type="text/css" /> |
|
|
16 |
|
|
|
17 |
|
|
|
18 |
|
|
|
19 |
|
|
|
20 |
|
|
|
21 |
|
|
|
22 |
|
|
|
23 |
|
|
|
24 |
|
|
|
25 |
|
|
|
26 |
<!--[if lt IE 9]> |
|
|
27 |
<script src="_static/js/html5shiv.min.js"></script> |
|
|
28 |
<![endif]--> |
|
|
29 |
|
|
|
30 |
|
|
|
31 |
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script> |
|
|
32 |
<script src="_static/jquery.js"></script> |
|
|
33 |
<script src="_static/underscore.js"></script> |
|
|
34 |
<script src="_static/doctools.js"></script> |
|
|
35 |
<script src="_static/language_data.js"></script> |
|
|
36 |
|
|
|
37 |
<script type="text/javascript" src="_static/js/theme.js"></script> |
|
|
38 |
|
|
|
39 |
|
|
|
40 |
<link rel="index" title="Index" href="genindex.html" /> |
|
|
41 |
<link rel="search" title="Search" href="search.html" /> |
|
|
42 |
<link rel="next" title="Tutorial: Ensemble of DeepProg model" href="usage_ensemble.html" /> |
|
|
43 |
<link rel="prev" title="Installation" href="installation.html" /> |
|
|
44 |
</head> |
|
|
45 |
|
|
|
46 |
<body class="wy-body-for-nav"> |
|
|
47 |
|
|
|
48 |
|
|
|
49 |
<div class="wy-grid-for-nav"> |
|
|
50 |
|
|
|
51 |
<nav data-toggle="wy-nav-shift" class="wy-nav-side"> |
|
|
52 |
<div class="wy-side-scroll"> |
|
|
53 |
<div class="wy-side-nav-search" > |
|
|
54 |
|
|
|
55 |
|
|
|
56 |
|
|
|
57 |
<a href="index.html" class="icon icon-home"> DeepProg |
|
|
58 |
|
|
|
59 |
|
|
|
60 |
|
|
|
61 |
</a> |
|
|
62 |
|
|
|
63 |
|
|
|
64 |
|
|
|
65 |
|
|
|
66 |
|
|
|
67 |
|
|
|
68 |
|
|
|
69 |
<div role="search"> |
|
|
70 |
<form id="rtd-search-form" class="wy-form" action="search.html" method="get"> |
|
|
71 |
<input type="text" name="q" placeholder="Search docs" /> |
|
|
72 |
<input type="hidden" name="check_keywords" value="yes" /> |
|
|
73 |
<input type="hidden" name="area" value="default" /> |
|
|
74 |
</form> |
|
|
75 |
</div> |
|
|
76 |
|
|
|
77 |
|
|
|
78 |
</div> |
|
|
79 |
|
|
|
80 |
|
|
|
81 |
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation"> |
|
|
82 |
|
|
|
83 |
|
|
|
84 |
|
|
|
85 |
|
|
|
86 |
|
|
|
87 |
|
|
|
88 |
<ul class="current"> |
|
|
89 |
<li class="toctree-l1"><a class="reference internal" href="installation.html">Installation</a></li> |
|
|
90 |
<li class="toctree-l1 current"><a class="current reference internal" href="#">Tutorial: Simple DeepProg model</a><ul> |
|
|
91 |
<li class="toctree-l2"><a class="reference internal" href="#input-parameters">Input parameters</a></li> |
|
|
92 |
<li class="toctree-l2"><a class="reference internal" href="#input-matrices">Input matrices</a></li> |
|
|
93 |
<li class="toctree-l2"><a class="reference internal" href="#creating-a-simple-deepprog-model-with-one-autoencoder-for-each-omic">Creating a simple DeepProg model with one autoencoder for each omic</a></li> |
|
|
94 |
</ul> |
|
|
95 |
</li> |
|
|
96 |
<li class="toctree-l1"><a class="reference internal" href="usage_ensemble.html">Tutorial: Ensemble of DeepProg model</a></li> |
|
|
97 |
<li class="toctree-l1"><a class="reference internal" href="usage_advanced.html">Tutorial: Advanced usage of DeepProg model</a></li> |
|
|
98 |
<li class="toctree-l1"><a class="reference internal" href="case_study.html">Case study: Analyzing TCGA HCC dataset</a></li> |
|
|
99 |
<li class="toctree-l1"><a class="reference internal" href="LICENSE.html">License</a></li> |
|
|
100 |
<li class="toctree-l1"><a class="reference internal" href="api/simdeep.html">simdeep package</a></li> |
|
|
101 |
</ul> |
|
|
102 |
|
|
|
103 |
|
|
|
104 |
|
|
|
105 |
</div> |
|
|
106 |
|
|
|
107 |
</div> |
|
|
108 |
</nav> |
|
|
109 |
|
|
|
110 |
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> |
|
|
111 |
|
|
|
112 |
|
|
|
113 |
<nav class="wy-nav-top" aria-label="top navigation"> |
|
|
114 |
|
|
|
115 |
<i data-toggle="wy-nav-top" class="fa fa-bars"></i> |
|
|
116 |
<a href="index.html">DeepProg</a> |
|
|
117 |
|
|
|
118 |
</nav> |
|
|
119 |
|
|
|
120 |
|
|
|
121 |
<div class="wy-nav-content"> |
|
|
122 |
|
|
|
123 |
<div class="rst-content"> |
|
|
124 |
|
|
|
125 |
|
|
|
126 |
|
|
|
127 |
|
|
|
128 |
|
|
|
129 |
|
|
|
130 |
|
|
|
131 |
|
|
|
132 |
|
|
|
133 |
|
|
|
134 |
|
|
|
135 |
|
|
|
136 |
|
|
|
137 |
|
|
|
138 |
|
|
|
139 |
|
|
|
140 |
|
|
|
141 |
|
|
|
142 |
|
|
|
143 |
<div role="navigation" aria-label="breadcrumbs navigation"> |
|
|
144 |
|
|
|
145 |
<ul class="wy-breadcrumbs"> |
|
|
146 |
|
|
|
147 |
<li><a href="index.html" class="icon icon-home"></a> »</li> |
|
|
148 |
|
|
|
149 |
<li>Tutorial: Simple DeepProg model</li> |
|
|
150 |
|
|
|
151 |
|
|
|
152 |
<li class="wy-breadcrumbs-aside"> |
|
|
153 |
|
|
|
154 |
|
|
|
155 |
<a href="_sources/usage.md.txt" rel="nofollow"> View page source</a> |
|
|
156 |
|
|
|
157 |
|
|
|
158 |
</li> |
|
|
159 |
|
|
|
160 |
</ul> |
|
|
161 |
|
|
|
162 |
|
|
|
163 |
<hr/> |
|
|
164 |
</div> |
|
|
165 |
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> |
|
|
166 |
<div itemprop="articleBody"> |
|
|
167 |
|
|
|
168 |
<div class="section" id="tutorial-simple-deepprog-model"> |
|
|
169 |
<h1>Tutorial: Simple DeepProg model<a class="headerlink" href="#tutorial-simple-deepprog-model" title="Permalink to this headline">¶</a></h1> |
|
|
170 |
<p>The principle of DeepProg can be summarized as follow:</p> |
|
|
171 |
<ul class="simple"> |
|
|
172 |
<li><p>Loading of multiple samples x OMIC matrices</p></li> |
|
|
173 |
<li><p>Preprocessing ,normalisation, and sub-sampling of the input matrices</p></li> |
|
|
174 |
<li><p>Matrix transformation using autoencoder</p></li> |
|
|
175 |
<li><p>Detection of survival features</p></li> |
|
|
176 |
<li><p>Survival feature agglomeration and clustering</p></li> |
|
|
177 |
<li><p>Creation of supervised models to predict the output of new samples</p></li> |
|
|
178 |
</ul> |
|
|
179 |
<div class="section" id="input-parameters"> |
|
|
180 |
<h2>Input parameters<a class="headerlink" href="#input-parameters" title="Permalink to this headline">¶</a></h2> |
|
|
181 |
<p>All the default parameters are defined in the config file: <code class="docutils literal notranslate"><span class="pre">./simdeep/config.py</span></code> but can be passed dynamically. Three types of parameters must be defined:</p> |
|
|
182 |
<ul class="simple"> |
|
|
183 |
<li><p>The training dataset (omics + survival input files)</p> |
|
|
184 |
<ul> |
|
|
185 |
<li><p>In addition, the parameters of the test set, i.e. the omic dataset and the survival file</p></li> |
|
|
186 |
</ul> |
|
|
187 |
</li> |
|
|
188 |
<li><p>The parameters of the autoencoder (the default parameters works but it might be fine-tuned.</p></li> |
|
|
189 |
<li><p>The parameters of the classification procedures (default are still good)</p></li> |
|
|
190 |
</ul> |
|
|
191 |
</div> |
|
|
192 |
<div class="section" id="input-matrices"> |
|
|
193 |
<h2>Input matrices<a class="headerlink" href="#input-matrices" title="Permalink to this headline">¶</a></h2> |
|
|
194 |
<p>As examples, we included two datasets:</p> |
|
|
195 |
<ul class="simple"> |
|
|
196 |
<li><p>A dummy example dataset in the <code class="docutils literal notranslate"><span class="pre">example/data/</span></code> folder:</p></li> |
|
|
197 |
</ul> |
|
|
198 |
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>examples |
|
|
199 |
├── data |
|
|
200 |
│ ├── meth_dummy.tsv |
|
|
201 |
│ ├── mir_dummy.tsv |
|
|
202 |
│ ├── rna_dummy.tsv |
|
|
203 |
│ ├── rna_test_dummy.tsv |
|
|
204 |
│ ├── survival_dummy.tsv |
|
|
205 |
│ └── survival_test_dummy.tsv |
|
|
206 |
</pre></div> |
|
|
207 |
</div> |
|
|
208 |
<ul class="simple"> |
|
|
209 |
<li><p>And a real dataset in the <code class="docutils literal notranslate"><span class="pre">data</span></code> folder. This dataset derives from the TCGA HCC cancer dataset. This dataset needs to be decompressed before processing:</p></li> |
|
|
210 |
</ul> |
|
|
211 |
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>data |
|
|
212 |
├── meth.tsv.gz |
|
|
213 |
├── mir.tsv.gz |
|
|
214 |
├── rna.tsv.gz |
|
|
215 |
└── survival.tsv |
|
|
216 |
</pre></div> |
|
|
217 |
</div> |
|
|
218 |
<p>An input matrix file should follow this format:</p> |
|
|
219 |
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>head mir_dummy.tsv |
|
|
220 |
|
|
|
221 |
Samples dummy_mir_0 dummy_mir_1 dummy_mir_2 dummy_mir_3 ... |
|
|
222 |
sample_test_0 <span class="m">0</span>.469656032287 <span class="m">0</span>.347987447237 <span class="m">0</span>.706633335508 <span class="m">0</span>.440068758445 ... |
|
|
223 |
sample_test_1 <span class="m">0</span>.0453108219657 <span class="m">0</span>.0234642968791 <span class="m">0</span>.593393816691 <span class="m">0</span>.981872970341 ... |
|
|
224 |
sample_test_2 <span class="m">0</span>.908784043793 <span class="m">0</span>.854397550009 <span class="m">0</span>.575879144667 <span class="m">0</span>.553333958713 ... |
|
|
225 |
... |
|
|
226 |
</pre></div> |
|
|
227 |
</div> |
|
|
228 |
<p>Also, if multiple matrices are used as input, they must keep the sample order. For example:</p> |
|
|
229 |
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>head rna_dummy.tsv |
|
|
230 |
|
|
|
231 |
Samples dummy_gene_0 dummy_gene_1 dummy_gene_2 dummy_gene_3 ... |
|
|
232 |
sample_test_0 <span class="m">0</span>.69656032287 <span class="m">0</span>.47987447237 <span class="m">0</span>.06633335508 <span class="m">0</span>.40068758445 ... |
|
|
233 |
sample_test_1 <span class="m">0</span>.53108219657 <span class="m">0</span>.234642968791 <span class="m">0</span>.93393816691 <span class="m">0</span>.81872970341 ... |
|
|
234 |
sample_test_2 <span class="m">0</span>.8784043793 <span class="m">0</span>.54397550009 <span class="m">0</span>.75879144667 <span class="m">0</span>.53333958713 ... |
|
|
235 |
... |
|
|
236 |
</pre></div> |
|
|
237 |
</div> |
|
|
238 |
<p>The arguments <code class="docutils literal notranslate"><span class="pre">training_tsv</span></code> and <code class="docutils literal notranslate"><span class="pre">path_data</span></code> from the <code class="docutils literal notranslate"><span class="pre">extract_data</span></code> module are used to defined the input matrices.</p> |
|
|
239 |
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="c1"># The keys/values of this dict represent the name of the omic and the corresponding input matrix</span> |
|
|
240 |
<span class="n">training_tsv</span> <span class="o">=</span> <span class="p">{</span> |
|
|
241 |
<span class="s1">'GE'</span><span class="p">:</span> <span class="s1">'rna_dummy.tsv'</span><span class="p">,</span> |
|
|
242 |
<span class="s1">'MIR'</span><span class="p">:</span> <span class="s1">'mir_dummy.tsv'</span><span class="p">,</span> |
|
|
243 |
<span class="s1">'METH'</span><span class="p">:</span> <span class="s1">'meth_dummy.tsv'</span><span class="p">,</span> |
|
|
244 |
<span class="p">}</span> |
|
|
245 |
</pre></div> |
|
|
246 |
</div> |
|
|
247 |
<p>a survival file must have this format:</p> |
|
|
248 |
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>head survival_dummy.tsv |
|
|
249 |
|
|
|
250 |
barcode days recurrence |
|
|
251 |
sample_test_0 <span class="m">134</span> <span class="m">1</span> |
|
|
252 |
sample_test_1 <span class="m">291</span> <span class="m">0</span> |
|
|
253 |
sample_test_2 <span class="m">125</span> <span class="m">1</span> |
|
|
254 |
sample_test_3 <span class="m">43</span> <span class="m">0</span> |
|
|
255 |
... |
|
|
256 |
</pre></div> |
|
|
257 |
</div> |
|
|
258 |
<p>In addition, the fields corresponding to the patient IDs, the survival time, and the event should be defined using the <code class="docutils literal notranslate"><span class="pre">survival_flag</span></code> argument:</p> |
|
|
259 |
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="c1">#Default value</span> |
|
|
260 |
<span class="n">survival_flag</span> <span class="o">=</span> <span class="p">{</span><span class="s1">'patient_id'</span><span class="p">:</span> <span class="s1">'barcode'</span><span class="p">,</span> |
|
|
261 |
<span class="s1">'survival'</span><span class="p">:</span> <span class="s1">'days'</span><span class="p">,</span> |
|
|
262 |
<span class="s1">'event'</span><span class="p">:</span> <span class="s1">'recurrence'</span><span class="p">}</span> |
|
|
263 |
</pre></div> |
|
|
264 |
</div> |
|
|
265 |
</div> |
|
|
266 |
<div class="section" id="creating-a-simple-deepprog-model-with-one-autoencoder-for-each-omic"> |
|
|
267 |
<h2>Creating a simple DeepProg model with one autoencoder for each omic<a class="headerlink" href="#creating-a-simple-deepprog-model-with-one-autoencoder-for-each-omic" title="Permalink to this headline">¶</a></h2> |
|
|
268 |
<p>First, we will build a model using the example dataset from <code class="docutils literal notranslate"><span class="pre">./examples/data/</span></code> (These example files are set as default in the config.py file). We will use them to show how to construct a single DeepProg model inferring a autoencoder for each omic</p> |
|
|
269 |
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span> |
|
|
270 |
<span class="c1"># SimDeep class can be used to build one model with one autoencoder for each omic</span> |
|
|
271 |
<span class="kn">from</span> <span class="nn">simdeep.simdeep_analysis</span> <span class="kn">import</span> <span class="n">SimDeep</span> |
|
|
272 |
<span class="kn">from</span> <span class="nn">simdeep.extract_data</span> <span class="kn">import</span> <span class="n">LoadData</span> |
|
|
273 |
|
|
|
274 |
<span class="n">help</span><span class="p">(</span><span class="n">SimDeep</span><span class="p">)</span> <span class="c1"># to see all the functions</span> |
|
|
275 |
<span class="n">help</span><span class="p">(</span><span class="n">LoadData</span><span class="p">)</span> <span class="c1"># to see all the functions related to loading datasets</span> |
|
|
276 |
|
|
|
277 |
<span class="c1"># Defining training datasets</span> |
|
|
278 |
<span class="kn">from</span> <span class="nn">simdeep.config</span> <span class="kn">import</span> <span class="n">TRAINING_TSV</span> |
|
|
279 |
<span class="kn">from</span> <span class="nn">simdeep.config</span> <span class="kn">import</span> <span class="n">SURVIVAL_TSV</span> |
|
|
280 |
<span class="c1"># Location of the input matrices and survival file</span> |
|
|
281 |
<span class="kn">from</span> <span class="nn">simdeep.config</span> <span class="kn">import</span> <span class="n">PATH_DATA</span> |
|
|
282 |
|
|
|
283 |
<span class="n">dataset</span> <span class="o">=</span> <span class="n">LoadData</span><span class="p">(</span><span class="n">training_tsv</span><span class="o">=</span><span class="n">TRAINING_TSV</span><span class="p">,</span> |
|
|
284 |
<span class="n">survival_tsv</span><span class="o">=</span><span class="n">SURVIVAL_TSV</span><span class="p">,</span> |
|
|
285 |
<span class="n">path_data</span><span class="o">=</span><span class="n">PATH_DATA</span><span class="p">)</span> |
|
|
286 |
|
|
|
287 |
<span class="c1"># Defining the result path in which will be created an output folder</span> |
|
|
288 |
<span class="n">PATH_RESULTS</span> <span class="o">=</span> <span class="s2">"./TEST_DUMMY/"</span> |
|
|
289 |
|
|
|
290 |
<span class="c1"># instantiate the model with the dummy example training dataset defined in the config file</span> |
|
|
291 |
<span class="n">simDeep</span> <span class="o">=</span> <span class="n">SimDeep</span><span class="p">(</span> |
|
|
292 |
<span class="n">dataset</span><span class="o">=</span><span class="n">dataset</span><span class="p">,</span> |
|
|
293 |
<span class="n">path_results</span><span class="o">=</span><span class="n">PATH_RESULTS</span><span class="p">,</span> |
|
|
294 |
<span class="n">path_to_save_modelPATH_RESULTS</span><span class="p">,</span> <span class="c1"># This result path can be used to save the autoencoder</span> |
|
|
295 |
<span class="p">)</span> |
|
|
296 |
|
|
|
297 |
<span class="n">simDeep</span><span class="o">.</span><span class="n">load_training_dataset</span><span class="p">()</span> <span class="c1"># load the training dataset</span> |
|
|
298 |
<span class="n">simDeep</span><span class="o">.</span><span class="n">fit</span><span class="p">()</span> <span class="c1"># fit the model</span> |
|
|
299 |
</pre></div> |
|
|
300 |
</div> |
|
|
301 |
<p>At that point, the model is fitted and some output files are available in the output folder:</p> |
|
|
302 |
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>TEST_DUMMY |
|
|
303 |
├── test_dummy_dataset_KM_plot_training_dataset.png |
|
|
304 |
└── test_dummy_dataset_training_set_labels.tsv |
|
|
305 |
</pre></div> |
|
|
306 |
</div> |
|
|
307 |
<p>The tsv file contains the label and the label probability for each sample:</p> |
|
|
308 |
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>sample_test_0 <span class="m">1</span> <span class="m">7</span>.22678272919e-12 |
|
|
309 |
sample_test_1 <span class="m">1</span> <span class="m">4</span>.48594196888e-09 |
|
|
310 |
sample_test_4 <span class="m">1</span> <span class="m">1</span>.53363205571e-06 |
|
|
311 |
sample_test_5 <span class="m">1</span> <span class="m">6</span>.72170409655e-08 |
|
|
312 |
sample_test_6 <span class="m">0</span> <span class="m">0</span>.9996581662 |
|
|
313 |
sample_test_7 <span class="m">1</span> <span class="m">3</span>.38139255666e-08 |
|
|
314 |
</pre></div> |
|
|
315 |
</div> |
|
|
316 |
<p>And we also have the visualisation of a Kaplan-Meier Curve:</p> |
|
|
317 |
<p><img alt="KM plot" src="_images/test_dummy_dataset_KM_plot_training_dataset.png" /></p> |
|
|
318 |
<p>Now we are ready to use a test dataset and to infer the class label for the test samples. |
|
|
319 |
The test dataset do not need to have the same input omic matrices than the training dataset and not even the sample features for a given omic. However, it needs to have at least some features in common.</p> |
|
|
320 |
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="c1"># Defining test datasets</span> |
|
|
321 |
<span class="kn">from</span> <span class="nn">simdeep.config</span> <span class="kn">import</span> <span class="n">TEST_TSV</span> |
|
|
322 |
<span class="kn">from</span> <span class="nn">simdeep.config</span> <span class="kn">import</span> <span class="n">SURVIVAL_TSV_TEST</span> |
|
|
323 |
|
|
|
324 |
<span class="n">simDeep</span><span class="o">.</span><span class="n">load_new_test_dataset</span><span class="p">(</span> |
|
|
325 |
<span class="n">TEST_TSV</span><span class="p">,</span> |
|
|
326 |
<span class="n">fname_key</span><span class="o">=</span><span class="s1">'dummy'</span> |
|
|
327 |
<span class="n">SURVIVAL_TSV_TEST</span><span class="p">,</span> <span class="c1"># [OPTIONAL] test survival file useful to compute accuracy of test dataset</span> |
|
|
328 |
|
|
|
329 |
<span class="p">)</span> |
|
|
330 |
|
|
|
331 |
<span class="c1"># The test set is a dummy rna expression (generated randomly)</span> |
|
|
332 |
<span class="nb">print</span><span class="p">(</span><span class="n">simDeep</span><span class="o">.</span><span class="n">dataset</span><span class="o">.</span><span class="n">test_tsv</span><span class="p">)</span> <span class="c1"># Defined in the config file</span> |
|
|
333 |
<span class="c1"># The data type of the test set is also defined to match an existing type</span> |
|
|
334 |
<span class="nb">print</span><span class="p">(</span><span class="n">simDeep</span><span class="o">.</span><span class="n">dataset</span><span class="o">.</span><span class="n">data_type</span><span class="p">)</span> <span class="c1"># Defined in the config file</span> |
|
|
335 |
<span class="n">simDeep</span><span class="o">.</span><span class="n">predict_labels_on_test_dataset</span><span class="p">()</span> <span class="c1"># Perform the classification analysis and label the set dataset</span> |
|
|
336 |
|
|
|
337 |
<span class="nb">print</span><span class="p">(</span><span class="n">simDeep</span><span class="o">.</span><span class="n">test_labels</span><span class="p">)</span> |
|
|
338 |
<span class="nb">print</span><span class="p">(</span><span class="n">simDeep</span><span class="o">.</span><span class="n">test_labels_proba</span><span class="p">)</span> |
|
|
339 |
</pre></div> |
|
|
340 |
</div> |
|
|
341 |
<p>The assigned class and class probabilities for the test samples are now available in the output folder:</p> |
|
|
342 |
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>TEST_DUMMY |
|
|
343 |
├── test_dummy_dataset_dummy_KM_plot_test.png |
|
|
344 |
├── test_dummy_dataset_dummy_test_labels.tsv |
|
|
345 |
├── test_dummy_dataset_KM_plot_training_dataset.png |
|
|
346 |
└── test_dummy_dataset_training_set_labels.tsv |
|
|
347 |
|
|
|
348 |
head test_dummy_dataset_training_set_labels.tsv |
|
|
349 |
</pre></div> |
|
|
350 |
</div> |
|
|
351 |
<p>And a KM plot is also constructed using the test labels</p> |
|
|
352 |
<p><img alt="KM plot test" src="_images/test_dummy_dataset_dummy_KM_plot_test.png" /></p> |
|
|
353 |
<p>Finally, it is possible to save the keras model:</p> |
|
|
354 |
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="n">simDeep</span><span class="o">.</span><span class="n">save_encoders</span><span class="p">(</span><span class="s1">'dummy_encoder.h5'</span><span class="p">)</span> |
|
|
355 |
</pre></div> |
|
|
356 |
</div> |
|
|
357 |
</div> |
|
|
358 |
</div> |
|
|
359 |
|
|
|
360 |
|
|
|
361 |
</div> |
|
|
362 |
|
|
|
363 |
</div> |
|
|
364 |
<footer> |
|
|
365 |
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> |
|
|
366 |
<a href="usage_ensemble.html" class="btn btn-neutral float-right" title="Tutorial: Ensemble of DeepProg model" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a> |
|
|
367 |
<a href="installation.html" class="btn btn-neutral float-left" title="Installation" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a> |
|
|
368 |
</div> |
|
|
369 |
|
|
|
370 |
<hr/> |
|
|
371 |
|
|
|
372 |
<div role="contentinfo"> |
|
|
373 |
<p> |
|
|
374 |
© Copyright 2019, Olivier Poirion. |
|
|
375 |
|
|
|
376 |
</p> |
|
|
377 |
</div> |
|
|
378 |
|
|
|
379 |
|
|
|
380 |
|
|
|
381 |
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a |
|
|
382 |
|
|
|
383 |
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a> |
|
|
384 |
|
|
|
385 |
provided by <a href="https://readthedocs.org">Read the Docs</a>. |
|
|
386 |
|
|
|
387 |
</footer> |
|
|
388 |
</div> |
|
|
389 |
</div> |
|
|
390 |
|
|
|
391 |
</section> |
|
|
392 |
|
|
|
393 |
</div> |
|
|
394 |
|
|
|
395 |
|
|
|
396 |
<script type="text/javascript"> |
|
|
397 |
jQuery(function () { |
|
|
398 |
SphinxRtdTheme.Navigation.enable(true); |
|
|
399 |
}); |
|
|
400 |
</script> |
|
|
401 |
|
|
|
402 |
|
|
|
403 |
|
|
|
404 |
|
|
|
405 |
|
|
|
406 |
|
|
|
407 |
</body> |
|
|
408 |
</html> |