Comparison between KNN, W-KNN, Wc-KNN and Wk-KNN models on a CDC heart disease dataset | Research Square window.SnipcartSettings = { analytics: { enabled: false } }; (function() { var accessVector = localStorage.getItem('access_vector') || ''; window.dataLayer = window.dataLayer || []; if (accessVector) { window.dataLayer.push({ user: { profile: { profileInfo: { snid: accessVector } } } }); } })(); (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','GTM-K279D39R'); Browse Preprints In Review Journals COVID-19 Preprints AJE Video Bytes Research Tools Research Promotion AJE Professional Editing AJE Rubriq About Preprint Platform In Review Editorial Policies Our Team Advisory Board Help Center Sign In Submit a Preprint Cite Share Download PDF Research Article Comparison between KNN, W-KNN, Wc-KNN and Wk-KNN models on a CDC heart disease dataset André Fix Ventura This is a preprint; it has not been peer reviewed by a journal. https://doi.org/ 10.21203/rs.3.rs-4505140/v1 This work is licensed under a CC BY 4.0 License Status: Posted Version 1 posted You are reading this latest preprint version Abstract One of the most popular and fundamental methods used for machine learning classification is KNN (K-nearest neighbor). Despite its simplicity, this method can achieve good data classification results even without prior knowledge of the data distribution. WKNN (weighted KNN) is an improvement of KNN where, instead of merely counting the number of nearby neighbors, the system assigns a weight to each neighbor. Typically, this weight is defined by the inverse of the squared distance ( \(weight=\frac{1}{{d}^{2}}\) ). This study aims to present an alternative way to define the weight ( \(weight=\frac{wp}{1+{\left|cd\right|}^{n}}\) ) and a methodology in which the weight formula is defined based on the position and the training data. It was found that, in this dataset, the presented methodology achieves results that are 9% better than KNN and 8% better than WKNN. Artificial Intelligence and Machine Learning KNN WKNN WkKNN Machine Learning Multi-class Multi-label Full Text Additional Declarations The authors declare no competing interests. Cite Share Download PDF Status: Posted Version 1 posted You are reading this latest preprint version Research Square lets you share your work early, gain feedback from the community, and start making changes to your manuscript prior to peer review in a journal. As a division of Research Square Company, we’re committed to making research communication faster, fairer, and more useful. We do this by developing innovative software and high quality services for the global research community. Our growing team is made up of researchers and industry professionals working together to solve the most critical problems facing scientific publishing. Also discoverable on Platform About Our Team In Review Editorial Policies Advisory Board Help Center Resources Author Services Accessibility API Access RSS feed Manage Cookie Preferences © Research Square 2026 | ISSN 2693-5015 (online) Privacy Policy Terms of Service Do Not Sell My Personal Information {"props":{"pageProps":{"initialData":{"identity":"rs-4505140","acceptedTermsAndConditions":true,"allowDirectSubmit":true,"archivedVersions":[],"articleType":"Research Article","associatedPublications":[],"authors":[{"id":308828331,"identity":"3012e573-9521-420b-80b4-c653433f9da3","order_by":0,"name":"André Fix Ventura","email":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZAAAAAyAQMAAABI0h/eAAAABlBMVEX///8AAABVwtN+AAAACXBIWXMAAA7EAAAOxAGVKw4bAAABCElEQVRIiWNgGAWjYHACAwYGGwk4Tw5EHHhAUEsaWAtjA5AwBmtJIKyFAa4lEUQw4NPCP7t524cPCRaJG473Hn/Mu8cufX7Y4YdAW+zkdBuwa5G4c6x45owECWODM+cSm3meJeduvJ1mANSSbGx2AIc1N3KMmXl/SMhJzsgxbOY5wJy7cXYCSMuBxG04tMiDtPxJkOCRnP8GpKU+3XB2+ge8WgxAWhgSJOT4JXhAWg4nyEvn4LfF8EZaMWMP0C/8PDmGM+ccOG64QTqn4ECCAW6/yN1I3szwI6EusY39jMGHNweq5eVnp2/+8KHCTg6n9zGdClZpQKxyEJBvIEX1KBgFo2AUjAQAAEggYHRRTKxvAAAAAElFTkSuQmCC","orcid":"","institution":"Efix","correspondingAuthor":true,"prefix":"","firstName":"André","middleName":"Fix","lastName":"Ventura","suffix":""}],"badges":[],"createdAt":"2024-05-30 21:20:45","currentVersionCode":1,"declarations":{"humanSubjects":false,"vertebrateSubjects":false,"conflictsOfInterestStatement":false,"humanSubjectEthicalGuidelines":false,"humanSubjectConsent":false,"humanSubjectClinicalTrial":false,"humanSubjectCaseReport":false,"vertebrateSubjectEthicalGuidelines":false},"doi":"10.21203/rs.3.rs-4505140/v1","doiUrl":"https://doi.org/10.21203/rs.3.rs-4505140/v1","draftVersion":[],"editorialEvents":[],"editorialNote":"","failedWorkflow":false,"files":[{"id":57586611,"identity":"ed5ea2b8-d839-45d5-a73e-54087d64c3d8","added_by":"auto","created_at":"2024-06-03 03:40:29","extension":"pdf","order_by":1,"title":"","display":"","copyAsset":false,"role":"manuscript-pdf","size":490882,"visible":true,"origin":"","legend":"","description":"","filename":"WkKNN.pdf","url":"https://assets-eu.researchsquare.com/files/rs-4505140/v1_covered_f237577d-0b66-40d4-8c7c-7abe08321796.pdf"}],"financialInterests":"The authors declare no competing interests.","formattedTitle":"\u003cp\u003eComparison between KNN, W-KNN, Wc-KNN and Wk-KNN models on a CDC heart disease dataset\u003c/p\u003e","fulltext":[],"fulltextSource":"","fullText":"","funders":[],"hasAdminPriorityOnWorkflow":false,"hasManuscriptDocX":false,"hasOptedInToPreprint":true,"hasPassedJournalQc":"","hasAnyPriority":true,"hideJournal":true,"highlight":"","institution":"Efix (Brazil)","isAcceptedByJournal":false,"isAuthorSuppliedPdf":true,"isDeskRejected":"","isHiddenFromSearch":false,"isInQc":false,"isInWorkflow":true,"isPdf":true,"isPdfUpToDate":true,"isWithdrawnOrRetracted":false,"journal":{"display":true,"email":"
[email protected]","identity":"researchsquare","isNatureJournal":false,"hasQc":true,"allowDirectSubmit":true,"externalIdentity":"","sideBox":"","snPcode":"","submissionUrl":"/submission","title":"Research Square","twitterHandle":"researchsquare","acdcEnabled":true,"dfaEnabled":false,"editorialSystem":"","reportingPortfolio":"","inReviewEnabled":false,"inReviewRevisionsEnabled":true},"keywords":"KNN, WKNN, WkKNN, Machine Learning, Multi-class, Multi-label","lastPublishedDoi":"10.21203/rs.3.rs-4505140/v1","lastPublishedDoiUrl":"https://doi.org/10.21203/rs.3.rs-4505140/v1","license":{"name":"CC BY 4.0","url":"https://creativecommons.org/licenses/by/4.0/"},"manuscriptAbstract":"\u003cp\u003eOne of the most popular and fundamental methods used for machine learning classification is KNN (K-nearest neighbor). Despite its simplicity, this method can achieve good data classification results even without prior knowledge of the data distribution. WKNN (weighted KNN) is an improvement of KNN where, instead of merely counting the number of nearby neighbors, the system assigns a weight to each neighbor. Typically, this weight is defined by the inverse of the squared distance (\u003cspan class=\"InlineEquation\"\u003e\u003cspan class=\"mathinline\"\u003e\\(weight=\\frac{1}{{d}^{2}}\\)\u003c/span\u003e\u003c/span\u003e). This study aims to present an alternative way to define the weight (\u003cspan class=\"InlineEquation\"\u003e\u003cspan class=\"mathinline\"\u003e\\(weight=\\frac{wp}{1+{\\left|cd\\right|}^{n}}\\)\u003c/span\u003e\u003c/span\u003e) and a methodology in which the weight formula is defined based on the position and the training data. It was found that, in this dataset, the presented methodology achieves results that are 9% better than KNN and 8% better than WKNN.\u003c/p\u003e","manuscriptTitle":"Comparison between KNN, W-KNN, Wc-KNN and Wk-KNN models on a CDC heart disease dataset","msid":"","msnumber":"","nonDraftVersions":[{"code":1,"date":"2024-06-03 03:32:22","doi":"10.21203/rs.3.rs-4505140/v1","editorialEvents":[{"type":"communityComments","content":0}],"status":"published","journal":{"display":true,"email":"
[email protected]","identity":"researchsquare","isNatureJournal":false,"hasQc":true,"allowDirectSubmit":true,"externalIdentity":"","sideBox":"","snPcode":"","submissionUrl":"/submission","title":"Research Square","twitterHandle":"researchsquare","acdcEnabled":true,"dfaEnabled":false,"editorialSystem":"","reportingPortfolio":"","inReviewEnabled":false,"inReviewRevisionsEnabled":true}}],"origin":"","ownerIdentity":"c41c6669-85b2-45a8-acd5-60bbe7c110bc","owner":[],"postedDate":"June 3rd, 2024","published":true,"recentEditorialEvents":[],"rejectedJournal":[],"revision":"","amendment":"","status":"posted","subjectAreas":[{"id":32629362,"name":"Artificial Intelligence and Machine Learning"}],"tags":[],"updatedAt":"2024-06-03T03:32:22+00:00","versionOfRecord":[],"versionCreatedAt":"2024-06-03 03:32:22","video":"","vorDoi":"","vorDoiUrl":"","workflowStages":[]},"version":"v1","identity":"rs-4505140","journalConfig":"researchsquare"},"__N_SSP":true},"page":"/article/[identity]/[[...version]]","query":{"redirect":"/article/rs-4505140","identity":"rs-4505140","version":["v1"]},"buildId":"qtupq5eGEP_6zYnWcrvyt","isFallback":false,"isExperimentalCompile":false,"dynamicIds":[84888],"gssp":true,"scriptLoader":[]}
Text is read by the "Ask this paper" AI Q&A widget below.
Extraction quality varies by source — PMC NXML preserves structure
cleanly, OA-HTML may include some navigation residue, and OA-PDF can
have broken hyphenation. The publisher copy
(via DOI)
is the canonical version.