1 Star 0 Fork 0

al0014 / DeepSurv

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

DeepSurv

DeepSurv implements a deep learning generalization of the Cox proportional hazards model using Theano and Lasagne.

DeepSurv has an advantage over traditional Cox regression because it does not require an a priori selection of covariates, but learns them adaptively.

DeepSurv can be used in numerous survival analysis applications. One medical application is provided: recommend_treatment, which provides treatment recommendations for a set of patient observations.

For more details, see full paper DeepSurv: Personalized Treatment Recommender System Using A Cox Proportional Hazards Deep Neural Network.

For an updated implementation of the Cox loss function in PyTorch, please see Feature Selection using Stochastic Gates (STG) by Yamada et al..

Installation:

From source

Download a local copy of DeepSurv and install from the directory:

git clone https://github.com/jaredleekatzman/DeepSurv.git
cd DeepSurv
pip install .

Dependencies

Theano, Lasagne (bleeding edge version), lifelines, matplotlib (for visualization), tensorboard_logger, and all of their respective dependencies.

Running the tests

After installing, you can optionally run the test suite with

py.test

from the command line while in the repo's main directory.

Running Experiments

Experiments are run using Docker containers built off of the floydhub deep learning Docker images. DeepSurv can be run on either the CPU or the GPU with nvidia-docker.

All experiments are in the DeepSurv/experiments/ directory.

To run an experiment, define the experiment name as an environmental variable EXPRIMENTand run the docker-compose file. Further details are in the DeepSurv/experiments/ directory.

Training a Network

Training DeepSurv can be done in a few lines. First, all you need to do is prepare the datasets to have the following keys:

{ 
	'x': (n,d) observations (dtype = float32), 
 	't': (n) event times (dtype = float32),
 	'e': (n) event indicators (dtype = int32)
}

Then prepare a dictionary of hyper-parameters. And it takes only two lines to train a network:

network = deepsurv.DeepSurv(**hyperparams)
log = network.train(train_data, valid_data, n_epochs=500)

You can then evaluate its success on testing data:

network.get_concordance_index(**test_data)
>> 0.62269622730138632

If you have matplotlib installed, you can visualize the training and validation curves after training the network:

deepsurv.plot_log(log)
MIT License Copyright (c) 2016, Jared Katzman Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

暂无描述 展开 收起
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/al0014/DeepSurv.git
git@gitee.com:al0014/DeepSurv.git
al0014
DeepSurv
DeepSurv
master

搜索帮助