{"id":25804531,"url":"https://github.com/dawoodkhatri1/codealpha_credit_scoring_model","last_synced_at":"2026-03-27T07:11:53.512Z","repository":{"id":248234508,"uuid":"828146890","full_name":"dawoodkhatri1/CodeAlpha_Credit_Scoring_Model","owner":"dawoodkhatri1","description":"Develop a credit scoring model to predict the creditworthiness of individuals based on historical financial data. Utilize classification algorithms and assess the model's accuracy.","archived":false,"fork":false,"pushed_at":"2024-08-14T10:23:47.000Z","size":15,"stargazers_count":12,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-02T07:35:19.989Z","etag":null,"topics":["faker","matplotlib","numpy","pandas","pycharm-ide","python","sklearn"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dawoodkhatri1.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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-07-13T08:59:10.000Z","updated_at":"2025-02-20T02:09:32.000Z","dependencies_parsed_at":null,"dependency_job_id":"1b4a2c9f-86f5-400c-91e5-2751ba740e61","html_url":"https://github.com/dawoodkhatri1/CodeAlpha_Credit_Scoring_Model","commit_stats":null,"previous_names":["dawoodkhatri1/codealpha_credit_scoring_model"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dawoodkhatri1/CodeAlpha_Credit_Scoring_Model","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dawoodkhatri1%2FCodeAlpha_Credit_Scoring_Model","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dawoodkhatri1%2FCodeAlpha_Credit_Scoring_Model/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dawoodkhatri1%2FCodeAlpha_Credit_Scoring_Model/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dawoodkhatri1%2FCodeAlpha_Credit_Scoring_Model/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dawoodkhatri1","download_url":"https://codeload.github.com/dawoodkhatri1/CodeAlpha_Credit_Scoring_Model/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dawoodkhatri1%2FCodeAlpha_Credit_Scoring_Model/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31032130,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-27T06:08:13.374Z","status":"ssl_error","status_checked_at":"2026-03-27T06:08:07.217Z","response_time":164,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["faker","matplotlib","numpy","pandas","pycharm-ide","python","sklearn"],"created_at":"2025-02-27T18:37:47.654Z","updated_at":"2026-03-27T07:11:53.479Z","avatar_url":"https://github.com/dawoodkhatri1.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CodeAlpha_Credit_Scoring_Model\n\nYou can run the code in Pycharm and vscode.\n\nI divided the task into following things:\n\n\n**Importing libraries:**\n\npandas: Used for data manipulation and analysis.\n\nnumpy: Provides support for large arrays and matrices.\n\nmatplotlib.pyplot: Used for plotting and visualization.\n\nsklearn.model_selection: Includes tools for splitting the dataset and performing grid search.\n\nsklearn.pipeline: Helps in creating a machine learning pipeline.\n\nsklearn.compose: Allows combining different preprocessing steps.\n\nsklearn.preprocessing: Contains various preprocessing utilities.\n\nsklearn.linear_model: Provides regression algorithms like Ridge regression.\n\nsklearn.metrics: Offers metrics for model evaluation.\n\nFaker: Generates fake data.\n\n\n**Initialize Faker and Data Generation:**\n\nFaker is initialized to create realistic synthetic data.\n\nnp.random.seed(0) ensures reproducibility of random numbers.\n\nfake_data dictionary contains:\n\u003e income: Normally distributed incomes with mean 50000 and standard deviation 15000.\n\u003e\u003e age: Random integers between 20 and 70.\n\u003e\u003e\u003e credit_history: Random integers between 1 and 10.\n\u003e\u003e\u003e\u003e credit_score: Random integers between 300 and 850.\n\n\n**Data Conversion:**\n\n\u003e The generated data is converted to a pandas DataFrame for easier manipulation.\n\n\n**Splitting Data:**\n\nX contains the features (income, age, credit_history).\n\ny contains the target variable (credit_score).\n\n\n**Pipline Preprocessing:**\n\nColumnTransformer applies transformations to specified columns.\n\nStandardScaler standardizes features by removing the mean and scaling to unit variance.\n\n\n**Pipline Regression:**\n\nPipeline chains preprocessing and model fitting steps.\n\nRidge regression is used as the model.\n\n\n**HyperParameter Tuning:**\n\nGridSearchCV performs hyperparameter tuning using cross-validation.\n\nparameters dictionary specifies the range of alpha values for Ridge regression.\n\n\n**Train-Test Split and Prediction:**\n\ntrain_test_split splits the data into training and testing sets (80% train, 20% test).\n\n\n**Model Evaluation:**\n\nr2_score and mean_squared_error evaluate the model's performance.\n\nThe best hyperparameters are printed.\n\n\n**Prediction Function:**\n\npredict_credit_score: Function to predict credit scores using the trained model.\n\nA sample prediction is made using specified income, age, and credit_history.\n\n\n**Visualization:**  \n\nplt.scatter creates a scatter plot to visualize the relationship between actual and predicted credit scores.\n\nThe output looks like this:\n\n![image](https://github.com/user-attachments/assets/e36f034f-b53a-4b0f-89c8-92841a36812f)\n\n![image](https://github.com/user-attachments/assets/29d9fe27-8538-49b4-a42d-dd0ba69376c0)\n\n## License\n\n[MIT License](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdawoodkhatri1%2Fcodealpha_credit_scoring_model","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdawoodkhatri1%2Fcodealpha_credit_scoring_model","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdawoodkhatri1%2Fcodealpha_credit_scoring_model/lists"}