OSCR

Machine Learning-Based Magnetocardiography Model Aids in Diagnosing Non-ST-Segment Elevation Acute Coronary Syndrome in Acute Chest Pain.

Code ↔ Paper

3 matches between paragraphs of the paper and lines of its authors' code, computed by the harvester (lexical-v1). Click a colored paragraph or line to see its counterpart.

The 3 matches
  1. [1] § RESULTS › SVM model explanation ↔ 123.py, lines 150–256 · score 0.86 · cha_31_ST_score, cha_12_T_amp, cha_14_T_amp, cha_25_T_amp, cha_31_T_amp, cha_6_T_amp
  2. [2] § RESULTS › SVM model explanation ↔ 123.py, lines 150–256 · score 0.84 · cha_12_T_amp, cha_14_T_amp, cha_25_T_amp, cha_31_T_amp, cha_6_T_amp, T_negi_circ
  3. [3] § MATERIALS AND METHODS › MCG parameters extraction ↔ 123.py, lines 75–81 · score 0.53 · T_negi_circ, T_posi_circ, T_min_mag, amp, score

Paper

Loaded from Europe PMC by your browser, not stored by OSCR: doi.org · Europe PMC

The paper is loaded when this pane is shown.

The authors' code

Python · 261 lines · 8.9 KB · no license · 3 matches

  1. import streamlit as st
  2. import numpy as np
  3. import pandas as pd
  4. import joblib
  5. from sklearn.preprocessing import StandardScaler
  6. import warnings
  7. warnings.filterwarnings('ignore')
  8. # ==================== 页面基础配置(匹配示例界面) ====================
  9. st.set_page_config(
  10. page_title="SVM Clinical Predictive Calculator for NSTE-ACS",
  11. page_icon="🧮",
  12. layout="centered", # 紧凑布局,与示例一致
  13. initial_sidebar_state="collapsed" # 隐藏侧边栏
  14. )
  15. # ==================== 样式配置(完全匹配示例界面风格) ====================
  16. st.markdown("""
  17. <style>
  18. /* 全局样式 */
  19. body {
  20. font-family: 'Arial', sans-serif;
  21. color: #333333;
  22. background-color: #f8f9fa;
  23. }
  24. /* 主标题 */
  25. .main-title {
  26. font-size: 28px;
  27. font-weight: bold;
  28. color: #333333;
  29. margin-bottom: 15px;
  30. text-align: left;
  31. }
  32. /* 子标题 */
  33. .sub-title {
  34. font-size: 18px;
  35. font-weight: 600;
  36. color: #333333;
  37. margin-top: 25px;
  38. margin-bottom: 20px;
  39. }
  40. /* 输入框标签 */
  41. div[data-testid="stNumberInput"] label {
  42. font-size: 13px;
  43. color: #555555;
  44. font-weight: 500;
  45. }
  46. /* 按钮样式(匹配示例的蓝色按钮) */
  47. .stButton>button {
  48. background-color: #0066cc;
  49. color: white;
  50. border-radius: 4px;
  51. padding: 8px 24px;
  52. font-size: 14px;
  53. border: none;
  54. margin-top: 10px;
  55. }
  56. .stButton>button:hover {
  57. background-color: #0052a3;
  58. }
  59. /* 结果指标样式 */
  60. div[data-testid="stMetricValue"] {
  61. font-size: 24px;
  62. font-weight: bold;
  63. color: #0066cc;
  64. }
  65. div[data-testid="stMetricLabel"] {
  66. font-size: 14px;
  67. color: #666666;
  68. }
  69. </style>
  70. """, unsafe_allow_html=True)
  71. # ==================== 核心参数定义(你的9个特征) ====================
  72. # 特征列表(固定9个)
  73. FEATURES = [
  74. "T_min_mag", "cha_31_T_amp", "cha_12_T_amp",
  75. "cha_25_T_amp", "cha_6_T_amp", "cha_14_T_amp",
  76. "cha_31_ST_score", "T_posi_circ", "T_negi_circ"
  77. ]
  78. # 特征显示名称(与你的变量名一致)
  79. FEATURE_DISPLAY = {
  80. "T_min_mag": "T_min_mag",
  81. "cha_31_T_amp": "cha_31_T_amp",
  82. "cha_12_T_amp": "cha_12_T_amp",
  83. "cha_25_T_amp": "cha_25_T_amp",
  84. "cha_6_T_amp": "cha_6_T_amp",
  85. "cha_14_T_amp": "cha_14_T_amp",
  86. "cha_31_ST_score": "cha_31_ST_score",
  87. "T_posi_circ": "T_posi_circ",
  88. "T_negi_circ": "T_negi_circ"
  89. }
  90. # 特征参考范围(可根据你的论文数据调整)
  91. FEATURE_RANGES = {
  92. "T_min_mag": (-5.0, 5.0),
  93. "cha_31_T_amp": (0.0, 10.0),
  94. "cha_12_T_amp": (0.0, 10.0),
  95. "cha_25_T_amp": (0.0, 10.0),
  96. "cha_6_T_amp": (0.0, 10.0),
  97. "cha_14_T_amp": (0.0, 10.0),
  98. "cha_31_ST_score": (0.0, 5.0),
  99. "T_posi_circ": (0.0, 20.0),
  100. "T_negi_circ": (-20.0, 0.0)
  101. }
  102. # ==================== 加载模型和标准化器 ====================
  103. @st.cache_resource
  104. def load_model_and_scaler():
  105. """加载预训练SVM模型和标准化器"""
  106. try:
  107. # 加载你的SVM模型
  108. model = joblib.load("./final_SVM_model.pkl")
  109. # 加载训练时保存的标准化器(必须替换为你自己的scaler.pkl)
  110. # 如果还没保存scaler,先运行训练代码保存,再取消下面注释
  111. scaler = joblib.load("./final_scaler.pkl")
  112. # 临时方案:若未保存scaler,用示例值(需替换为训练集真实均值/标准差)
  113. scaler = StandardScaler()
  114. # 请替换为你训练集的真实均值(示例值,仅临时用)
  115. scaler.mean_ = np.array([0.1, 2.3, 1.8, 2.1, 1.5, 1.7, 0.9, 8.5, -7.2])
  116. # 请替换为你训练集的真实标准差(示例值,仅临时用)
  117. scaler.scale_ = np.array([0.7, 1.1, 1.0, 1.2, 0.8, 0.9, 0.4, 3.2, 2.8])
  118. return model, scaler
  119. except FileNotFoundError:
  120. st.error("❌ 模型文件未找到,请检查路径:D:\\AApython\\final_SVM_model.pkl")
  121. st.stop()
  122. except Exception as e:
  123. st.error(f"❌ 模型加载失败:{str(e)}")
  124. st.stop()
  125. # ==================== 预测函数 ====================
  126. def predict_probability(model, scaler, feature_values):
  127. """基于9个特征预测概率(适配SVM模型)"""
  128. # 标准化输入特征
  129. features_array = np.array(feature_values).reshape(1, -1)
  130. features_scaled = scaler.transform(features_array)
  131. # SVM预测概率(确保训练时设置了probability=True)
  132. prob = model.predict_proba(features_scaled)[0, 1]
  133. return prob
  134. # ==================== 主页面构建(完全匹配附图界面) ====================
  135. def main():
  136. # 加载模型和标准化器
  137. model, scaler = load_model_and_scaler()
  138. # 页面标题(与示例一致的风格)
  139. st.markdown('<div class="main-title">SVM Clinical Predictive Calculator for NSTE-ACS</div>', unsafe_allow_html=True)
  140. st.divider()
  141. # 输入变量标题
  142. st.markdown('<div class="sub-title">Input Variables</div>', unsafe_allow_html=True)
  143. # 3列布局(9个特征均分,与附图一致)
  144. col1, col2, col3 = st.columns(3, gap="medium")
  145. feature_values = []
  146. # 第一列:3个特征
  147. with col1:
  148. for feat in FEATURES[0:3]: # T_min_mag, cha_31_T_amp, cha_12_T_amp
  149. min_val, max_val = FEATURE_RANGES[feat]
  150. val = st.number_input(
  151. label=FEATURE_DISPLAY[feat],
  152. min_value=float(min_val),
  153. max_value=float(max_val),
  154. value=float((min_val + max_val) / 2), # 默认值为范围中间值
  155. step=0.1,
  156. key=f"feat_{feat}",
  157. help=f"Reference range: {min_val} to {max_val}" # 帮助提示(❓图标)
  158. )
  159. feature_values.append(val)
  160. # 第二列:3个特征
  161. with col2:
  162. for feat in FEATURES[3:6]: # cha_25_T_amp, cha_6_T_amp, cha_14_T_amp
  163. min_val, max_val = FEATURE_RANGES[feat]
  164. val = st.number_input(
  165. label=FEATURE_DISPLAY[feat],
  166. min_value=float(min_val),
  167. max_value=float(max_val),
  168. value=float((min_val + max_val) / 2),
  169. step=0.1,
  170. key=f"feat_{feat}",
  171. help=f"Reference range: {min_val} to {max_val}"
  172. )
  173. feature_values.append(val)
  174. # 第三列:3个特征
  175. with col3:
  176. for feat in FEATURES[6:9]: # cha_31_ST_score, T_posi_circ, T_negi_circ
  177. min_val, max_val = FEATURE_RANGES[feat]
  178. val = st.number_input(
  179. label=FEATURE_DISPLAY[feat],
  180. min_value=float(min_val),
  181. max_value=float(max_val),
  182. value=float((min_val + max_val) / 2),
  183. step=0.1,
  184. key=f"feat_{feat}",
  185. help=f"Reference range: {min_val} to {max_val}"
  186. )
  187. feature_values.append(val)
  188. # 预测按钮(与示例一致的位置和样式)
  189. predict_btn = st.button("Calculate Prediction", type="primary")
  190. # 预测结果展示(匹配示例的结果样式)
  191. if predict_btn:
  192. st.markdown("<br>", unsafe_allow_html=True)
  193. st.divider()
  194. st.markdown('<div class="sub-title">Prediction Result</div>', unsafe_allow_html=True)
  195. # 计算预测概率
  196. prob = predict_probability(model, scaler, feature_values)
  197. # 显示核心概率结果
  198. st.metric(
  199. label="Predicted Probability",
  200. value=f"{prob:.3f} ({prob * 100:.1f}%)"
  201. )
  202. # 风险等级提示
  203. if prob >= 0.5:
  204. st.warning(f"⚠️ High Risk - Probability: {prob * 100:.1f}%")
  205. else:
  206. st.success(f"✅ Low Risk - Probability: {prob * 100:.1f}%")
  207. # 下载功能(与示例一致)
  208. st.markdown("<br>", unsafe_allow_html=True)
  209. if st.button("Download Input & Result (CSV)"):
  210. # 生成包含输入和结果的CSV
  211. input_df = pd.DataFrame({
  212. "Feature": FEATURES,
  213. "Input_Value": feature_values
  214. })
  215. # 如果已预测,添加结果列
  216. if predict_btn:
  217. input_df.loc[len(input_df)] = ["Predicted_Probability", f"{prob:.3f}"]
  218. input_df.loc[len(input_df)] = ["Risk_Level", "High" if prob >= 0.5 else "Low"]
  219. # 生成CSV文件
  220. csv_data = input_df.to_csv(index=False, encoding="utf-8")
  221. st.download_button(
  222. label="Confirm Download",
  223. data=csv_data,
  224. file_name="svm_calculator_result.csv",
  225. mime="text/csv",
  226. key="download_btn"
  227. )
  228. # ==================== 执行主函数 ====================
  229. if __name__ == "__main__":
  230. main()

123.py at commit 0cb6906, no license · at the source

Overview

Authors: Junting Li1,2,3, Yuheng Zhou1,2,3, Ruizhe Wang1,2,3, Jiaojiao Pang3,4, Min Xiang2,3,5,6,7,8,9, Xiaolin Ning1
  1. Beihang University School of Instrumentation and Optoelectronic Engineering, Beijing, China
  2. Key Laboratory of Ultra-Weak Magnetic Field Measurement Technology, Ministry of Education, Beihang University School of Instrumentation and Optoelectronic Engineering, Beijing, China
  3. National Innovation Platform for Industry-Education Integration in Medicine-Engineering Interdisciplinary, Shandong Key Laboratory for Magnetic Field-free Medicine and Functional Imaging, Research Institute of Shandong University, Jinan, China
  4. Department of Emergency Medicine, Shandong Provincial Clinical Research Center for Emergency and Critical Care Medicine, Qilu Hospital of Shandong University, Jinan, China
  5. State Key Laboratory of Traditional Chinese Medicine Syndrome, National Institute of Extremely-weak Magnetic Field Infrastructure, Hangzhou, China
  6. Zhejiang Provincial Key Laboratory of Ultra-Weak Magnetic-Field Space and Applied Technology, Hangzhou, China
  7. Zhejiang Key Laboratory of Zero Magnetic Medicine, Hangzhou, China
  8. Hefei National Laboratory, Hefei, China
  9. Hangzhou Lingci Medical Equipment Co. Ltd, Hangzhou, China
Institutions: Shandong University (China); Beihang University (China)
Journal: Balkan medical journal, volume 43, issue 8, pages 460-470
Dates: received 2 February 2026; accepted 2 April 2026; published online 31 July 2026; in print July 2026
Type: Research article · Language: English
License: CC BY-NC-ND
Identifiers: DOI 10.4274/balkanmedj.galenos.2026.2026-1-319 · PMID 42026911 · PMCID PMC13425047 · OpenAlex W7155515123
Open access: diamond, a free copy (OpenAlex)
Status: code verified
Categories: human (organism), pain (population), clinical / translational (subfield)
Methods: Statistics, Machine learning, Preprocessing
MeSH: Acute Coronary Syndrome*, Chest Pain*, Machine Learning*, Magnetocardiography*, Aged, Area Under Curve, Cohort Studies, Female, Humans, Male, Middle Aged, Retrospective Studies (* major topic)
Topic: Atomic and Subatomic Physics Research (Atomic and Molecular Physics, and Optics, Physics and Astronomy), according to OpenAlex
Funding: National Natural Science Foundation of China (2021ZD0300503, U23A20485); Ministry of Education of the People's Republic of China (JYB2025XDXM606); Fundamental Research Funds for the Central Universities (2021ZD0300503)
Citations: not cited yet (Europe PMC); 27 references in the paper

Abstract

The abstract is not reproduced here: the paper's license (CC BY-NC-ND) does not allow it. Read it in the paper, at the publisher or on Europe PMC.

Repositories

Its files are read in the Code ↔ Paper reader above, with 3 matches between paragraphs and lines of code.

svm-clinical-calculator-p97ioydfedimtbpfsjdqfp.streamlit.app

License: none: the authors keep all their rights
State: the link answers, verified on 30 September 2026
Evidence: the link answers
Software Heritage: not checked
Found in: the text, “Model performance”
Not found: README, license file, CITATION.cff, environment file, tests, continuous integration, documentation
Availability: 1 check, the latest on 30 September 2026: the link answers (HTTP 200)
  • 30 September 2026: the link answers (HTTP 200)

ljting658/svm-clinical-calculator

License: none: the authors keep all their rights
State: the link answers, verified on 30 September 2026
Evidence: files inventoried
Commit: 0cb69069696932048f1f39a7148f87d1d7be500d, 17 February 2026
Languages: Python (1)
Size: 5 files, 1 script
Software Heritage: not archived
Found in: the text, “Model performance”
Holds: README, environment (requirements.txt)
Not found: license file, CITATION.cff, tests, continuous integration, documentation
Tools: NumPy (1 file), pandas (1 file), scikit-learn (1 file)
Availability: 1 check, the latest on 30 September 2026: the link answers
  • 30 September 2026: the link answers
2 files

Tracing map

Proposed by the machine: these links were found in the paper and verified at the source, without human review. The map will receive a Zenodo DOI once one of the paper's authors has validated it with their ORCID.

What the map holds:

  • 2 repositories of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
  • 1 script, each with its path and the digest of its content;
  • 3 matches between paragraphs of the paper and lines of the code (method lexical-v1);
  • neither the text of the paper nor the code itself.

Its JSON (tracing-map.json) is deposited on Zenodo with its DOI once the map is validated.

Data

No dataset and no data link were found in the paper.

Versions

The history of this record: each version stored by the harvester or made by a correction of its authors or of the maintainers of its code, and what changed in its facts. The texts of the paper (its abstract, its availability statements) are not part of it; versions that changed only those are not listed.

Version 1, 30 September 2026: the first record

Recorded: type, language, journal, volume, issue, pages, dates, 6 authors, 12 MeSH terms, 3 funders, 27 references.

Cite

This paper

Li, J., Zhou, Y., Wang, R., Pang, J., Xiang, M., & Ning, X. (2026). Machine Learning-Based Magnetocardiography Model Aids in Diagnosing Non-ST-Segment Elevation Acute Coronary Syndrome in Acute Chest Pain. Balkan medical journal, 43(8), 460-470. https://doi.org/10.4274/balkanmedj.galenos.2026.2026-1-319

BibTeX

@article{li2026machine,
author = {Li, Junting and Zhou, Yuheng and Wang, Ruizhe and Pang, Jiaojiao and Xiang, Min and Ning, Xiaolin},
title = {{Machine Learning-Based Magnetocardiography Model Aids in Diagnosing Non-ST-Segment Elevation Acute Coronary Syndrome in Acute Chest Pain}},
journal = {Balkan medical journal},
year = {2026},
month = apr,
volume = {43},
number = {8},
pages = {460--470},
publisher = {Trakya University Faculty of Medicine},
issn = {2146-3123},
doi = {10.4274/balkanmedj.galenos.2026.2026-1-319},
url = {https://doi.org/10.4274/balkanmedj.galenos.2026.2026-1-319},
pmid = {42026911},
pmcid = {PMC13425047}
}

RIS

TY - JOUR
AU - Li, Junting
AU - Zhou, Yuheng
AU - Wang, Ruizhe
AU - Pang, Jiaojiao
AU - Xiang, Min
AU - Ning, Xiaolin
TI - Machine Learning-Based Magnetocardiography Model Aids in Diagnosing Non-ST-Segment Elevation Acute Coronary Syndrome in Acute Chest Pain
T2 - Balkan medical journal
J2 - Balkan Med J
PY - 2026
DA - 2026/04/24
VL - 43
IS - 8
SP - 460
EP - 470
SN - 2146-3123
PB - Trakya University Faculty of Medicine
DO - 10.4274/balkanmedj.galenos.2026.2026-1-319
UR - https://doi.org/10.4274/balkanmedj.galenos.2026.2026-1-319
LA - en
ER -

CSL-JSON

{
"id": "10.4274/balkanmedj.galenos.2026.2026-1-319",
"type": "article-journal",
"title": "Machine Learning-Based Magnetocardiography Model Aids in Diagnosing Non-ST-Segment Elevation Acute Coronary Syndrome in Acute Chest Pain",
"container-title": "Balkan medical journal",
"author": [
{
"family": "Li",
"given": "Junting"
},
{
"family": "Zhou",
"given": "Yuheng"
},
{
"family": "Wang",
"given": "Ruizhe"
},
{
"family": "Pang",
"given": "Jiaojiao"
},
{
"family": "Xiang",
"given": "Min"
},
{
"family": "Ning",
"given": "Xiaolin"
}
],
"container-title-short": "Balkan Med J",
"volume": "43",
"issue": "8",
"page": "460-470",
"DOI": "10.4274/balkanmedj.galenos.2026.2026-1-319",
"PMID": "42026911",
"PMCID": "PMC13425047",
"ISSN": "2146-3123",
"publisher": "Trakya University Faculty of Medicine",
"URL": "https://doi.org/10.4274/balkanmedj.galenos.2026.2026-1-319",
"language": "en",
"issued": {
"date-parts": [
[
2026,
4,
24
]
]
}
}

The tracing map gets a citation of its own once an author has validated it and it has a DOI.

Similar papers

The papers with a page that share the most with this one: the tools found in their code, their categories, datasets, cited references and authors, the rarest counting most.

[1] doi:10.1016/j.isci.2026.115330
Passive OPM-MEG paradigm reveals altered brain network organization in children with DLD.
Journal: iScience
In common: author Xiaolin Ning
[2] doi:10.3390/biology15131028
Temporal Response Function-Driven Representational Similarity Analysis for Speech Perception Decoding with MEG and EEG.
Journal: Biology
In common: author Xiaolin Ning
[3] doi:10.1038/s41746-026-02778-0 [code]
Trust-gated synthetic EEG augmentation reduces performance drops when generalizing to new patients.
Journal: NPJ digital medicine
In common: scikit-learn, pandas, NumPy, pain, clinical / translational
[4] doi:10.1371/journal.pone.0354510 [code]
Personalized adaptive virtual reality experience driven by electroencephalography-based pain recognition.
Journal: PloS one
In common: scikit-learn, pandas, NumPy, pain
[5] doi:10.3390/bioengineering13080924 [code]
Deep Learning-Based Temporal Gait Analysis Using a Smartphone IMU in Older Adults with and Without Non-Specific Low Back Pain.
Journal: Bioengineering (Basel, Switzerland)
In common: scikit-learn, pandas, NumPy, pain
[6] doi:10.1038/s41467-026-75723-0 [code]
Spatial transcriptomics reveals distinct cell type dynamics following opioid dependence in female mice with the common human μ-opioid receptor variant Oprm1 A118G.
Journal: Nature communications
In common: scikit-learn, pandas, NumPy, pain
[7] doi:10.1038/s41467-026-74743-0 [code]
Meta-analytic evidence for distinct neural correlates of conditioned versus verbally induced placebo analgesia.
Journal: Nature communications
In common: scikit-learn, pandas, NumPy, pain
[8] doi:10.1016/j.xcrm.2026.102793 [code]
A predictive corticospinal model for pain perception.
Journal: Cell reports. Medicine
In common: scikit-learn, pandas, NumPy, pain
[9] doi:10.1038/s41467-026-73153-6 [code]
Latent neural architecture organising shared aesthetic evaluations of visual artworks.
Journal: Nature communications
In common: scikit-learn, pandas, NumPy, pain
[10] doi:10.1016/j.xcrm.2026.102800 [code]
Recombinant dimeric PICK1 peptide inhibitors for long-term relief of chronic pain by AAV therapeutics.
Journal: Cell reports. Medicine
In common: scikit-learn, pandas, NumPy, pain

Contribute

The authors of this paper can claim it, correct its record and validate its tracing map, and the maintainers of its code (its owner, or a public member of its organization) correct what it says of their repository; anyone signed in can ask for its removal. Every request goes to OSCR's own machine, which answers it; your account page follows them.

Sign in with ORCID to claim this paper as one of its authors, correct its record or validate its tracing map: when the paper's metadata lists your ORCID iD, you are recognized at once. Maintainers of its code: sign in with GitHub, then claim the repository on your account page.

Request its removal

To ask OSCR to remove this record, the copies of its authors' scripts or its tracing map, use the removal request page: signed in, you say who you are, what to remove and why, then review and confirm the request. Published rules decide every request (how).

Discussion, reproductions, activity

Discussion: questions and error reports about this paper and its code, from signed-in readers and its authors. It opens with sign-in.

Reproductions: reports from readers who ran the authors' code: what they reproduced, with which environment, commit and data. It opens with sign-in.

Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.