Skip to main content

Probabilistic Symptom Graph

pip install probabilistic-symptom-graph
from src.ProbabilisticSymptomGraph import ProbabilisticSymptomConditionGraph

import networkx as nx
import numpy as np

medical_condition_gexf = "./data/medical-condition-symptom-graph.gexf"
graph = nx.read_gexf(medical_condition_gexf)
sim_matrix = np.load('./data/md-symptom-sim-mat.npy')

symptom_names = []
for node_id, tpe in graph.nodes(data="type"):
    if tpe == "Symptom":
        symptom_names.append(node_id)
symptom_names = sorted(symptom_names)

condition_names = []
for node_id, tpe in graph.nodes(data="type"):
    if tpe == "MedicalCondition":
        condition_names.append(node_id)
condition_names = sorted(condition_names)

probabilistic_graph = ProbabilisticSymptomConditionGraph(condition_names, symptom_names, graph, sim_matrix)
print(" | ".join(probabilistic_graph.get_all_symptoms()[:10]))
probabilistic_graph.get_condition_probs(["acne"])[:5]

Graph Image

Red nodes represent medical conditions and green nodes represent symptoms. image This graph data was gathered by mining Wikipedia "Medical Condition (New)" infoboxes and extracting medical condition <=> Symptom pairs. Post processing was done using ChatGPT.

Data Mining

See ./data/WikipediaSymptomExtractor.ipynb

Release files for probabilistic-symptom-graph 1.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for probabilistic-symptom-graph 1.0.3
File Size Uploaded
probabilistic-symptom-graph-1.0.3.tar.gz 3.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for probabilistic-symptom-graph 1.0.3
File Interpreter ABI Platform
probabilistic_symptom_graph-1.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 8.8 kB

Release files / probabilistic-symptom-graph-1.0.3.tar.gz

Download URL probabilistic-symptom-graph-1.0.3.tar.gz
Size 3.9 kB
Tags Source
SHA-256 checksum
How to use checksums
8ae051f049796daede0327cb3235fe0e1c4a03296843e1ee027aa24848888ac3
BLAKE2b-256 checksum
How to use checksums
8d45b7542d976f10ce4a17d285e3b1e432580f0115807a37688e321fa17e91f7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.4

Release files / probabilistic_symptom_graph-1.0.3-py3-none-any.whl

Download URL probabilistic_symptom_graph-1.0.3-py3-none-any.whl
Size 5.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b18d9c6da5d3c1ae11ac5f07877ea42a114d14055af7546e6157a70ee42d5881
BLAKE2b-256 checksum
How to use checksums
f0c09bcaff60982a33defaedc871d813279feea1c2f3f2a24179c3b751caea16
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.4

Release history Release notifications | RSS feed

This release

1.0.3 This release

2 release files

1.0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page