GithubHelp home page GithubHelp logo

hoda233 / financial-risk-modelling-of-european-p2p-investment-platform. Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 30.26 MB

About The main purposes of this analysis are to summarize the characteristics of variables that can affect the loan status and to get some ideas about the relationships among variables.

Jupyter Notebook 99.89% Python 0.11%
classification machine-learning regression bondora streamlit-app

financial-risk-modelling-of-european-p2p-investment-platform.'s Introduction

Financial-risk-modelling-of-European-P2P-investment-platform

About

About The main purposes of this analysis are to summarize the characteristics of variables that can affect the loan status and to get some ideas about the relationships among variables.

Problem

Supervised machine learning problem.

  • Binary classification:

    • Loan Status.
  • Regression:

    • EMI (Equated Monthly Installments)
    • ELA (Eligible Loan Amount)
    • ROI (Return on Investment)

Libraries and packages

conda install numpy conda install pandas pip install seaborn

conda install matplotlib conda install scikit-learn

conda install -c conda-forge xgboost pip install streamlit

Structure

  • Loading Packages and Data
  • Data Exploration
  • Data Preprocessing
    • Drop unneeded features
    • For Classification: Handle target feature (Status)
    • For Regression: Generate targets features (EMI, ELA, ROI)
    • Handle missing values
    • Handle outliers
  • EDA (Exploratory Data Analysis)
    • Univariate Analysis
    • Bivariate Analysis & Correlation Analysis
  • Encoding Categorical Variables
  • Scaling
  • Feature Selection
  • PCA (Principal Component Analysis)
  • Separate Modeling
    • For Classification:
      • Logistic Regression
      • Random Forest Classification
      • XGB Classification
      • Gaussian Naive Bayes
    • For Regression:
      • Linear Regression
      • Ridge Regression
      • Random Forest Regression

Final Pipelines

Each pipelines includes Scaling, PCA, Model.

pipeline = Pipeline([
    ('scaler', StandardScaler()),
    ('pca', PCA(n_components =  20)),
    ('classifier', model)
])
  • Models used in Regression pipelines:
Model R2 Scores for each target R2 Score
LinearRegression [0.76497051 0.57446454 0.39988935] 0.5797748017895326
Ridge [0.7649705 0.57446456 0.39988934] 0.5797748025381682
RandomForestRegressor [0.92705843 0.71706524 0.8533169 ] 0.8324801907433681
XGBRegressor [0.93815903 0.71667844 0.85145203] 0.8354298342198373
  • Models used in Classification pipelines:
Model R2 Scores for each target
KNeighborsClassifier 0.9311306028395153
XGBClassifier 0.9449936817066825
LogisticRegression 0.9276741247305433
RandomForestClassifier 0.9417602021853861

Deployment

  • Choose XGBRegressor, XGBClassifier as the final pipelines to be used in the app
  • Create a streamlit app to access model and get predictions

How to run

  • Dataset file should be in path dataset/Bondora_raw.csv
  • Run Final_Pipeline.ipynb notebook to get the models
  • To run the app: run python -m streamlit run app.py in vscode terminal

Application Screenshots

Numerical inputs

drawing

Categorical inputs

drawing

Outputs

drawing

financial-risk-modelling-of-european-p2p-investment-platform.'s People

Contributors

hoda233 avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.