{"id":23448371,"url":"https://github.com/deliprofesor/income-analytics-interpretable-machine-learning-model","last_synced_at":"2025-04-10T02:35:10.998Z","repository":{"id":267186421,"uuid":"900466381","full_name":"deliprofesor/Income-Analytics-Interpretable-Machine-Learning-Model","owner":"deliprofesor","description":"This project predicts whether an individual earns more than 50K using the Adult Income dataset. A Random Forest model is trained and evaluated, with explanations provided through DALEX and LIME for feature importance and model transparency.","archived":false,"fork":false,"pushed_at":"2024-12-14T19:42:39.000Z","size":641,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-15T17:53:17.674Z","etag":null,"topics":["classification","dalex","data-preprocessing","data-science","data-visualization","feature-engineering","income-prediction","lime","machine-learning","model-explainability","predictive-modeling","r-programming","random-forest"],"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/deliprofesor.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-08T20:50:26.000Z","updated_at":"2024-12-14T19:42:43.000Z","dependencies_parsed_at":"2024-12-08T23:20:00.098Z","dependency_job_id":"2bd6ee83-9077-4d25-9422-d6723a1a9365","html_url":"https://github.com/deliprofesor/Income-Analytics-Interpretable-Machine-Learning-Model","commit_stats":null,"previous_names":["deliprofesor/income-analytics-interpretable-machine-learning-model"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deliprofesor%2FIncome-Analytics-Interpretable-Machine-Learning-Model","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deliprofesor%2FIncome-Analytics-Interpretable-Machine-Learning-Model/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deliprofesor%2FIncome-Analytics-Interpretable-Machine-Learning-Model/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deliprofesor%2FIncome-Analytics-Interpretable-Machine-Learning-Model/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/deliprofesor","download_url":"https://codeload.github.com/deliprofesor/Income-Analytics-Interpretable-Machine-Learning-Model/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248144438,"owners_count":21054930,"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":["classification","dalex","data-preprocessing","data-science","data-visualization","feature-engineering","income-prediction","lime","machine-learning","model-explainability","predictive-modeling","r-programming","random-forest"],"created_at":"2024-12-23T22:15:37.847Z","updated_at":"2025-04-10T02:35:10.975Z","avatar_url":"https://github.com/deliprofesor.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Income Prediction and Model Explainability using Random Forest, DALEX, and LIME\n\n![adult](https://github.com/user-attachments/assets/99e1ef19-0b9f-4c98-9ffd-5959742dd933)\n\n## Project Overview\n\nThis project aims to predict the income of individuals based on various demographic and employment-related features using machine learning techniques. A **Random Forest** model is used for classification, and two powerful explainability tools, **DALEX** and **LIME**, are employed to interpret and visualize the model's predictions. This helps in understanding which features are the most influential in determining the income class (e.g., \"\u003e50K\" or \"\u003c=50K\").\n\n## Dataset\n\nThe dataset used in this project is the **Adult Income Dataset** (also known as the **Census Income Dataset**), which contains information about individuals and their income. The dataset includes the following columns:\n- **age**: The age of the individual.\n- **workclass**: The type of employment.\n- **education**: The highest level of education attained.\n- **marital.status**: Marital status of the individual.\n- **occupation**: The occupation of the individual.\n- **relationship**: Relationship status.\n- **race**: The race of the individual.\n- **sex**: The gender of the individual.\n- **native.country**: The country of origin.\n- **income**: The target variable, indicating if the individual earns more than 50K a year or not.\n\nThe dataset is pre-processed by handling missing values and converting categorical variables to factors.\n\n## Libraries Used\n- **tidyverse**: For data manipulation and visualization.\n- **caret**: For model training and evaluation.\n- **DALEX**: For model explainability and feature importance.\n- **lime**: For local interpretable model-agnostic explanations.\n\n## Steps Involved\n\n1. **Data Loading and Preprocessing**:\n   - The data is loaded from a CSV file, and the first few rows are displayed.\n   - Missing values are checked, and categorical variables are converted into factors.\n\n2. **Data Splitting**:\n   - The dataset is split into training (70%) and testing (30%) sets.\n\n3. **Model Training**:\n   - A **Random Forest** model is trained using the `caret` package with 10-fold cross-validation to predict income.\n\n4. **Model Evaluation**:\n   - After the model is trained, predictions are made on the test set, and performance metrics such as **Confusion Matrix** are calculated.\n\n5. **Model Explainability with DALEX**:\n   - The DALEX package is used to explain the model's predictions. Feature importance is visualized to understand which features play a major role in predicting the income.\n\n6. **Model Explainability with LIME**:\n   - The LIME package provides local explanations for individual predictions. The explanation for the first five test instances is visualized, and the importance of features such as **gender** is also explored.\n\n## Key Visualizations\n\n- **Variable Importance**: This visualization shows the relative importance of each feature in predicting income.\n- **LIME Explanations**: Local explanations for individual predictions show how specific features influence the outcome for individual data points.\n\n## How to Run the Code\n\nTo run the code, follow these steps:\n\n1. Install the required packages:\n   ```r\n   install.packages(\"tidyverse\")\n   install.packages(\"caret\")\n   install.packages(\"DALEX\")\n   install.packages(\"lime\")\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeliprofesor%2Fincome-analytics-interpretable-machine-learning-model","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeliprofesor%2Fincome-analytics-interpretable-machine-learning-model","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeliprofesor%2Fincome-analytics-interpretable-machine-learning-model/lists"}