{"id":26451039,"url":"https://github.com/allanotieno254/loan-approval-prediction","last_synced_at":"2026-05-18T06:40:15.174Z","repository":{"id":281298566,"uuid":"944859299","full_name":"AllanOtieno254/Loan-Approval-Prediction","owner":"AllanOtieno254","description":"This project predicts whether a loan application will be approved or rejected based on various applicant details. ","archived":false,"fork":false,"pushed_at":"2025-03-08T05:45:14.000Z","size":896,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-18T16:40:41.257Z","etag":null,"topics":["binary-classification","data-preprocessing","deep-learning","evaluation-metrics","feature-engineering","normalization","tensorflow"],"latest_commit_sha":null,"homepage":"https://colab.research.google.com/drive/1H-3vejDOQpVRp-zj8uKLmvqdt3wPDkQQ?usp=sharing","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/AllanOtieno254.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":"2025-03-08T05:25:59.000Z","updated_at":"2025-03-08T05:45:17.000Z","dependencies_parsed_at":null,"dependency_job_id":"3bf477b9-22e3-4e0c-a93e-42ce653c6d32","html_url":"https://github.com/AllanOtieno254/Loan-Approval-Prediction","commit_stats":null,"previous_names":["allanotieno254/loan-approval-prediction"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/AllanOtieno254/Loan-Approval-Prediction","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AllanOtieno254%2FLoan-Approval-Prediction","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AllanOtieno254%2FLoan-Approval-Prediction/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AllanOtieno254%2FLoan-Approval-Prediction/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AllanOtieno254%2FLoan-Approval-Prediction/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AllanOtieno254","download_url":"https://codeload.github.com/AllanOtieno254/Loan-Approval-Prediction/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AllanOtieno254%2FLoan-Approval-Prediction/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267392562,"owners_count":24079919,"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-07-27T02:00:11.917Z","response_time":82,"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":["binary-classification","data-preprocessing","deep-learning","evaluation-metrics","feature-engineering","normalization","tensorflow"],"created_at":"2025-03-18T16:31:22.787Z","updated_at":"2026-05-18T06:40:15.137Z","avatar_url":"https://github.com/AllanOtieno254.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Loan Approval Prediction\n\n## 📌 Project Overview\nThis project predicts whether a loan application will be approved or rejected based on various applicant details. The dataset includes features such as income, loan amount, credit score, and employment status. A deep learning model is trained using TensorFlow/Keras to classify applications into **Approved** or **Rejected**.\n\n## 🛠️ Technologies Used\n- **Python** (pandas, NumPy, TensorFlow, scikit-learn)\n- **Machine Learning** (Logistic Regression, Neural Networks)\n- **Deep Learning** (Keras Sequential Model)\n- **Data Preprocessing** (Feature Encoding, Normalization, Scaling)\n- **Jupyter Notebook** for experimentation\n\n## 📂 Repository Structure\n```\nLoan-Approval-Prediction/\n│── data/\n│   ├── loan_approval.csv           # Original dataset\n│   ├── processed_data.csv          # Cleaned dataset\n│── notebooks/\n│   ├── data_preprocessing.ipynb    # Data cleaning \u0026 preprocessing\n│   ├── model_training.ipynb        # Model training \u0026 evaluation\n│   ├── model_testing.ipynb         # Model testing \u0026 validation\n│── models/\n│   ├── loan_approval_model.h5      # Saved trained model\n│   ├── scaler.pkl                  # StandardScaler for preprocessing\n│── scripts/\n│   ├── train_model.py              # Script for model training\n│   ├── predict.py                  # Script for making predictions\n│── README.md                       # Project documentation\n│── requirements.txt                 # Required Python libraries\n│── LICENSE                         # Open-source license\n│── .gitignore                       # Ignore unnecessary files\n```\n\n## 📊 Dataset Description\nThe dataset consists of financial and personal details of applicants.\n| Column | Description |\n|---------|----------------------|\n| `no_of_dependents` | Number of dependents |\n| `income_annum` | Annual income of applicant |\n| `loan_amount` | Loan amount requested |\n| `loan_term` | Loan repayment term (months) |\n| `cibil_score` | Credit score of applicant |\n| `residential_assets_value` | Value of residential assets |\n| `commercial_assets_value` | Value of commercial assets |\n| `luxury_assets_value` | Value of luxury assets |\n| `bank_asset_value` | Total assets in bank |\n| `education_ Not Graduate` | Education status (binary) |\n| `self_employed_ Yes` | Employment type (binary) |\n| `loan_status_ Rejected` | Loan rejection status (target) |\n\n## 🏗️ Data Preprocessing\n- **Remove leading/trailing spaces in column names**\n- **Convert categorical variables using One-Hot Encoding**\n- **Scale numeric features using `StandardScaler`**\n\n## 🧠 Model Architecture\n```python\nmodel = Sequential([\n    Dense(32, activation='relu', input_shape=(xtrain.shape[1],)),\n    Dropout(0.1),\n    Dense(32, activation='relu'),\n    Dropout(0.5),\n    Dense(1, activation='sigmoid')\n])\n```\n- **Loss Function:** Binary Cross-Entropy\n- **Optimizer:** Adam\n- **Metrics:** Accuracy\n\n## 📈 Model Training\n```python\nmodel.compile(loss='binary_crossentropy', optimizer='adam', metrics=['accuracy'])\nmodel.fit(xtrain, ytrain, epochs=20, batch_size=16, validation_data=(xtest, ytest))\n```\n\n## 🧪 Model Testing\n```python\nloss, accuracy = model.evaluate(xtest, ytest)\nprint(f'Test Loss: {loss:.4f}')\nprint(f'Test Accuracy: {accuracy:.4f}')\n```\n\n## 🔮 Making Predictions\n```python\n# New Applicant Data\nnew_data = np.array([[2, 4100000, 12200000, 8, 417, 2700000, 2200000, 8800000, 3300000, 1, 1]])\nnew_data_df = pd.DataFrame(new_data, columns=feature_columns)\nnew_data_scaled = scaler.transform(new_data_df)\n\n# Predict Approval/Rejection\nprediction = model.predict(new_data_scaled)\npredicted_class = (prediction \u003e 0.5).astype(int)[0][0]\n\nif predicted_class == 1:\n    print(\"Loan Approved ✅\")\nelse:\n    print(\"Loan Rejected ❌\")\n```\n\n## 📌 Results\nThe model predicts whether a loan application will be approved or rejected based on the provided applicant details.\n\n## 📜 License\nThis project is licensed under the **MIT License** – see the [LICENSE](LICENSE) file for details.\n\n## 📬 Contact\n- **GitHub**: [AllanOtieno254](https://github.com/AllanOtieno254)\n- **LinkedIn**: [Allan Otieno Akumu](https://www.linkedin.com/in/allanotienoakumu)\n\n---\n🔹 **Contributions are welcome!** Feel free to fork this repository and improve the model. 🚀\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fallanotieno254%2Floan-approval-prediction","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fallanotieno254%2Floan-approval-prediction","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fallanotieno254%2Floan-approval-prediction/lists"}