Code Monkey home page Code Monkey logo

Comments (2)

alexanderkuvaev avatar alexanderkuvaev commented on June 4, 2024 2

Hi!
The predicted annotations are stored in the batch component, specified in the annot argument of the hmm_predict_pipeline function. It is hmm_annotation in your case:

ECG_MASK = "../cardio/tests/data/A*.hea"  # specify a path to your signals here
MODEL_PATH = "./hmm_model.dill"  # specify a path to your model here

eds = EcgDataset(path=ECG_MASK, no_ext=True, sort=True)
pipeline = eds >> hmm_predict_pipeline(MODEL_PATH, annot="hmm_annotation")
batch = pipeline.next_batch()
batch.show_ecg("A00001", start=0, end=5, annot="hmm_annotation")
print(batch.hmm_annotation)

These printed annotations match the lengths of the corresponding input signals and contain predicted HMM states. Additionally, the pipeline calculates median lengths of PQ, QT and QRS intervals along with their borders and the heart rate value based on these annotations and stores them in the meta component:

META_KEYS = ["hr", "pq", "qt", "qrs", "qrs_segments", "p_segments", "t_segments"]
signal_meta = batch["A00001"].meta
print({key: signal_meta[key] for key in META_KEYS})

from cardio.

Yang-LONG avatar Yang-LONG commented on June 4, 2024

Yeah, it's solved! Thank you soooo much!:)

from cardio.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.