{"id":22993699,"url":"https://github.com/rushhaabhhh/ml-learning","last_synced_at":"2025-04-02T12:29:12.416Z","repository":{"id":268114888,"uuid":"903360306","full_name":"Rushhaabhhh/ML-learning","owner":"Rushhaabhhh","description":"Python implementations of core ML algorithms like linear and logistic regression, gradient descent, and model evaluation metrics to deepen understanding of machine learning principles.","archived":false,"fork":false,"pushed_at":"2025-01-21T16:39:18.000Z","size":3960,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-08T03:33:08.238Z","etag":null,"topics":["case-study","evaluation-metrics","linear-regression","logistic-regression","machine-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/Rushhaabhhh.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-12-14T12:06:31.000Z","updated_at":"2025-01-21T16:39:21.000Z","dependencies_parsed_at":null,"dependency_job_id":"6ee1eda1-9b8c-4573-9ff3-ee05ce282adc","html_url":"https://github.com/Rushhaabhhh/ML-learning","commit_stats":null,"previous_names":["rushhaabhhh/ml-learning"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rushhaabhhh%2FML-learning","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rushhaabhhh%2FML-learning/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rushhaabhhh%2FML-learning/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rushhaabhhh%2FML-learning/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Rushhaabhhh","download_url":"https://codeload.github.com/Rushhaabhhh/ML-learning/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246814703,"owners_count":20838313,"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","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":["case-study","evaluation-metrics","linear-regression","logistic-regression","machine-learning"],"created_at":"2024-12-15T05:14:01.262Z","updated_at":"2025-04-02T12:29:12.387Z","avatar_url":"https://github.com/Rushhaabhhh.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Machine Learning Concepts\n\n## 📚 Fundamental Concepts\n\n### Supervised Learning\nSupervised learning is a type of machine learning where the model is trained on labeled data, meaning that each training example is paired with an output label. The goal is to learn a mapping from inputs to outputs.\n\n#### Types of Supervised Learning:\n1. **Classification**: The task of predicting a discrete label (e.g., spam or not spam).\n   - Example: Predicting whether an email is spam or not.\n   \n2. **Regression**: The task of predicting a continuous value (e.g., predicting house prices).\n   - Example: Predicting the price of a car based on features like make, model, and year.\n\n---\n\n### Model Evaluation Metrics\n\n#### Classification Metrics\nWhen evaluating classification models, several metrics help measure their performance:\n\n1. **Accuracy**:\n   - **Formula**: \n     ```\n     Accuracy = (TP + TN) / (TP + TN + FP + FN)\n     ```\n   - **Definition**: The proportion of correct predictions (both true positives and true negatives) out of all predictions.\n\n2. **Precision**:\n   - **Formula**: \n     ```\n     Precision = TP / (TP + FP)\n     ```\n   - **Definition**: The proportion of positive predictions that are actually correct.\n\n3. **Recall**:\n   - **Formula**: \n     ```\n     Recall = TP / (TP + FN)\n     ```\n   - **Definition**: The proportion of actual positives that are correctly identified by the model.\n\n4. **F1-Score**:\n   - **Formula**: \n     ```\n     F1-Score = 2 * (Precision * Recall) / (Precision + Recall)\n     ```\n   - **Definition**: The harmonic mean of precision and recall, providing a balance between the two.\n\n5. **F-beta Score**:\n   - **Formula**: \n     ```\n     F-beta = (1 + β²) * (Precision * Recall) / ((β² * Precision) + Recall)\n     ```\n   - **Definition**: A generalization of the F1-score that allows you to control the balance between precision and recall using the parameter β.\n\n6. **Confusion Matrix**:\n   - A table that describes the performance of a classification model by comparing the actual and predicted values:\n     - **True Positives (TP)**: Correctly predicted positive cases.\n     - **True Negatives (TN)**: Correctly predicted negative cases.\n     - **False Positives (FP)**: Incorrectly predicted positive cases.\n     - **False Negatives (FN)**: Incorrectly predicted negative cases.\n\n   **Confusion Matrix Structure**:\n   ```\n   Predicted \\ Actual | Positive | Negative\n   -------------------|-----------|-----------\n   Positive           | TP        | FP\n   Negative           | FN        | TN\n   ```\n\n---\n\n#### Regression Metrics\n\n1. **Mean Squared Error (MSE)**:\n   - **Formula**: \n     ```\n     MSE = (1/n) * Σ(y_i - ŷ_i)²\n     ```\n   - **Definition**: The average of the squared differences between the actual and predicted values.\n\n2. **Root Mean Squared Error (RMSE)**:\n   - **Formula**: \n     ```\n     RMSE = √(MSE)\n     ```\n   - **Definition**: The square root of MSE, which gives an error metric in the same units as the target variable.\n\n3. **Mean Absolute Error (MAE)**:\n   - **Formula**: \n     ```\n     MAE = (1/n) * Σ|y_i - ŷ_i|\n     ```\n   - **Definition**: The average of the absolute differences between the actual and predicted values.\n\n4. **R² Score**:\n   - **Formula**: \n     ```\n     R² = 1 - (Σ(y_i - ŷ_i)² / Σ(y_i - ȳ)²)\n     ```\n   - **Definition**: Measures how well the model explains the variation in the target variable. A value closer to 1 indicates a better model fit.\n\n5. **Adjusted R² Score**:\n   - **Formula**: \n     ```\n     R²_adj = 1 - ((1 - R²) * (n-1) / (n-p-1))\n     ```\n   - **Definition**: A modified version of R² that adjusts for the number of predictors in the model, preventing overfitting.\n\n---\n\n### Linear Regression\nLinear regression attempts to model the relationship between two variables by fitting a linear equation to the observed data.\n\n#### Formula for Linear Regression:\n```\ny = mx + b\n```\nWhere:\n- `y` is the target variable\n- `x` is the feature variable\n- `m` is the slope (coefficient)\n- `b` is the y-intercept\n\n**Multiple Linear Regression**:\n```\ny = β₀ + β₁x₁ + β₂x₂ + ... + βₙxₙ + ε\n```\nWhere:\n- `β₀` is the intercept\n- `β₁, β₂, ..., βₙ` are the coefficients\n- `x₁, x₂, ..., xₙ` are the independent variables\n- `ε` is the error term\n\n---\n\n### Logistic Regression\nLogistic regression is used for binary classification tasks. The output is between 0 and 1, representing the probability of a class.\n\n#### Formula for Logistic Regression:\n1. **Sigmoid Function**:\n   ```\n   σ(z) = 1 / (1 + e^(-z))\n   ```\n\n2. **Logistic Regression Equation**:\n   ```\n   P(y=1) = σ(β₀ + β₁x₁ + β₂x₂ + ... + βₙxₙ)\n   ```\nWhere:\n- `z = β₀ + β₁x₁ + β₂x₂ + ... + βₙxₙ`\n- `σ` is the sigmoid function\n- `β₀` is the intercept\n- `β₁, β₂, ..., βₙ` are the coefficients\n- `x₁, x₂, ..., xₙ` are the independent variables\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frushhaabhhh%2Fml-learning","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frushhaabhhh%2Fml-learning","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frushhaabhhh%2Fml-learning/lists"}