{"id":27040009,"url":"https://github.com/cdvel/ml-tutorials","last_synced_at":"2025-10-10T14:06:17.537Z","repository":{"id":89198263,"uuid":"31761676","full_name":"cdvel/ml-tutorials","owner":"cdvel","description":"Machine Learning Tutorials in Python (Notes and Implementations)","archived":false,"fork":false,"pushed_at":"2015-03-25T09:49:19.000Z","size":176,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-04T05:43:48.960Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","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/cdvel.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}},"created_at":"2015-03-06T09:18:27.000Z","updated_at":"2016-03-24T04:19:12.000Z","dependencies_parsed_at":"2023-06-14T10:00:22.210Z","dependency_job_id":null,"html_url":"https://github.com/cdvel/ml-tutorials","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/cdvel/ml-tutorials","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdvel%2Fml-tutorials","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdvel%2Fml-tutorials/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdvel%2Fml-tutorials/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdvel%2Fml-tutorials/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cdvel","download_url":"https://codeload.github.com/cdvel/ml-tutorials/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdvel%2Fml-tutorials/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279004186,"owners_count":26083688,"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-10T02:00:06.843Z","response_time":62,"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":[],"created_at":"2025-04-05T03:27:34.211Z","updated_at":"2025-10-10T14:06:17.508Z","avatar_url":"https://github.com/cdvel.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ml-tutorials\n\n1. [k-Nearest neighbors](http://machinelearningmastery.com/tutorial-to-implement-k-nearest-neighbors-in-python-from-scratch/)\n\n  - Finds the N most similar elements based on euclidean, hammington  etc distance\n\n  * Instance-based\n    - model the problem using data instances(rows) in order to make predictive decisions. \n    - In kNN all observations are retained as part of our model = extreme instance-based\n\n  * Competitive learning \n    - internally model elements(instance) compete in order to make a predictive decision.\n    - objective similarity measure between instances causes each instance to compete to be most similar to a given unseen data instance and contribute\n\n  * Lazy learning\n    - The algorithm doesn't build a model until the time of prediction is required\n    - Only relevant data to the unseen data (localized model)\n    - Can be computationally expensive to repeat over larger training sets\n\n  - Makes no assumption over the data, only that a distance measure can be calculated. Non-parametric or non-linear, doesn't assume functional form.\n\n2. [Naive bayes] (http://machinelearningmastery.com/naive-bayes-classifier-scratch-python/)  \n\n  - Suits classification problems. Uses probabilities of each attribute belonging to each class to make a prediction\n\n  - Fast and effective supervised learning for probabilistic prediction\n\n  * The Model \n    - A summary of data in the training set\n    1. mean\n    2. standard deviation for each (no. attributes * class values) \n    3. calculates probability of a specific attribute belonging to each class value      \n\n  * Assumptions\n    - Independent probabilities between attributes of a given classs\n    - Numerical attributes are normally distributed \n\n  * Conditional probability\n    - Probability of a class given a value of an attribute\n    - The product of _conditional probabilities_ for each attribute = probability of an instance belonging to a class\n\n  * Prediction\n    - Calculate probabilities of instance belonging to class\n    - Pick class with highest probability\n\n  * Implementations\n    - Encoding using [Log Probabilities](https://en.wikipedia.org/wiki/Log_probability):\n      - Reduces risk of floating point underflow (values too small to be represented)\n      - More efficient by using summation of log probabilities instead of product of probabilities\n      - Observations with the Iris dataset: \n        - Less accurate \n        - Faster\n        - Log = (0.5s - 0.8s, accuracy=66%) vs Prob = (0.6 - 0.8, accuracy=74%)\n        - Numerical stability (accuracy is more consistent)\n    - using categorical data (ratios)\n    - numeric attributes (with normal distribution)\n\n  - [How to get best from Naive bayes] (http://machinelearningmastery.com/better-naive-bayes/) ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcdvel%2Fml-tutorials","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcdvel%2Fml-tutorials","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcdvel%2Fml-tutorials/lists"}