{"id":22445448,"url":"https://github.com/anas436/customer-category-forecasting-using-knn-with-python","last_synced_at":"2026-04-05T08:34:00.871Z","repository":{"id":110394421,"uuid":"532023417","full_name":"Anas436/Customer-Category-Forecasting-Using-KNN-With-Python","owner":"Anas436","description":null,"archived":false,"fork":false,"pushed_at":"2022-09-02T17:46:32.000Z","size":46,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-09-12T11:56:12.522Z","etag":null,"topics":["jupyterlab","matplotlib","numpy","pandas","python3","scikit-learn","sklearn","sklearn-metrics"],"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/Anas436.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":"2022-09-02T17:40:33.000Z","updated_at":"2022-09-03T17:00:53.000Z","dependencies_parsed_at":null,"dependency_job_id":"c0ea53d0-0147-442c-b223-9f2325d45a23","html_url":"https://github.com/Anas436/Customer-Category-Forecasting-Using-KNN-With-Python","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Anas436/Customer-Category-Forecasting-Using-KNN-With-Python","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Anas436%2FCustomer-Category-Forecasting-Using-KNN-With-Python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Anas436%2FCustomer-Category-Forecasting-Using-KNN-With-Python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Anas436%2FCustomer-Category-Forecasting-Using-KNN-With-Python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Anas436%2FCustomer-Category-Forecasting-Using-KNN-With-Python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Anas436","download_url":"https://codeload.github.com/Anas436/Customer-Category-Forecasting-Using-KNN-With-Python/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Anas436%2FCustomer-Category-Forecasting-Using-KNN-With-Python/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31430009,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-05T08:13:15.228Z","status":"ssl_error","status_checked_at":"2026-04-05T08:13:11.839Z","response_time":75,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["jupyterlab","matplotlib","numpy","pandas","python3","scikit-learn","sklearn","sklearn-metrics"],"created_at":"2024-12-06T03:14:23.001Z","updated_at":"2026-04-05T08:34:00.813Z","avatar_url":"https://github.com/Anas436.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Customer-Category-Forecasting-Using-KNN-With-Python\n\n\n\n## Objectives\n\nAfter completing this lab you will be able to:\n\n*   Use K Nearest neighbors to classify data\n\n**K-Nearest Neighbors** is a supervised learning algorithm. Where the data is 'trained' with data points corresponding to their classification. To predict the class of a given data point, it takes into account the classes of the 'K' nearest data points and chooses the class in which the majority of the 'K' nearest data points belong to as the predicted class.\n\n### Here's an visualization of the K-Nearest Neighbors algorithm.\n\n\u003cimg src=\"https://cf-courses-data.s3.us.cloud-object-storage.appdomain.cloud/IBMDeveloperSkillsNetwork-ML0101EN-SkillsNetwork/labs/Module%203/images/KNN_Diagram.png\"\u003e\n\nIn this case, we have data points of Class A and B. We want to predict what the star (test data point) is. If we consider a k value of 3 (3 nearest data points), we will obtain a prediction of Class B. Yet if we consider a k value of 6, we will obtain a prediction of Class A.\n\nIn this sense, it is important to consider the value of k. Hopefully from this diagram, you should get a sense of what the K-Nearest Neighbors algorithm is. It considers the 'K' Nearest Neighbors (data points) when it predicts the classification of the test point.\n\n\u003ch1\u003eTable of contents\u003c/h1\u003e\n\n\u003cdiv class=\"alert alert-block alert-info\" style=\"margin-top: 20px\"\u003e\n    \u003col\u003e\n        \u003cli\u003e\u003ca href=\"https://#about_dataset\"\u003eAbout the dataset\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"https://#visualization_analysis\"\u003eData Visualization and Analysis\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"https://#classification\"\u003eClassification\u003c/a\u003e\u003c/li\u003e\n    \u003c/ol\u003e\n\u003c/div\u003e\n\u003cbr\u003e\n\u003chr\u003e\n\n\u003cdiv id=\"about_dataset\"\u003e\n    \u003ch2\u003eAbout the dataset\u003c/h2\u003e\n\u003c/div\u003e\n\nImagine a telecommunications provider has segmented its customer base by service usage patterns, categorizing the customers into four groups. If demographic data can be used to predict group membership, the company can customize offers for individual prospective customers. It is a classification problem. That is, given the dataset,  with predefined labels, we need to build a model to be used to predict class of a new or unknown case.\n\nThe example focuses on using demographic data, such as region, age, and marital, to predict usage patterns.\n\nThe target field, called **custcat**, has four possible values that correspond to the four customer groups, as follows:\n1- Basic Service\n2- E-Service\n3- Plus Service\n4- Total Service\n\nOur objective is to build a classifier, to predict the class of unknown cases. We will use a specific type of classification called K nearest neighbour.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanas436%2Fcustomer-category-forecasting-using-knn-with-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanas436%2Fcustomer-category-forecasting-using-knn-with-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanas436%2Fcustomer-category-forecasting-using-knn-with-python/lists"}