[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-YerevaNN--mimic3-benchmarks":3,"tool-YerevaNN--mimic3-benchmarks":64},[4,17,27,35,43,56],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":16},3808,"stable-diffusion-webui","AUTOMATIC1111\u002Fstable-diffusion-webui","stable-diffusion-webui 是一个基于 Gradio 构建的网页版操作界面，旨在让用户能够轻松地在本地运行和使用强大的 Stable Diffusion 图像生成模型。它解决了原始模型依赖命令行、操作门槛高且功能分散的痛点，将复杂的 AI 绘图流程整合进一个直观易用的图形化平台。\n\n无论是希望快速上手的普通创作者、需要精细控制画面细节的设计师，还是想要深入探索模型潜力的开发者与研究人员，都能从中获益。其核心亮点在于极高的功能丰富度：不仅支持文生图、图生图、局部重绘（Inpainting）和外绘（Outpainting）等基础模式，还独创了注意力机制调整、提示词矩阵、负向提示词以及“高清修复”等高级功能。此外，它内置了 GFPGAN 和 CodeFormer 等人脸修复工具，支持多种神经网络放大算法，并允许用户通过插件系统无限扩展能力。即使是显存有限的设备，stable-diffusion-webui 也提供了相应的优化选项，让高质量的 AI 艺术创作变得触手可及。",162132,3,"2026-04-05T11:01:52",[13,14,15],"开发框架","图像","Agent","ready",{"id":18,"name":19,"github_repo":20,"description_zh":21,"stars":22,"difficulty_score":23,"last_commit_at":24,"category_tags":25,"status":16},1381,"everything-claude-code","affaan-m\u002Feverything-claude-code","everything-claude-code 是一套专为 AI 编程助手（如 Claude Code、Codex、Cursor 等）打造的高性能优化系统。它不仅仅是一组配置文件，而是一个经过长期实战打磨的完整框架，旨在解决 AI 代理在实际开发中面临的效率低下、记忆丢失、安全隐患及缺乏持续学习能力等核心痛点。\n\n通过引入技能模块化、直觉增强、记忆持久化机制以及内置的安全扫描功能，everything-claude-code 能显著提升 AI 在复杂任务中的表现，帮助开发者构建更稳定、更智能的生产级 AI 代理。其独特的“研究优先”开发理念和针对 Token 消耗的优化策略，使得模型响应更快、成本更低，同时有效防御潜在的攻击向量。\n\n这套工具特别适合软件开发者、AI 研究人员以及希望深度定制 AI 工作流的技术团队使用。无论您是在构建大型代码库，还是需要 AI 协助进行安全审计与自动化测试，everything-claude-code 都能提供强大的底层支持。作为一个曾荣获 Anthropic 黑客大奖的开源项目，它融合了多语言支持与丰富的实战钩子（hooks），让 AI 真正成长为懂上",138956,2,"2026-04-05T11:33:21",[13,15,26],"语言模型",{"id":28,"name":29,"github_repo":30,"description_zh":31,"stars":32,"difficulty_score":23,"last_commit_at":33,"category_tags":34,"status":16},2271,"ComfyUI","Comfy-Org\u002FComfyUI","ComfyUI 是一款功能强大且高度模块化的视觉 AI 引擎，专为设计和执行复杂的 Stable Diffusion 图像生成流程而打造。它摒弃了传统的代码编写模式，采用直观的节点式流程图界面，让用户通过连接不同的功能模块即可构建个性化的生成管线。\n\n这一设计巧妙解决了高级 AI 绘图工作流配置复杂、灵活性不足的痛点。用户无需具备编程背景，也能自由组合模型、调整参数并实时预览效果，轻松实现从基础文生图到多步骤高清修复等各类复杂任务。ComfyUI 拥有极佳的兼容性，不仅支持 Windows、macOS 和 Linux 全平台，还广泛适配 NVIDIA、AMD、Intel 及苹果 Silicon 等多种硬件架构，并率先支持 SDXL、Flux、SD3 等前沿模型。\n\n无论是希望深入探索算法潜力的研究人员和开发者，还是追求极致创作自由度的设计师与资深 AI 绘画爱好者，ComfyUI 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",107662,"2026-04-03T11:11:01",[13,14,15],{"id":36,"name":37,"github_repo":38,"description_zh":39,"stars":40,"difficulty_score":23,"last_commit_at":41,"category_tags":42,"status":16},3704,"NextChat","ChatGPTNextWeb\u002FNextChat","NextChat 是一款轻量且极速的 AI 助手，旨在为用户提供流畅、跨平台的大模型交互体验。它完美解决了用户在多设备间切换时难以保持对话连续性，以及面对众多 AI 模型不知如何统一管理的痛点。无论是日常办公、学习辅助还是创意激发，NextChat 都能让用户随时随地通过网页、iOS、Android、Windows、MacOS 或 Linux 端无缝接入智能服务。\n\n这款工具非常适合普通用户、学生、职场人士以及需要私有化部署的企业团队使用。对于开发者而言，它也提供了便捷的自托管方案，支持一键部署到 Vercel 或 Zeabur 等平台。\n\nNextChat 的核心亮点在于其广泛的模型兼容性，原生支持 Claude、DeepSeek、GPT-4 及 Gemini Pro 等主流大模型，让用户在一个界面即可自由切换不同 AI 能力。此外，它还率先支持 MCP（Model Context Protocol）协议，增强了上下文处理能力。针对企业用户，NextChat 提供专业版解决方案，具备品牌定制、细粒度权限控制、内部知识库整合及安全审计等功能，满足公司对数据隐私和个性化管理的高标准要求。",87618,"2026-04-05T07:20:52",[13,26],{"id":44,"name":45,"github_repo":46,"description_zh":47,"stars":48,"difficulty_score":23,"last_commit_at":49,"category_tags":50,"status":16},2268,"ML-For-Beginners","microsoft\u002FML-For-Beginners","ML-For-Beginners 是由微软推出的一套系统化机器学习入门课程，旨在帮助零基础用户轻松掌握经典机器学习知识。这套课程将学习路径规划为 12 周，包含 26 节精炼课程和 52 道配套测验，内容涵盖从基础概念到实际应用的完整流程，有效解决了初学者面对庞大知识体系时无从下手、缺乏结构化指导的痛点。\n\n无论是希望转型的开发者、需要补充算法背景的研究人员，还是对人工智能充满好奇的普通爱好者，都能从中受益。课程不仅提供了清晰的理论讲解，还强调动手实践，让用户在循序渐进中建立扎实的技能基础。其独特的亮点在于强大的多语言支持，通过自动化机制提供了包括简体中文在内的 50 多种语言版本，极大地降低了全球不同背景用户的学习门槛。此外，项目采用开源协作模式，社区活跃且内容持续更新，确保学习者能获取前沿且准确的技术资讯。如果你正寻找一条清晰、友好且专业的机器学习入门之路，ML-For-Beginners 将是理想的起点。",84991,"2026-04-05T10:45:23",[14,51,52,53,15,54,26,13,55],"数据工具","视频","插件","其他","音频",{"id":57,"name":58,"github_repo":59,"description_zh":60,"stars":61,"difficulty_score":10,"last_commit_at":62,"category_tags":63,"status":16},3128,"ragflow","infiniflow\u002Fragflow","RAGFlow 是一款领先的开源检索增强生成（RAG）引擎，旨在为大语言模型构建更精准、可靠的上下文层。它巧妙地将前沿的 RAG 技术与智能体（Agent）能力相结合，不仅支持从各类文档中高效提取知识，还能让模型基于这些知识进行逻辑推理和任务执行。\n\n在大模型应用中，幻觉问题和知识滞后是常见痛点。RAGFlow 通过深度解析复杂文档结构（如表格、图表及混合排版），显著提升了信息检索的准确度，从而有效减少模型“胡编乱造”的现象，确保回答既有据可依又具备时效性。其内置的智能体机制更进一步，使系统不仅能回答问题，还能自主规划步骤解决复杂问题。\n\n这款工具特别适合开发者、企业技术团队以及 AI 研究人员使用。无论是希望快速搭建私有知识库问答系统，还是致力于探索大模型在垂直领域落地的创新者，都能从中受益。RAGFlow 提供了可视化的工作流编排界面和灵活的 API 接口，既降低了非算法背景用户的上手门槛，也满足了专业开发者对系统深度定制的需求。作为基于 Apache 2.0 协议开源的项目，它正成为连接通用大模型与行业专有知识之间的重要桥梁。",77062,"2026-04-04T04:44:48",[15,14,13,26,54],{"id":65,"github_repo":66,"name":67,"description_en":68,"description_zh":69,"ai_summary_zh":69,"readme_en":70,"readme_zh":71,"quickstart_zh":72,"use_case_zh":73,"hero_image_url":74,"owner_login":75,"owner_name":75,"owner_avatar_url":76,"owner_bio":77,"owner_company":78,"owner_location":78,"owner_email":79,"owner_twitter":78,"owner_website":80,"owner_url":81,"languages":82,"stars":87,"forks":88,"last_commit_at":89,"license":90,"difficulty_score":91,"env_os":92,"env_gpu":93,"env_ram":92,"env_deps":94,"category_tags":102,"github_topics":103,"view_count":23,"oss_zip_url":78,"oss_zip_packed_at":78,"status":16,"created_at":108,"updated_at":109,"faqs":110,"releases":140},3278,"YerevaNN\u002Fmimic3-benchmarks","mimic3-benchmarks","Python suite to construct benchmark machine learning datasets from the MIMIC-III 💊 clinical database. ","mimic3-benchmarks 是一套基于 Python 开发的工具集，旨在利用著名的 MIMIC-III 重症监护临床数据库，快速构建标准化的机器学习基准数据集。它主要解决了医疗 AI 领域长期缺乏统一评估标准的问题：由于临床数据通常噪声大、标注难且分散，研究人员难以像计算机视觉领域那样公平地对比不同算法的性能。通过提供预定义的数据处理流程，mimic3-benchmarks 让复现研究和横向比较变得简单可行。\n\n该工具特别适合从事医疗人工智能的研究人员、数据科学家以及算法开发者使用。它涵盖了四个核心的住院临床预测任务，分别对应不同的机器学习问题：基于早期入院数据的死亡率预测（分类）、实时失代偿检测（时间序列分类）、住院时长预测（回归）以及表型分类（多标签序列分类）。其独特的技术亮点在于将复杂的原始医疗记录转化为结构清晰、可直接用于模型训练的标准格式，极大地降低了进入医疗大数据研究的门槛，帮助社区更专注于算法创新而非繁琐的数据清洗工作。","MIMIC-III Benchmarks\n=========================\n\n[![Join the chat at https:\u002F\u002Fgitter.im\u002FYerevaNN\u002Fmimic3-benchmarks](https:\u002F\u002Fbadges.gitter.im\u002FYerevaNN\u002Fmimic3-benchmarks.svg)](https:\u002F\u002Fgitter.im\u002FYerevaNN\u002Fmimic3-benchmarks?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)\n\nPython suite to construct benchmark machine learning datasets from the MIMIC-III clinical database. Currently, the benchmark datasets cover four key inpatient clinical prediction tasks that map onto core machine learning problems: prediction of mortality from early admission data (classification), real-time detection of decompensation (time series classification), forecasting length of stay (regression), and phenotype classification (multilabel sequence classification).\n\n\n## News\n\n* 2018 December 28: The second draft of the paper is released on [arXiv](https:\u002F\u002Farxiv.org\u002Fabs\u002F1703.07771).\n* 2017 December 8: This work was presented as a spotlight presentation at NIPS 2017 [Machine Learning for Health Workshop](https:\u002F\u002Fml4health.github.io\u002F2017\u002F).\n* 2017 March 23: We are pleased to announce the first official release of these benchmarks. We expect to release a revision within the coming months that will add at least ~50 additional input variables. We are likewise pleased to announce that the manuscript associated with these benchmarks is now [available on arXiv](https:\u002F\u002Farxiv.org\u002Fabs\u002F1703.07771).\n\n## Citation\n\nIf you use this code or these benchmarks in your research, please cite the following publication.\n```\n@article{Harutyunyan2019,\n  author={Harutyunyan, Hrayr and Khachatrian, Hrant and Kale, David C. and Ver Steeg, Greg and Galstyan, Aram},\n  title={Multitask learning and benchmarking with clinical time series data},\n  journal={Scientific Data},\n  year={2019},\n  volume={6},\n  number={1},\n  pages={96},\n  issn={2052-4463},\n  doi={10.1038\u002Fs41597-019-0103-9},\n  url={https:\u002F\u002Fdoi.org\u002F10.1038\u002Fs41597-019-0103-9}\n}\n```\n**Please be sure also to cite the original [MIMIC-III paper](http:\u002F\u002Fwww.nature.com\u002Farticles\u002Fsdata201635).**\n\n## Motivation\n\nDespite rapid growth in research that applies machine learning to clinical data, progress in the field appears far less dramatic than in other applications of machine learning. In image recognition, for example, the winning error rates in the [ImageNet Large Scale Visual Recognition Challenge](http:\u002F\u002Fimage-net.org\u002Fchallenges\u002FLSVRC\u002F) (ILSVRC) plummeted almost 90% from 2010 (0.2819) to 2016 (0.02991).\nThere are many reasonable explanations for this discrepancy: clinical data sets are [inherently noisy and uncertain](http:\u002F\u002Fwww-scf.usc.edu\u002F~dkale\u002Fpapers\u002Fmarlin-ihi2012-ehr_clustering.pdf) and often small relative to their complexity, and for many problems of interest, [ground truth labels for training and evaluation are unavailable](https:\u002F\u002Facademic.oup.com\u002Fjamia\u002Farticle-abstract\u002F23\u002F6\u002F1166\u002F2399304\u002FLearning-statistical-models-of-phenotypes-using?redirectedFrom=PDF).\n\nHowever, there is another, simpler explanation: practical progress has been difficult to measure due to the absence of community benchmarks like ImageNet. Such benchmarks play an important role in accelerating progress in machine learning research. For one, they focus the community on specific problems and stoke ongoing debate about what those problems should be. They also reduce the startup overhead for researchers moving into a new area. Finally and perhaps most important, benchmarks facilitate reproducibility and direct comparison of competing ideas.\n\nHere we present four public benchmarks for machine learning researchers interested in health care, built using data from the publicly available Medical Information Mart for Intensive Care (MIMIC-III) database ([paper](http:\u002F\u002Fwww.nature.com\u002Farticles\u002Fsdata201635), [website](http:\u002F\u002Fmimic.physionet.org)). Our four clinical prediction tasks are critical care variants of four opportunities to transform health care using in \"big clinical data\" as described in [Bates, et al, 2014](http:\u002F\u002Fcontent.healthaffairs.org\u002Fcontent\u002F33\u002F7\u002F1123.abstract):\n\n* early triage and risk assessment, i.e., mortality prediction\n* prediction of physiologic decompensation\n* identification of high-cost patients, i.e. length of stay forecasting\n* characterization of complex, multi-system diseases, i.e., acute care phenotyping\n\nIn [Harutyunyan, Khachatrian, Kale, and Galstyan 2017](https:\u002F\u002Farxiv.org\u002Fabs\u002F1703.07771), we propose a multitask RNN architecture to solve these four tasks simultaneously and show that this model generally outperforms strong single task baselines.\n\n## Structure\nThe content of this repository can be divided into four big parts:\n* Tools for creating the benchmark datasets.  \n* Tools for reading the benchmark datasets.\n* Evaluation scripts.\n* Baseline models and helper tools.\n\nThe `mimic3benchmark\u002Fscripts` directory contains scripts for creating the benchmark datasets.\nThe reading tools are in `mimic3benchmark\u002Freaders.py`.\nAll evaluation scripts are stored in the `mimic3benchmark\u002Fevaluation` directory.\nThe `mimic3models` directory contains the baselines models along with some helper tools.\nThose tools include discretizers, normalizers and functions for computing metrics.\n\n\n## Requirements and installation\n\nWe do not provide the MIMIC-III data itself. You must acquire the data yourself from https:\u002F\u002Fmimic.physionet.org\u002F. The required libraries are listed in the `requirements.txt` file.\nHere is our suggested way of installation.\n\n1. Install [Miniconda](https:\u002F\u002Fdocs.conda.io\u002Fen\u002Flatest\u002Fminiconda.html).\n2. Run `conda create -n \"mimic3\" python=3.7.13`.\n3. Run `conda init [SHELL_NAME]`. You might also need to do `source ~\u002F.bashrc` or `source ~\u002F.zshrc` (depends on the shell version).\n4. Change the conda environment to `mimic3` by running `conda activate mimic3`.\n5. Clone the repo and change the directory:\n```bash\n       git clone https:\u002F\u002Fgithub.com\u002FYerevaNN\u002Fmimic3-benchmarks\u002F\n       cd mimic3-benchmarks\u002F\n```\n6. Install the requirements with `pip install -r requirements.txt`.\n\nNote that the Python version and some libraries in `requirements.txt` are outdated. This is because the models in `mimic3models\u002F` use an old version of Keras. If you only need to create the benchmark (i.e., you only need the `mimic3benchmark` part), you can use newer Python versions and newer versions of `numpy`, `pandas`, and `scikit-learn`.\n\n## Building the benchmark\nHere are the required steps to build the benchmark. It assumes that you already have MIMIC-III dataset (lots of CSV files) on the disk. All the commands below should be run from the root directory of the repo (i.e., from `mimic3-benchmarks`).\n\n1. The following command takes MIMIC-III CSVs, generates one directory per `SUBJECT_ID` and writes ICU stay information to `data\u002F{SUBJECT_ID}\u002Fstays.csv`, diagnoses to `data\u002F{SUBJECT_ID}\u002Fdiagnoses.csv`, and events to `data\u002F{SUBJECT_ID}\u002Fevents.csv`. This step might take around an hour.\n```bash\n       python -m mimic3benchmark.scripts.extract_subjects {PATH TO MIMIC-III CSVs} data\u002Froot\u002F\n```\n\n2. The following command attempts to fix some issues (ICU stay ID is missing) and removes the events that have missing information. About 80% of events remain after removing all suspicious rows (more information can be found in [`mimic3benchmark\u002Fscripts\u002Fmore_on_validating_events.md`](mimic3benchmark\u002Fscripts\u002Fmore_on_validating_events.md)).\n```bash\n       python -m mimic3benchmark.scripts.validate_events data\u002Froot\u002F\n```\n\n3. The next command breaks up per-subject data into separate episodes (pertaining to ICU stays). Time series of events are stored in ```{SUBJECT_ID}\u002Fepisode{#}_timeseries.csv``` (where # counts distinct episodes) while episode-level information (patient age, gender, ethnicity, height, weight) and outcomes (mortality, length of stay, diagnoses) are stores in ```{SUBJECT_ID}\u002Fepisode{#}.csv```. This script requires two files, one that maps event ITEMIDs to clinical variables and another that defines valid ranges for clinical variables (for detecting outliers, etc.). **Outlier detection is disabled in the current version**.\n```bash\n       python -m mimic3benchmark.scripts.extract_episodes_from_subjects data\u002Froot\u002F\n```\n\n4. The next command splits the whole dataset into training and testing sets. Note that the train\u002Ftest split is the same of all tasks.\n```bash\n       python -m mimic3benchmark.scripts.split_train_and_test data\u002Froot\u002F\n```\n\n5. The following commands will generate task-specific datasets, which can later be used in models. These commands are independent, if you are going to work only on one benchmark task, you can run only the corresponding command.\n```bash\n       python -m mimic3benchmark.scripts.create_in_hospital_mortality data\u002Froot\u002F data\u002Fin-hospital-mortality\u002F\n       python -m mimic3benchmark.scripts.create_decompensation data\u002Froot\u002F data\u002Fdecompensation\u002F\n       python -m mimic3benchmark.scripts.create_length_of_stay data\u002Froot\u002F data\u002Flength-of-stay\u002F\n       python -m mimic3benchmark.scripts.create_phenotyping data\u002Froot\u002F data\u002Fphenotyping\u002F\n       python -m mimic3benchmark.scripts.create_multitask data\u002Froot\u002F data\u002Fmultitask\u002F\n```\n\nAfter the above commands are done, there will be a directory `data\u002F{task}` for each created benchmark task.\nThese directories have two subdirectories: `train` and `test`.\nEach of them contains a bunch of ICU stays and one file with name `listfile.csv`, which lists all samples in that particular set.\nEach row of `listfile.csv` has the following form: `icu_stay, period_length, label(s)`.\nA row specifies a sample for which the input is the collection of ICU event of `icu_stay` that occurred in the first `period_length` hours of the stay and the target is\u002Fare `label(s)`.\nIn in-hospital mortality prediction task `period_length` is always 48 hours, so it is not listed in corresponding listfiles.\n\n\n## Readers\nTo simplify the reading of benchmark data we wrote special classes.\nThe `mimic3benchmark\u002Freaders.py` contains class `Reader` and five other task-specific classes derived from it.\nThese are designed to simplify reading of benchmark data. The classes require a directory containing ICU stays and a listfile specifying the samples.\nAgain, we encourage to use these readers to avoid mistakes in the reading step (for example using events that happened after the first `period_length` hours).  \nFor more information about using readers view the [`mimic3benchmark\u002Fmore_on_readers.md`](mimic3benchmark\u002Fmore_on_readers.md) file.\n\n\n## Evaluation\nFor each of the four tasks we provide scripts for evaluating models.\nThese scripts receive a `csv` file containing the predictions and produce a `json` file containing the scores and confidence intervals for different metrics.\nWe highly encourage to use these scripts to prevent any mistake in the evaluation step.\nFor details about the usage of the evaluation scripts view the [`mimic3benchmark\u002Fevaluation\u002FREADME.md`](mimic3benchmark\u002Fevaluation\u002FREADME.md) file.\n\n\n## Baselines\nFor each of the four main tasks we provide 7 baselines:  \n* Linear\u002Flogistic regression\n* Standard LSTM\n* Standard LSTM + deep supervision\n* Channel-wise LSTM\n* Channel-wise LSTM + deep supervision\n* Multitask standard LSTM\n* Multitask channel-wise LSTM\n\nThe detailed descriptions of the baselines will appear in the next version of the paper.\n\nLinear models can be found in `mimic3models\u002F{task}\u002Flogistic` directories.\nLSTM-based models are in `mimic3models\u002Fkeras_models` directory.\n\nPlease note that running linear models can take hours because of extensive grid search and feature extraction.\nYou can change the size of the training data of linear models in the scripts, so they will become faster (of course the performance will not be the same).\n\nTo train the neural networks, you might need to select the keras backend to be `tensorflow`. This can be done by prepending `KERAS_BACKEND=tensorflow` to the training commands below, or by creating an environment variable `KERAS_BACKEND` with value `tensorflow`.\n\n### Train \u002F validation split\n\nUse the following command to extract validation set from the training set. This step is required for running the baseline models. Likewise, the train\u002Ftest split, the train\u002Fvalidation split is the same for all tasks.\n```bash\n       python -m mimic3models.split_train_val {dataset-directory}\n```\n`{dataset-directory}` can be either `data\u002Fin-hospital-mortality`, `data\u002Fdecompensation`, `data\u002Flength-of-stay`, `data\u002Fphenotyping` or `data\u002Fmultitask`.\n\n\n### In-hospital mortality prediction\n\nRun the following command to train the neural network which gives the best result. We got the best performance on validation set after 28 epochs.\n```bash\n       python -um mimic3models.in_hospital_mortality.main --network mimic3models\u002Fkeras_models\u002Flstm.py --dim 16 --timestep 1.0 --depth 2 --dropout 0.3 --mode train --batch_size 8 --output_dir mimic3models\u002Fin_hospital_mortality\n```\nUse the following command to train logistic regression. The best model we got used L2 regularization with `C=0.001`:\n```bash\n       python -um mimic3models.in_hospital_mortality.logistic.main --l2 --C 0.001 --output_dir mimic3models\u002Fin_hospital_mortality\u002Flogistic\n```\n### Decompensation prediction\n\nThe best model we got for this task was trained for 36 chunks (that's less than one epoch; it overfits before reaching one epoch because there are many training samples for the same patient with different lengths).\n```bash\n       python -um mimic3models.decompensation.main --network mimic3models\u002Fkeras_models\u002Flstm.py --dim 128 --timestep 1.0 --depth 1 --mode train --batch_size 8 --output_dir mimic3models\u002Fdecompensation\n```\nUse the following command to train a logistic regression. It will have L2 regularization with `C=0.001`, which gave us the best result. To run a grid search over a space of hyper-parameters add `--grid-search` to the command.\n```bash\n       python -um mimic3models.decompensation.logistic.main --output_dir mimic3models\u002Fdecompensation\u002Flogistic\n```\n### Length of stay prediction\n\nThe best model we got for this task was trained for 19 chunks.\n```bash\n       python -um mimic3models.length_of_stay.main --network mimic3models\u002Fkeras_models\u002Flstm.py --dim 64 --timestep 1.0 --depth 1 --dropout 0.3 --mode train --batch_size 8 --partition custom --output_dir mimic3models\u002Flength_of_stay\n```\nUse the following command to train a logistic regression. It will have L1 regularization with `C=0.00001`. To run a grid search over a space of hyperparameters add `--grid-search` to the command.\n```bash\n       python -um mimic3models.length_of_stay.logistic.main_cf --output_dir mimic3models\u002Flength_of_stay\u002Flogistic\n```\nTo run a linear regression use this command:\n```bash\n        python -um mimic3models.length_of_stay.logistic.main --output_dir mimic3models\u002Flength_of_stay\u002Flogistic\n```\n\n### Phenotype classification\n\nThe best model we got for this task was trained for 20 epochs.\n```bash\n       python -um mimic3models.phenotyping.main --network mimic3models\u002Fkeras_models\u002Flstm.py --dim 256 --timestep 1.0 --depth 1 --dropout 0.3 --mode train --batch_size 8 --output_dir mimic3models\u002Fphenotyping\n```\nUse the following command for logistic regression. It will have L1 regularization with `C=0.1`. To run a grid search over a space of hyperparameters add `--grid-search` to the command.\n```bash\n       python -um mimic3models.phenotyping.logistic.main --output_dir mimic3models\u002Fphenotyping\u002Flogistic\n```\n### Multitask learning\n\n`ihm_C`, `decomp_C`, `los_C` and `ph_C` coefficients control the relative weight of the tasks in the multitask model. Default is `1.0`. Multitask network architectures are stored in `mimic3models\u002Fmultitask\u002Fkeras_models`. Here is a sample command for running a multitasking model.\n```bash\n       python -um mimic3models.multitask.main --network mimic3models\u002Fkeras_models\u002Fmultitask_lstm.py --dim 512 --timestep 1 --mode train --batch_size 16 --dropout 0.3 --ihm_C 0.2 --decomp_C 1.0 --los_C 1.5 --pheno_C 1.0 --output_dir mimic3models\u002Fmultitask\n```\n\n## General todos:\n\n- Improve comments and documentation\n- Add the best state files for each baseline\n- Release 1.0\n- Update citation section with Zenodo DOI\n- Add to MIMIC's derived data repo\n- Refactor, where appropriate, to make code more generally useful\n- Expand coverage of variable map and variable range files.\n- Decide whether we are missing any other high-priority data (CPT codes, inputs, etc.)\n","MIMIC-III 基准测试\n=========================\n\n[![加入 https:\u002F\u002Fgitter.im\u002FYerevaNN\u002Fmimic3-benchmarks 的聊天](https:\u002F\u002Fbadges.gitter.im\u002FYerevaNN\u002Fmimic3-benchmarks.svg)](https:\u002F\u002Fgitter.im\u002FYerevaNN\u002Fmimic3-benchmarks?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)\n\n这是一个基于 Python 的工具套件，用于从 MIMIC-III 临床数据库中构建基准机器学习数据集。目前，这些基准数据集涵盖了四项关键的住院患者临床预测任务，分别对应于核心的机器学习问题：基于入院早期数据的死亡率预测（分类）、实时去代偿检测（时间序列分类）、住院时长预测（回归）以及表型分类（多标签序列分类）。\n\n\n## 最新消息\n\n* 2018年12月28日：论文的第二稿已在 [arXiv](https:\u002F\u002Farxiv.org\u002Fabs\u002F1703.07771) 上发布。\n* 2017年12月8日：该工作在 NIPS 2017 [机器学习与健康研讨会](https:\u002F\u002Fml4health.github.io\u002F2017\u002F) 上以亮点报告形式进行了展示。\n* 2017年3月23日：我们很高兴地宣布这些基准的首个正式版本发布。我们预计在未来几个月内发布一个修订版，其中将增加至少约 50 个额外的输入变量。同时，我们也高兴地宣布与这些基准相关的论文现已在 [arXiv](https:\u002F\u002Farxiv.org\u002Fabs\u002F1703.07771) 上公开。\n\n## 引用\n\n如果您在研究中使用了此代码或这些基准，请引用以下出版物：\n```\n@article{Harutyunyan2019,\n  author={Harutyunyan, Hrayr and Khachatrian, Hrant and Kale, David C. and Ver Steeg, Greg and Galstyan, Aram},\n  title={Multitask learning and benchmarking with clinical time series data},\n  journal={Scientific Data},\n  year={2019},\n  volume={6},\n  number={1},\n  pages={96},\n  issn={2052-4463},\n  doi={10.1038\u002Fs41597-019-0103-9},\n  url={https:\u002F\u002Fdoi.org\u002F10.1038\u002Fs41597-019-0103-9}\n}\n```\n**请务必同时引用原始的 [MIMIC-III 论文](http:\u002F\u002Fwww.nature.com\u002Farticles\u002Fsdata201635)。**\n\n## 研究动机\n\n尽管将机器学习应用于临床数据的研究迅速增长，但该领域的进展却远不如其他机器学习应用那样显著。例如，在图像识别领域，[ImageNet 大规模视觉识别挑战赛](http:\u002F\u002Fimage-net.org\u002Fchallenges\u002FLSVRC\u002F)（ILSVRC）的冠军错误率从 2010 年的 0.2819 急剧下降到 2016 年的 0.02991，降幅接近 90%。\n\n造成这种差异的原因有很多合理解释：临床数据集通常具有[固有的噪声和不确定性](http:\u002F\u002Fwww-scf.usc.edu\u002F~dkale\u002Fpapers\u002Fmarlin-ihi2012-ehr_clustering.pdf)，并且相对于其复杂性而言往往规模较小；此外，对于许多感兴趣的问题，[用于训练和评估的真实标签通常是不可得的](https:\u002F\u002Facademic.oup.com\u002Fjamia\u002Farticle-abstract\u002F23\u002F6\u002F1166\u002F2399304\u002FLearning-statistical-models-of-phenotypes-using?redirectedFrom=PDF)。\n\n然而，还有一个更为简单的解释：由于缺乏类似 ImageNet 的社区基准，实际进展难以衡量。这类基准在加速机器学习研究方面发挥着重要作用。首先，它们能够将研究社区的注意力集中在特定问题上，并持续引发关于这些问题本质的讨论。其次，它们降低了研究人员进入新领域的初始门槛。最后，也是最重要的，基准有助于实现结果的可重复性和不同方法之间的直接比较。\n\n在此，我们为对医疗保健感兴趣的机器学习研究人员提供了四个公开基准，这些基准基于公开可用的重症监护医学信息库（MIMIC-III）数据库中的数据构建而成（[论文](http:\u002F\u002Fwww.nature.com\u002Farticles\u002Fsdata201635)、[官网](http:\u002F\u002Fmimic.physionet.org)）。我们的四项临床预测任务是重症监护领域的变体，对应于 [Bates 等人，2014 年](http:\u002F\u002Fcontent.healthaffairs.org\u002Fcontent\u002F33\u002F7\u002F1123.abstract) 所描述的利用“大型临床数据”变革医疗保健的四大机遇：\n\n* 早期分诊与风险评估，即死亡率预测\n* 生理功能失代偿的预测\n* 高成本患者的识别，即住院时长预测\n* 复杂多系统疾病的特征化，即急性期表型分类\n\n在 [Harutyunyan、Khachatrian、Kale 和 Galstyan，2017 年](https:\u002F\u002Farxiv.org\u002Fabs\u002F1703.07771) 的研究中，我们提出了一种多任务 RNN 架构来同时解决这四项任务，并证明该模型通常优于强大的单任务基线模型。\n\n## 项目结构\n本仓库的内容可分为四个主要部分：\n* 用于创建基准数据集的工具。\n* 用于读取基准数据集的工具。\n* 评估脚本。\n* 基线模型及辅助工具。\n\n`mimic3benchmark\u002Fscripts` 目录包含用于创建基准数据集的脚本。\n读取工具位于 `mimic3benchmark\u002Freaders.py` 中。\n所有评估脚本均存储在 `mimic3benchmark\u002Fevaluation` 目录中。\n`mimic3models` 目录则包含了基线模型以及一些辅助工具，包括离散化器、归一化工具和指标计算函数。\n\n\n## 系统要求与安装\n我们不提供 MIMIC-III 数据本身。您需要自行从 https:\u002F\u002Fmimic.physionet.org\u002F 获取数据。所需的库列在 `requirements.txt` 文件中。以下是我们的建议安装步骤：\n\n1. 安装 [Miniconda](https:\u002F\u002Fdocs.conda.io\u002Fen\u002Flatest\u002Fminiconda.html)。\n2. 运行 `conda create -n \"mimic3\" python=3.7.13`。\n3. 运行 `conda init [SHELL_NAME]`。您可能还需要执行 `source ~\u002F.bashrc` 或 `source ~\u002F.zshrc`（取决于使用的 shell 版本）。\n4. 切换到 `mimic3` 环境：`conda activate mimic3`。\n5. 克隆仓库并进入目录：\n```bash\n       git clone https:\u002F\u002Fgithub.com\u002FYerevaNN\u002Fmimic3-benchmarks\u002F\n       cd mimic3-benchmarks\u002F\n```\n6. 使用 `pip install -r requirements.txt` 安装依赖项。\n\n请注意，`requirements.txt` 中的 Python 版本和部分库已过时。这是因为 `mimic3models\u002F` 中的模型使用的是旧版本的 Keras。如果您仅需创建基准数据集（即仅使用 `mimic3benchmark` 部分），则可以使用更新的 Python 版本以及更新的 `numpy`、`pandas` 和 `scikit-learn` 版本。\n\n## 构建基准测试\n以下是构建基准测试所需的步骤。假设您已经在磁盘上拥有 MIMIC-III 数据集（大量 CSV 文件）。以下所有命令都应在仓库的根目录下运行（即从 `mimic3-benchmarks` 目录）。\n\n1. 下述命令会读取 MIMIC-III 的 CSV 文件，为每个 `SUBJECT_ID` 生成一个单独的目录，并将 ICU 住院信息写入 `data\u002F{SUBJECT_ID}\u002Fstays.csv`，诊断信息写入 `data\u002F{SUBJECT_ID}\u002Fdiagnoses.csv`，事件数据写入 `data\u002F{SUBJECT_ID}\u002Fevents.csv`。此步骤可能需要约一小时。\n```bash\n       python -m mimic3benchmark.scripts.extract_subjects {MIMIC-III CSV 文件路径} data\u002Froot\u002F\n```\n\n2. 下述命令会尝试修复一些问题（例如缺少 ICU 住院 ID），并移除包含缺失信息的事件。移除所有可疑行后，约有 80% 的事件得以保留（更多信息请参阅 [`mimic3benchmark\u002Fscripts\u002Fmore_on_validating_events.md`](mimic3benchmark\u002Fscripts\u002Fmore_on_validating_events.md)）。\n```bash\n       python -m mimic3benchmark.scripts.validate_events data\u002Froot\u002F\n```\n\n3. 接下来的命令会将每个患者的住院数据拆分为独立的病程片段（对应于 ICU 住院期间）。事件的时间序列数据会被存储在 `{SUBJECT_ID}\u002Fepisode{#}_timeseries.csv` 中（其中 # 表示不同的病程片段编号），而病程级别的信息（患者年龄、性别、种族、身高、体重）以及预后指标（死亡率、住院时长、诊断）则会被存储在 `{SUBJECT_ID}\u002Fepisode{#}.csv` 中。该脚本需要两个文件：一个用于将事件 ITEMID 映射到临床变量，另一个用于定义临床变量的有效范围（以便检测异常值等）。**当前版本中已禁用异常值检测功能**。\n```bash\n       python -m mimic3benchmark.scripts.extract_episodes_from_subjects data\u002Froot\u002F\n```\n\n4. 下一步是将整个数据集划分为训练集和测试集。请注意，所有任务的训练\u002F测试划分方式均相同。\n```bash\n       python -m mimic3benchmark.scripts.split_train_and_test data\u002Froot\u002F\n```\n\n5. 下列命令将生成特定于各任务的数据集，这些数据集随后可用于模型训练。这些命令彼此独立；如果您只打算研究某一项基准任务，则只需运行相应的命令即可。\n```bash\n       python -m mimic3benchmark.scripts.create_in_hospital_mortality data\u002Froot\u002F data\u002Fin-hospital-mortality\u002F\n       python -m mimic3benchmark.scripts.create_decompensation data\u002Froot\u002F data\u002Fdecompensation\u002F\n       python -m mimic3benchmark.scripts.create_length_of_stay data\u002Froot\u002F data\u002Flength-of-stay\u002F\n       python -m mimic3benchmark.scripts.create_phenotyping data\u002Froot\u002F data\u002Fphenotyping\u002F\n       python -m mimic3benchmark.scripts.create_multitask data\u002Froot\u002F data\u002Fmultitask\u002F\n```\n\n完成上述步骤后，每项基准任务都会生成一个名为 `data\u002F{task}` 的目录。这些目录下包含两个子目录：`train` 和 `test`。每个子目录中都存放着若干 ICU 住院记录，以及一个名为 `listfile.csv` 的文件，该文件列出了相应数据集中所有的样本。`listfile.csv` 中的每一行格式如下：`icu_stay, period_length, label(s)`。一行代表一个样本，其输入为该 ICU 住院记录在前 `period_length` 小时内发生的所有事件，目标则是对应的标签。在院内死亡率预测任务中，`period_length` 始终为 48 小时，因此不会在相应的列表文件中列出。\n\n## 数据读取器\n为了简化基准数据的读取，我们编写了专门的类。`mimic3benchmark\u002Freaders.py` 包含一个通用的 `Reader` 类，以及五个基于该类派生的特定于各任务的类。这些类旨在简化基准数据的读取过程。使用这些读取器时，需提供包含 ICU 住院记录的目录以及指定样本的列表文件。我们强烈建议使用这些读取器，以避免在读取过程中出现错误（例如误用发生在前 `period_length` 小时之外的事件）。\n\n有关如何使用这些读取器的更多信息，请参阅 [`mimic3benchmark\u002Fmore_on_readers.md`](mimic3benchmark\u002Fmore_on_readers.md) 文件。\n\n## 评估\n针对四个任务，我们分别提供了模型评估脚本。这些脚本接收包含预测结果的 `csv` 文件，并输出一个包含各项指标得分及置信区间 的 `json` 文件。我们强烈建议使用这些脚本进行评估，以避免评估环节中的任何错误。有关评估脚本的具体用法，请参阅 [`mimic3benchmark\u002Fevaluation\u002FREADME.md`](mimic3benchmark\u002Fevaluation\u002FREADME.md) 文件。\n\n## 基线模型\n针对四个主要任务，我们提供了七种基线模型：\n* 线性\u002F逻辑回归\n* 标准 LSTM\n* 标准 LSTM + 深度监督\n* 通道级 LSTM\n* 通道级 LSTM + 深度监督\n* 多任务标准 LSTM\n* 多任务通道级 LSTM\n\n关于这些基线模型的详细描述将在论文的下一版中发布。\n\n线性模型位于 `mimic3models\u002F{task}\u002Flogistic` 目录中。基于 LSTM 的模型则位于 `mimic3models\u002Fkeras_models` 目录中。\n\n请注意，由于进行了大规模的网格搜索和特征提取，运行线性模型可能需要数小时。您可以在脚本中调整线性模型的训练数据规模，从而加快运行速度（当然，性能也会有所下降）。\n\n要训练神经网络，您可能需要将 Keras 后端设置为 TensorFlow。这可以通过在以下训练命令前添加 `KERAS_BACKEND=tensorflow` 来实现，或者通过设置环境变量 `KERAS_BACKEND` 并将其值设为 `tensorflow`。\n\n### 训练集与验证集的划分\n\n使用以下命令可以从训练集中提取验证集。此步骤对于运行基线模型至关重要。同样地，所有任务的训练\u002F验证划分方式也是一致的。\n```bash\n       python -m mimic3models.split_train_val {数据集目录}\n```\n`{数据集目录}` 可以是 `data\u002Fin-hospital-mortality`、`data\u002Fdecompensation`、`data\u002Flength-of-stay`、`data\u002Fphenotyping` 或 `data\u002Fmultitask`。\n\n### 在院内死亡率预测\n\n运行以下命令可训练出效果最佳的神经网络。我们在验证集上观察到的最佳性能出现在第 28 个 epoch。\n```bash\n       python -um mimic3models.in_hospital_mortality.main --network mimic3models\u002Fkeras_models\u002Flstm.py --dim 16 --timestep 1.0 --depth 2 --dropout 0.3 --mode train --batch_size 8 --output_dir mimic3models\u002Fin_hospital_mortality\n```\n\n使用以下命令可训练逻辑回归模型。我们得到的最佳模型采用了 L2 正则化，且正则化参数 `C=0.001`：\n```bash\n       python -um mimic3models.in_hospital_mortality.logistic.main --l2 --C 0.001 --output_dir mimic3models\u002Fin_hospital_mortality\u002Flogistic\n```\n\n### 失代偿预测\n\n我们为该任务训练的最佳模型仅训练了36个批次（不到一个 epoch；由于同一患者有大量不同长度的训练样本，模型在达到一个 epoch 之前就已过拟合）。\n```bash\n       python -um mimic3models.decompensation.main --network mimic3models\u002Fkeras_models\u002Flstm.py --dim 128 --timestep 1.0 --depth 1 --mode train --batch_size 8 --output_dir mimic3models\u002Fdecompensation\n```\n使用以下命令训练逻辑回归模型。该模型将采用 L2 正则化，正则化系数 `C=0.001`，这是我们得到的最佳结果。若需在超参数空间中进行网格搜索，可在命令中添加 `--grid-search`。\n```bash\n       python -um mimic3models.decompensation.logistic.main --output_dir mimic3models\u002Fdecompensation\u002Flogistic\n```\n\n### 住院时长预测\n\n我们为该任务训练的最佳模型训练了19个批次。\n```bash\n       python -um mimic3models.length_of_stay.main --network mimic3models\u002Fkeras_models\u002Flstm.py --dim 64 --timestep 1.0 --depth 1 --dropout 0.3 --mode train --batch_size 8 --partition custom --output_dir mimic3models\u002Flength_of_stay\n```\n使用以下命令训练逻辑回归模型。该模型将采用 L1 正则化，正则化系数 `C=0.00001`。若需在超参数空间中进行网格搜索，可在命令中添加 `--grid-search`。\n```bash\n       python -um mimic3models.length_of_stay.logistic.main_cf --output_dir mimic3models\u002Flength_of_stay\u002Flogistic\n```\n若需运行线性回归模型，请使用以下命令：\n```bash\n        python -um mimic3models.length_of_stay.logistic.main --output_dir mimic3models\u002Flength_of_stay\u002Flogistic\n```\n\n### 表型分类\n\n我们为该任务训练的最佳模型训练了20个 epoch。\n```bash\n       python -um mimic3models.phenotyping.main --network mimic3models\u002Fkeras_models\u002Flstm.py --dim 256 --timestep 1.0 --depth 1 --dropout 0.3 --mode train --batch_size 8 --output_dir mimic3models\u002Fphenotyping\n```\n使用以下命令进行逻辑回归训练。该模型将采用 L1 正则化，正则化系数 `C=0.1`。若需在超参数空间中进行网格搜索，可在命令中添加 `--grid-search`。\n```bash\n       python -um mimic3models.phenotyping.logistic.main --output_dir mimic3models\u002Fphenotyping\u002Flogistic\n```\n\n### 多任务学习\n\n`ihm_C`、`decomp_C`、`los_C` 和 `ph_C` 系数用于控制多任务模型中各任务的相对权重。默认值为 `1.0`。多任务网络架构存储在 `mimic3models\u002Fmultitask\u002Fkeras_models` 目录中。以下是一个运行多任务模型的示例命令。\n```bash\n       python -um mimic3models.multitask.main --network mimic3models\u002Fkeras_models\u002Fmultitask_lstm.py --dim 512 --timestep 1 --mode train --batch_size 16 --dropout 0.3 --ihm_C 0.2 --decomp_C 1.0 --los_C 1.5 --pheno_C 1.0 --output_dir mimic3models\u002Fmultitask\n```\n\n## 通用待办事项：\n\n- 改进注释和文档\n- 为每个基线模型添加最佳状态文件\n- 发布 1.0 版本\n- 使用 Zenodo DOI 更新引用部分\n- 将代码添加到 MIMIC 的衍生数据仓库\n- 在适当的地方重构代码，使其更具通用性\n- 扩展变量映射文件和变量范围文件的覆盖范围\n- 确定是否还缺少其他高优先级数据（如 CPT 代码、输入等）","# MIMIC-III Benchmarks 快速上手指南\n\nMIMIC-III Benchmarks 是一个用于从 MIMIC-III 临床数据库构建机器学习基准数据集的 Python 工具套件。它涵盖了四个核心住院临床预测任务：院内死亡率预测、失代偿实时检测、住院时长预测和表型分类。\n\n## 环境准备\n\n*   **操作系统**：Linux 或 macOS（Windows 用户建议使用 WSL2 或 Docker）。\n*   **数据依赖**：本项目**不包含** MIMIC-III 原始数据。你需要先在 [PhysioNet](https:\u002F\u002Fmimic.physionet.org\u002F) 申请并下载 MIMIC-III 数据集（CSV 格式）。\n*   **运行环境**：推荐安装 Miniconda 以管理 Python 环境。\n    *   注意：官方基线模型依赖较旧版本的 Keras，因此默认环境锁定为 Python 3.7.13。如果你仅需构建数据集（不使用内置基线模型），可使用更新的 Python 版本及依赖库。\n\n## 安装步骤\n\n1.  **安装 Miniconda**\n    前往 [Miniconda 官网](https:\u002F\u002Fdocs.conda.io\u002Fen\u002Flatest\u002Fminiconda.html) 下载并安装。\n    *(国内用户可参考清华源安装教程加速)*\n\n2.  **创建虚拟环境**\n    ```bash\n    conda create -n \"mimic3\" python=3.7.13\n    ```\n\n3.  **初始化 Shell**\n    根据你的 Shell 类型执行初始化（通常安装时已提示），并重新加载配置：\n    ```bash\n    conda init [SHELL_NAME]\n    source ~\u002F.bashrc  # 或者 source ~\u002F.zshrc\n    ```\n\n4.  **激活环境**\n    ```bash\n    conda activate mimic3\n    ```\n\n5.  **克隆代码仓库**\n    ```bash\n    git clone https:\u002F\u002Fgithub.com\u002FYerevaNN\u002Fmimic3-benchmarks\u002F\n    cd mimic3-benchmarks\u002F\n    ```\n\n6.  **安装依赖**\n    *(建议配置 pip 国内镜像源，如清华源，以加速下载)*\n    ```bash\n    pip install -r requirements.txt -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple\n    ```\n\n## 基本使用\n\n以下流程假设你已将 MIMIC-III 的 CSV 文件下载到本地路径 `{PATH TO MIMIC-III CSVs}`。所有命令请在项目根目录 `mimic3-benchmarks\u002F` 下执行。\n\n### 1. 提取患者数据\n将原始 CSV 转换为按 `SUBJECT_ID` 组织的目录结构。此过程约需 1 小时。\n```bash\npython -m mimic3benchmark.scripts.extract_subjects {PATH TO MIMIC-III CSVs} data\u002Froot\u002F\n```\n\n### 2. 验证事件数据\n修复缺失的 ICU 停留 ID 并移除信息不全的事件记录（约保留 80% 的有效数据）。\n```bash\npython -m mimic3benchmark.scripts.validate_events data\u002Froot\u002F\n```\n\n### 3. 提取就诊片段 (Episodes)\n将数据按 ICU 停留划分为独立的就诊片段，生成时间序列文件和包含人口统计信息及结果的元数据文件。\n```bash\npython -m mimic3benchmark.scripts.extract_episodes_from_subjects data\u002Froot\u002F\n```\n\n### 4. 划分训练集与测试集\n将整个数据集划分为训练集和测试集（所有任务共用同一划分）。\n```bash\npython -m mimic3benchmark.scripts.split_train_and_test data\u002Froot\u002F\n```\n\n### 5. 生成特定任务数据集\n根据需求生成具体任务的基准数据。你可以只运行需要的任务命令。\n\n*   **院内死亡率预测 (In-hospital Mortality)**\n    ```bash\n    python -m mimic3benchmark.scripts.create_in_hospital_mortality data\u002Froot\u002F data\u002Fin-hospital-mortality\u002F\n    ```\n*   **失代偿检测 (Decompensation)**\n    ```bash\n    python -m mimic3benchmark.scripts.create_decompensation data\u002Froot\u002F data\u002Fdecompensation\u002F\n    ```\n*   **住院时长预测 (Length of Stay)**\n    ```bash\n    python -m mimic3benchmark.scripts.create_length_of_stay data\u002Froot\u002F data\u002Flength-of-stay\u002F\n    ```\n*   **表型分类 (Phenotyping)**\n    ```bash\n    python -m mimic3benchmark.scripts.create_phenotyping data\u002Froot\u002F data\u002Fphenotyping\u002F\n    ```\n*   **多任务学习 (Multitask)**\n    ```bash\n    python -m mimic3benchmark.scripts.create_multitask data\u002Froot\u002F data\u002Fmultitask\u002F\n    ```\n\n生成完成后，每个任务将在 `data\u002F{task}\u002F` 目录下产生 `train` 和 `test` 子目录，其中包含具体的样本数据和 `listfile.csv`（索引文件）。\n\n### 读取数据示例\n推荐使用内置的 Reader 类来避免数据处理错误（如时间泄露）。以下是读取死亡率预测数据的简单示例：\n\n```python\nfrom mimic3benchmark.readers import InHospitalMortalityReader\n\n# 指定数据目录和列表文件\nreader = InHospitalMortalityReader(\n    dataset_dir='data\u002Fin-hospital-mortality\u002Ftrain',\n    listfile='data\u002Fin-hospital-mortality\u002Ftrain\u002Flistfile.csv',\n    period_length=48.0\n)\n\n# 迭代读取样本\nfor i in range(reader.get_number_of_examples()):\n    example = reader.read_example(i)\n    # example['X'] 包含时间序列特征\n    # example['y'] 包含标签\n    break \n```","某医疗 AI 初创团队正致力于开发一套重症监护室（ICU）患者死亡风险实时预警系统，需要基于真实的临床时间序列数据进行模型训练与验证。\n\n### 没有 mimic3-benchmarks 时\n- **数据清洗耗时极长**：研究人员需花费数周时间手动解析 MIMIC-III 原始数据库，处理缺失值、异常值及非标准化的时间戳，极易引入人为错误。\n- **任务定义模糊不一**：团队内部对“早期入院数据”的时间窗口划分、“去代偿”事件的标签定义缺乏统一标准，导致不同成员构建的数据集无法互通。\n- **模型对比困难**：由于缺乏公认的基准测试集，团队难以判断新算法是否真正优于现有方案，还是仅仅因为数据预处理差异导致的假象。\n- **复现成本高昂**：外部专家或合作者若想复现实验结果，必须重新经历繁琐的数据构建过程，严重阻碍了技术交流与论文评审。\n\n### 使用 mimic3-benchmarks 后\n- **一键生成标准数据集**：直接运行 Python 套件即可自动从 MIMIC-III 提取并清洗出针对死亡率预测等四大核心任务的标准化数据集，将准备时间从数周缩短至数小时。\n- **统一评估基准**：工具内置了严格的任务定义（如分类、回归、多标签序列分类），确保团队内外部都在同一套逻辑严密的规则下进行开发。\n- **公平的性能竞技**：基于官方生成的基准数据，团队能精确量化新模型在死亡预测或住院时长预估上的提升幅度，快速迭代最优算法。\n- **无缝学术对接**：生成的数据集格式与顶会论文完全兼容，不仅便于复现他人成果，也让自己的研究更容易被社区认可和引用。\n\nmimic3-benchmarks 通过提供标准化的临床数据构建流程，消除了医疗机器学习研究中最大的“启动摩擦”，让研究者能专注于算法创新而非数据泥潭。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FYerevaNN_mimic3-benchmarks_9966ce10.png","YerevaNN","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002FYerevaNN_c41c3f41.png","research lab",null,"info@yerevann.com","http:\u002F\u002Fyerevann.com\u002F","https:\u002F\u002Fgithub.com\u002FYerevaNN",[83],{"name":84,"color":85,"percentage":86},"Python","#3572A5",100,879,344,"2026-03-31T07:04:33","MIT",4,"未说明","未说明（基线模型基于 Keras，可配置 TensorFlow 后端，未强制要求 GPU）",{"notes":95,"python":96,"dependencies":97},"1. 本项目不提供 MIMIC-III 原始数据，需用户自行从官网获取。2. requirements.txt 中的库版本较旧，是因为基线模型使用了旧版 Keras；若仅需构建数据集（不使用基线模型），可使用更新的 Python、numpy、pandas 和 scikit-learn 版本。3. 运行线性回归基线模型可能耗时数小时。4. 若训练神经网络，需将 Keras 后端设置为 tensorflow。","3.7.13",[98,99,100,101],"Keras (旧版本)","numpy","pandas","scikit-learn",[54,51,13,53],[104,105,106,107],"machine-learning","benchmark","clinical-data","deep-learning","2026-03-27T02:49:30.150509","2026-04-06T07:14:04.492672",[111,116,121,126,131,136],{"id":112,"question_zh":113,"answer_zh":114,"source_url":115},15051,"运行脚本时遇到 'OverflowError: Overflow in int64 addition' 错误，该如何解决？","该错误通常发生在计算年龄时，由于 pandas 版本更新导致的时间戳溢出。请修改 `mimic3csv.py` 中的 `add_age_to_icustays` 函数，将日期转换为日期对象后再计算天数。推荐代码如下：\n\n```python\ndef add_age_to_icustays(stays):\n    stays.INTIME = pd.to_datetime(stays.INTIME).dt.date\n    stays.DOB = pd.to_datetime(stays.DOB).dt.date\n    stays['AGE'] = stays.apply(lambda e:(e.INTIME - e.DOB).days\u002F365, axis = 1)\n    stays.loc[stays.AGE \u003C 0, 'AGE'] = 90\n    return stays\n```\n或者使用更简洁的向量化操作：`stays['AGE'] = (stays.INTIME - stays.DOB).dt.days \u002F 365.25`。","https:\u002F\u002Fgithub.com\u002FYerevaNN\u002Fmimic3-benchmarks\u002Fissues\u002F84",{"id":117,"question_zh":118,"answer_zh":119,"source_url":120},15052,"在 Windows 系统上运行时，提示找不到 'zero.normalizer' 文件或出现 'Invalid argument' 错误，怎么办？","这是因为 Windows 文件系统不支持文件名中包含冒号（:），而默认生成的归一化状态文件名中包含了冒号。解决方法是修改 `mimic3models\u002Fin_hospital_mortality\u002Fmain.py` 第 55 行左右的代码，将文件名中的冒号替换为下划线或其他合法字符。\n\n修改前：\n`normalizer_state = 'ihm_ts{}.input_str:{}.start_time:zero.normalizer'.format(...)`\n\n修改后：\n`normalizer_state = 'ihm_ts{}.input_str_{}.start_time_zero.normalizer'.format(args.timestep, args.imputation)`","https:\u002F\u002Fgithub.com\u002FYerevaNN\u002Fmimic3-benchmarks\u002Fissues\u002F57",{"id":122,"question_zh":123,"answer_zh":124,"source_url":125},15053,"运行创建基准脚本时遇到时间格式不匹配错误（ValueError: time data does not match format），如何处理？","该错误是因为数据源中的时间字符串格式不统一，部分包含时分秒（%H:%M:%S），部分仅包含日期。不要直接删除格式字符串中的时间部分，因为这会导致另一部分数据解析失败。建议检查数据源或使用更灵活的时间解析方法（如 `pd.to_datetime` 自动推断格式），确保能同时处理 'YYYY-MM-DD' 和 'YYYY-MM-DD HH:MM:SS' 两种格式。如果必须手动修复，需编写逻辑判断字符串长度或内容来动态选择解析格式。","https:\u002F\u002Fgithub.com\u002FYerevaNN\u002Fmimic3-benchmarks\u002Fissues\u002F103",{"id":127,"question_zh":128,"answer_zh":129,"source_url":130},15054,"运行模型训练时提示找不到 '..\u002F..\u002Fdata\u002Fmultitask\u002Ftrain_listfile.csv' 文件，原因是什么？","这通常是因为数据预处理步骤未完成或目录结构不正确。请确保你已经成功运行了 `scripts\u002Fextract_subjects.py` 和其他必要的预处理脚本，并且生成的数据文件确实存在于预期的目录结构中。检查当前工作目录是否正确（应在 `mimic3models\u002Fphenotyping\u002F` 下运行），并确认 `..\u002F..\u002Fdata\u002Fmultitask\u002F` 路径下是否已生成 `train_listfile.csv`。如果文件缺失，请重新运行完整的数据提取和基准构建流程。","https:\u002F\u002Fgithub.com\u002FYerevaNN\u002Fmimic3-benchmarks\u002Fissues\u002F11",{"id":132,"question_zh":133,"answer_zh":134,"source_url":135},15055,"在进行 ICU 事件的时间序列异常检测时，应该如何选择训练数据以提高模型效果？","建议仅在相对“健康”的数据子集上进行训练，而不是使用完整的 MIMIC 数据集。如果在包含各种错误或异常状态的完整数据上训练，模型可能会将这些异常视为正常模式，从而无法有效检测出真正的异常状态（如不健康的生理状态或编码错误）。通过在健康子集上训练，模型能更好地学习正常模式，从而在测试时对偏离正常模式的事件产生更大的预测误差，进而识别出异常。","https:\u002F\u002Fgithub.com\u002FYerevaNN\u002Fmimic3-benchmarks\u002Fissues\u002F12",{"id":137,"question_zh":138,"answer_zh":139,"source_url":130},15056,"训练日志中输出的进度数字（如 1.500）具体代表什么含义？","这些数字表示训练的进度，格式为：[epoch] . [current sample] \u002F [number of samples]。具体来说，小数点前是当前训练的轮数（epoch），小数点后是当前处理的样本编号与总样本数的比例。需要注意的是，在住院时长预测等任务中，这里的“样本”并不完全等同于“患者”，因为一个患者可能包含多个时间片段样本。",[141],{"id":142,"version":143,"summary_zh":144,"released_at":145},81889,"v1.0.0-alpha","# 在最终 v1.0.0 版本发布前需要完成的改进\n* 使代码兼容最新版本的 Keras\n* 将新版本论文上传至 Arxiv\n* 更新 README 文件\n    * 添加更详细的安装说明\n    * 添加新版本论文的链接\n    * 明确说明如何使用预训练模型","2018-07-06T10:11:09"]