{"id":15135918,"url":"https://github.com/adityabhamare10/aiml-hackathon","last_synced_at":"2026-01-20T02:25:16.607Z","repository":{"id":249306619,"uuid":"830869513","full_name":"adityabhamare10/AIML-Hackathon","owner":"adityabhamare10","description":" Smart Credit Risk Solutions","archived":false,"fork":false,"pushed_at":"2024-07-20T07:43:18.000Z","size":9261,"stargazers_count":0,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"Server","last_synced_at":"2025-04-05T23:29:10.308Z","etag":null,"topics":["chatgpt","confusion-matrix","css","ejs","flask","git","github","html","javascript","joblib","jupyter-notebook","logistic-regression","matplotlib","numpy","pandas","pycharm","python","seaborn","sklearn","stremlit"],"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/adityabhamare10.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-07-19T07:05:44.000Z","updated_at":"2024-07-20T07:40:45.000Z","dependencies_parsed_at":null,"dependency_job_id":"575104ba-2aca-4506-9ab9-5e417c02660b","html_url":"https://github.com/adityabhamare10/AIML-Hackathon","commit_stats":null,"previous_names":["adityabhamare10/aiml-hackathon"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adityabhamare10%2FAIML-Hackathon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adityabhamare10%2FAIML-Hackathon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adityabhamare10%2FAIML-Hackathon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adityabhamare10%2FAIML-Hackathon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adityabhamare10","download_url":"https://codeload.github.com/adityabhamare10/AIML-Hackathon/tar.gz/refs/heads/Server","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247415783,"owners_count":20935383,"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":["chatgpt","confusion-matrix","css","ejs","flask","git","github","html","javascript","joblib","jupyter-notebook","logistic-regression","matplotlib","numpy","pandas","pycharm","python","seaborn","sklearn","stremlit"],"created_at":"2024-09-26T06:01:47.213Z","updated_at":"2026-01-20T02:25:16.581Z","avatar_url":"https://github.com/adityabhamare10.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TrustFinance  \n\nSmart Credit Risk Evolution is a web application that evaluates the credit risk of loan applicants. Using a machine learning model, it predicts whether a loan application should be approved and provides the probability of approval based on various applicant details.\n\n## Table of Contents\n\n- [Project Overview](#project-overview)\n- [Features](#features)\n- [Installation](#installation)\n- [Usage](#usage)\n- [Model Training](#model-training)\n- [API Endpoints](#api-endpoints)\n- [Technologies Used](#technologies-used)\n- [Contributing](#contributing)\n- [License](#license)\n\n## Project Overview\n\nSmart Credit Risk Evolution leverages a logistic regression model to assess the risk associated with loan applicants. The system provides a frontend for users to input their details and receive a prediction on their loan application status along with the probability of approval.\n\n## Features\n\n- Input personal and financial information through a web interface.\n- Receive real-time predictions and approval probabilities.\n- User-friendly interface built with Streamlit.\n- Backend powered by Flask and a logistic regression model.\n\n## Installation\n\n### Prerequisites\n\n- Python 3.8+\n- pip (Python package installer)\n\n### Setup\n\n1. Clone the repository:\n\n    ```sh\n    git clone https://github.com/yourusername/smart-credit-risk-evolution.git\n    cd smart-credit-risk-evolution\n    ```\n\n2. Install dependencies:\n\n    ```sh\n    pip install -r requirements.txt\n    ```\n\n3. Prepare the Model:\n\n    Ensure you have the dataset (`Loan_default.csv`) in the appropriate directory. Run the Jupyter Notebook (`model_training.ipynb`) to train and save the model:\n\n    ```sh\n    jupyter notebook model_training.ipynb\n    ```\n\n    This will generate a `prediction_model.pkl` file in the specified directory.\n\n4. Configure the Flask server:\n\n    Update the `model_path` in the Flask script to the location of your `prediction_model.pkl`.\n\n    ```python\n    model_path = r'C:\\Users\\hp\\Documents\\AILML Hackathon\\prediction_model.pkl'\n    ```\n\n5. Run the Flask server:\n\n    ```sh\n    python flask_server.py\n    ```\n\n6. Run the Streamlit app:\n\n    ```sh\n    streamlit run streamlit_app.py\n    ```\n\n## Usage\n\n- Open the Streamlit app in your web browser. By default, it runs at [http://localhost:8501](http://localhost:8501).\n- Input your personal and financial information into the provided form.\n- Click the \"Predict\" button to receive your loan approval prediction and probability.\n\n## Model Training\n\nThe model is trained using a logistic regression algorithm on a dataset of loan applications. The training process involves:\n\n- Preprocessing the data by converting categorical variables to numerical values.\n- Splitting the data into training and testing sets.\n- Training the logistic regression model.\n- Saving the trained model for use in the Flask server.\n\n### Example Code for Model Training\n\n```python\nimport pandas as pd\nimport numpy as np\nimport joblib\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.linear_model import LogisticRegression\n\n# Load the dataset\ndf = pd.read_csv(\"Loan_default.csv\")\n\n# Preprocess the dataset\ndf = df.drop(columns=['LoanID'])\ndf.replace({\"Education\": {\"Bachelor's\": 0, 'High School': 1, \"Master's\": 2, 'PhD': 3}}, inplace=True)\ndf.replace({\"EmploymentType\": {'Part-time': 0, 'Unemployed': 1, 'Self-employed': 2, 'Full-time': 3}}, inplace=True)\ndf.replace({\"MaritalStatus\": {'Married': 0, 'Divorced': 1, 'Single': 2}}, inplace=True)\ndf.replace({\"HasMortgage\": {'No': 0, 'Yes': 1}}, inplace=True)\ndf.replace({\"HasDependents\": {'No': 0, 'Yes': 1}}, inplace=True)\ndf.replace({\"LoanPurpose\": {'Business': 0, 'Home': 1, 'Education': 2, 'Other': 3, 'Auto': 4}}, inplace=True)\ndf.replace({\"HasCoSigner\": {'No': 0, 'Yes': 1}}, inplace=True)\n\n# Split the data\nX = df.drop(columns=['Default'], axis=1)\nY = df['Default']\nX_train, X_test, Y_train, Y_test = train_test_split(X, Y, test_size=0.1, stratify=Y, random_state=2)\n\n# Train the model\nmodel = LogisticRegression()\nmodel.fit(X_train, Y_train)\n\n# Save the model\njoblib.dump(model, 'prediction_model.pkl')\n```\n# API Endpoints\n## POST /predict-model\n**Description:** Receives applicant data and returns the prediction and probability.\n**Request Body:** JSON object containing applicant features.\n\n```json\n{\n    \"age\": 30,\n    \"income\": 50000,\n    \"loanAmount\": 20000,\n    \"creditScore\": 700,\n    \"monthsEmployed\": 36,\n    \"numCreditLines\": 5,\n    \"interestRate\": 5,\n    \"loanTerm\": 60,\n    \"dtiRatio\": 0.4,\n    \"education\": 1,\n    \"employmentType\": 3,\n    \"maritalStatus\": 0,\n    \"hasMortgage\": 1,\n    \"hasDependents\": 0,\n    \"loanPurpose\": 1,\n    \"hasCoSigner\": 0\n}\n{\n    \"prediction\": \"Approved\",\n    \"probability\": 0.85\n}\n\n```\n\n# Technologies Used\n* Frontend: Streamlit\n* Backend: Flask\n* Machine Learning: scikit-learn, joblib\n* Data Processing: pandas, numpy\n\n# Contributing\nContributions are welcome! Please fork the repository and submit a pull request with your changes. Ensure that your code adheres to the project's coding standards and includes appropriate tests.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadityabhamare10%2Faiml-hackathon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadityabhamare10%2Faiml-hackathon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadityabhamare10%2Faiml-hackathon/lists"}