View full-text article in PMC PeerJ Comput Sci. 2023 Oct 12;9:e1626. doi: 10.7717/peerj-cs.1626 Search in PMC Search in PubMed View in NLM Catalog Add to search Copyright and License information © 2023 R. and P. This is an open access article distributed under the terms of the Creative Commons Attribution License, which permits unrestricted use, distribution, reproduction and adaptation in any medium and for any purpose provided that it is properly attributed. For attribution, the original author(s), title, publication source (PeerJ Computer Science) and either DOI or URL of the article must be cited. PMC Copyright notice Algorithm 5. Heart disease prediction using Gaussian Naïve Bayes. Input: EHR Data Output: Boolean Status asyncpredictHeartDisease(patientData){ constpredictorVariables[]={patientData.age,patientData.sex,patientData.cp,patientData.trestbps,patientData.chol,patientData.fbs,patientData.restecg,patientData.thalach,patientData.exang,patientData.oldpeak,patientData.slope,patientData.ca,patientData.thal}; constXTrain,YTrain = train_test_split(data,analyzevalue,proximatevalue) let Ytrain = Xtrain.map((item)=>item["target"]); letYtest=Xtest.map((item)=>item["target"]); varmodX_Train=[], modX_Test=[]; CXTrain.forEach((key)=>{xTra.push(Xtrain[i][key]);}); modX_Train.push(xTra); model=newGuassianNB() model.train(XTrain,Ytrain); letprediction=model.predict(modX_Test); result=prediction; return result; }