{"id":25909181,"url":"https://github.com/abhinav330/ml-implementation-on-classified-data","last_synced_at":"2026-06-11T07:31:44.129Z","repository":{"id":254764660,"uuid":"847472241","full_name":"Abhinav330/ML-implementation-on-Classified-data","owner":"Abhinav330","description":"This repository implements a K-Nearest Neighbors (KNN) model in Python for predicting loan defaults. It analyzes the KNN_Project_Data dataset (features \u0026 binary target 'TARGET CLASS').","archived":false,"fork":false,"pushed_at":"2024-08-31T02:47:52.000Z","size":4448,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-03T08:16:35.107Z","etag":null,"topics":["cluster-analysis","clustering","clustering-algorithm","data-science","datascience","knearest-neighbor-algorithm","knn","knn-classification","machine-learning","machine-learning-algorithms","machinelearning","sklearn","supervised-learning"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","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/Abhinav330.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":"2024-08-25T23:01:17.000Z","updated_at":"2024-08-31T02:47:55.000Z","dependencies_parsed_at":"2024-08-26T00:40:44.957Z","dependency_job_id":null,"html_url":"https://github.com/Abhinav330/ML-implementation-on-Classified-data","commit_stats":null,"previous_names":["abhinav330/ml-implementation-on-classified-data"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Abhinav330/ML-implementation-on-Classified-data","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Abhinav330%2FML-implementation-on-Classified-data","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Abhinav330%2FML-implementation-on-Classified-data/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Abhinav330%2FML-implementation-on-Classified-data/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Abhinav330%2FML-implementation-on-Classified-data/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Abhinav330","download_url":"https://codeload.github.com/Abhinav330/ML-implementation-on-Classified-data/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Abhinav330%2FML-implementation-on-Classified-data/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34188272,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-11T02:00:06.485Z","response_time":57,"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":["cluster-analysis","clustering","clustering-algorithm","data-science","datascience","knearest-neighbor-algorithm","knn","knn-classification","machine-learning","machine-learning-algorithms","machinelearning","sklearn","supervised-learning"],"created_at":"2025-03-03T08:16:37.454Z","updated_at":"2026-06-11T07:31:44.099Z","avatar_url":"https://github.com/Abhinav330.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Codacy Badge](https://app.codacy.com/project/badge/Grade/624323824c504fbf82755743f47894fe)](https://app.codacy.com/gh/Abhinav330/ML-implementation-on-Classified-data/dashboard?utm_source=gh\u0026utm_medium=referral\u0026utm_content=\u0026utm_campaign=Badge_grade)\n![GitHub Pipenv locked dependency version](https://img.shields.io/github/pipenv/locked/dependency-version/Abhinav330/ML-implementation-on-Classified-data/matplotlib?color=beige)\n![GitHub Pipenv locked dependency version](https://img.shields.io/github/pipenv/locked/dependency-version/Abhinav330/ML-implementation-on-Classified-data/numpy?color=red)\n![GitHub Pipenv locked dependency version](https://img.shields.io/github/pipenv/locked/dependency-version/Abhinav330/ML-implementation-on-Classified-data/pandas?color=silver)\n![GitHub Pipenv locked dependency version](https://img.shields.io/github/pipenv/locked/dependency-version/Abhinav330/ML-implementation-on-Classified-data/scikit-learn?color=silver)\n![GitHub Pipenv locked dependency version](https://img.shields.io/github/pipenv/locked/dependency-version/Abhinav330/ML-implementation-on-Classified-data/scipy?color=beige)\n![GitHub Pipenv locked dependency version](https://img.shields.io/github/pipenv/locked/dependency-version/Abhinav330/ML-implementation-on-Classified-data/seaborn?color=gold)\n![GitHub Pipenv locked Python version](https://img.shields.io/github/pipenv/locked/python-version/Abhinav330/ML-implementation-on-Classified-data?color=dark%20green)\n![GitHub repo size](https://img.shields.io/github/repo-size/Abhinav330/ML-implementation-on-Classified-data)\n\n# ML-implementation-on-Classified-data\nThis repository implements a K-Nearest Neighbors (KNN) model in Python for predicting loan defaults. It analyzes the KNN_Project_Data dataset (features \u0026amp; binary target 'TARGET CLASS').\n\n# Code Summary\n\nThis Python script demonstrates the use of the K-Nearest Neighbors (KNN) classification algorithm for a binary classification task. It imports various libraries, loads a dataset named 'KNN_Project_Data', scales the data, and trains a KNN model to predict the 'TARGET CLASS'. The code also performs model evaluation and hyperparameter tuning.\n\n## Data Loading and Exploration\n\nThe code begins by importing necessary libraries, loading the dataset 'KNN_Project_Data' using pandas, and displaying dataset information using `df.info()`. The dataset is assumed to contain features and a binary target variable ('TARGET CLASS'). \n\n## Data Preprocessing\n\nData preprocessing steps include:\n- Scaling the feature data using StandardScaler from scikit-learn to ensure that all features have the same scale.\n- Splitting the dataset into training and testing sets using `train_test_split()`.\n\n## Model Building\n\nThe code then proceeds to build a K-Nearest Neighbors (KNN) classifier model with the following steps:\n- Importing KNeighborsClassifier from scikit-learn.\n- Initializing a KNN model with a specified number of neighbors (in this case, `n_neighbors=1`).\n- Fitting the model to the training data.\n- Making predictions on the test data.\n\n## Model Evaluation\n\nThe code evaluates the KNN model by:\n- Importing classification_report, confusion_matrix, and accuracy_score from scikit-learn.\n- Printing the confusion matrix and classification report, which includes metrics such as precision, recall, and F1-score.\n- Performing hyperparameter tuning by iterating through different values of 'n_neighbors' and collecting error values. This helps to find an optimal 'n_neighbors' value.\n- Plotting the error values against 'n_neighbors' to visualize the trade-off between bias and variance.\n- Rebuilding the KNN model with the optimal 'n_neighbors' value found during hyperparameter tuning.\n- Printing the final confusion matrix, classification report, and accuracy score.\n\nThe code aims to find the best 'n_neighbors' value that maximizes the model's performance.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabhinav330%2Fml-implementation-on-classified-data","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabhinav330%2Fml-implementation-on-classified-data","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabhinav330%2Fml-implementation-on-classified-data/lists"}