Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

Trust-Score Calculator B2B

A small Flask application for B2B trust scoring that loads a trained classification model and exposes a prediction UI and API.

Repository structure

  • app.py — Flask web service and prediction API
  • randfor.py — Random Forest training pipeline and feature selection script
  • main.py — XGBoost training script with feature selection
  • templates/ui.html — front-end dashboard for uploading CSV files and viewing predictions
  • data/ — dataset files used for training and testing
  • models/ — serialized model artifacts and encoder metadata
  • docs/ — supporting documentation and project notes

Setup

  1. Create and activate a virtual environment:
python -m venv .venv
.\.venv\Scripts\Activate.ps1
  1. Install dependencies:
pip install -r requirements.txt
  1. Ensure the dataset is available at data/b2b_credit_scoring_dataset.csv.

Run the app

Start the Flask server:

python app.py

Open http://localhost:5000 to use the prediction UI.

API usage

  • Endpoint: POST /api/predict
  • Supported input:
    • multipart form file upload named file
    • JSON body with data containing a list of row objects

Example JSON payload:

{
  "data": [
    {
      "customer_id": "123",
      "company_name": "Example Inc.",
      "external_credit_rating": 5,
      "company_size": "Small"
    }
  ]
}

Training

  • randfor.py trains a Random Forest model and saves the artifacts under models/.
  • main.py trains an XGBoost model and saves separate artifacts under models/.

Update the dataset path in data/b2b_credit_scoring_dataset.csv if necessary.

Notes

  • Do not commit local environment files or generated binaries.
  • models/ and data/ are included in the project structure, but model artifacts and raw CSV files should be managed outside version control when possible.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages