{"id":20163348,"url":"https://github.com/ronlee12355/multi-label-knn","last_synced_at":"2025-10-11T06:33:23.096Z","repository":{"id":161452596,"uuid":"186078408","full_name":"Ronlee12355/Multi-Label-KNN","owner":"Ronlee12355","description":"Using Multi-Label KNN to predict drug activity","archived":false,"fork":false,"pushed_at":"2019-09-27T04:09:48.000Z","size":3390,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-03T03:12:04.077Z","etag":null,"topics":["drug-discovery","drug-repurposing","drug-targets","machine-learning","multi-label-classification","multi-label-knn"],"latest_commit_sha":null,"homepage":"","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Ronlee12355.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-05-11T02:28:31.000Z","updated_at":"2022-01-11T13:36:48.000Z","dependencies_parsed_at":null,"dependency_job_id":"ede83005-1d05-49a1-b2e2-d257bec67cf7","html_url":"https://github.com/Ronlee12355/Multi-Label-KNN","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Ronlee12355/Multi-Label-KNN","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ronlee12355%2FMulti-Label-KNN","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ronlee12355%2FMulti-Label-KNN/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ronlee12355%2FMulti-Label-KNN/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ronlee12355%2FMulti-Label-KNN/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ronlee12355","download_url":"https://codeload.github.com/Ronlee12355/Multi-Label-KNN/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ronlee12355%2FMulti-Label-KNN/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279006456,"owners_count":26084108,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-11T02:00:06.511Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["drug-discovery","drug-repurposing","drug-targets","machine-learning","multi-label-classification","multi-label-knn"],"created_at":"2024-11-14T00:29:10.480Z","updated_at":"2025-10-11T06:33:23.082Z","avatar_url":"https://github.com/Ronlee12355.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Multi-Label-KNN\n\n## Introduction\n\nMulti-label learning originated from the investigation of text categorization problem, where each document may belong to several predefined topics simultaneously. In multi-label learning, the training set is composed of instances each associated with a set of labels, and the task is to predict the label sets of unseen instances through analyzing training instances with known label sets.  \n\nThis algorithm is created by Min-Ling Zhang, Zhi-Hua Zhou in Nanjing University in 2007, Our group use it to predict drug activity and our paper is published in *Front. Genet.*, DOI: 10.3389/fgene.2019.00474. We also make a online [website](http://zhanglab.hzau.edu.cn) which enables you to predict your drugs' activity for a single one or in batch.\n\nIn this repo, a R-version MLKNN algorithm which specificlly focuses on drug prediction is provided and the original paper  can be found in this repo too.\n\n## Keywords\n\nMachine learning; Multi-label learning; Lazy learning; K-nearest neighbor; Drug activity prediction;\n\n## How it works\n\n![How the algorithm works](png/MLKNN.png)\n\n## Pseudo-Code\n\n![pseudo code](png/code.png)\n\n## About the R codes\n\n**MLKNN.R**: Main program to compute probabilities.\n\n**cv.MLKNN.R**: Performing cross validation on dataset.\n   \n**HammingLoss.R**: *Hamming loss*: evaluates how many times an instance– label pair is misclassified, i.e. a label not belonging to the in- stance is predicted or a label belonging to the instance is not predicted.    \n\n**AveragePrecision.R**: *Average precision*: evaluates the average fraction of labels ranked above a particular label y ∈ *Y* which actually are in *Y*.   \n\n**Coverage.R**: *Coverage*: evaluates how far we need, on the average, to go down the list of labels in order to cover all the proper labels of the instance.    \n\n**OneError.R**: *One-error*: evaluates how many times the top-ranked label is not in the set of proper labels of the instance.     \n\n**RankingLoss.R**: *Ranking loss*: evaluates the average fraction of label pairs that are reversely ordered for the instance.   \n\n\n## The Original Paper\n\n[https://cs.nju.edu.cn/zhouzh/zhouzh.files/publication/pr07.pdf](https://cs.nju.edu.cn/zhouzh/zhouzh.files/publication/pr07.pdf) \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fronlee12355%2Fmulti-label-knn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fronlee12355%2Fmulti-label-knn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fronlee12355%2Fmulti-label-knn/lists"}