Semantische Datenintelligenz
Dipl.-Ing. Börteçin EGE



Machine Learning Projects


Predicting Loan Approval with a Decision Tree

- A machine learning demo project in Python (scikit-learn)

Machine Learning Projects

What it's about

In this project, a machine learning model decides whether a loan application is likely to be approved or rejected — based on features such as credit history, income, requested amount, and employment status. The data is deliberately synthetic: a custom-written generator produces reproducible datasets with clearly defined, learnable patterns.

The approach

The complete ML workflow, cleanly structured:

  • Data generation and preprocessing as a pipeline - categorical features are encoded, and the whole thing is wrapped so that no test information leaks into training (avoiding data leakage).
  • Stratified train/test split - preserving the class distribution.
  • Evaluation beyond accuracy — confusion matrix, per-class precision/recall, and a comparison against the majority baseline.
  • Cross-validation for a robust performance estimate instead of a single, chance-dependent split.
  • Hyperparameter tuning with GridSearchCV.

  • The result

    The model reaches roughly 82% accuracy — well above the baseline of 66% (the hit rate that a naive "always approve" strategy would achieve). The control check confirms that the tree learned the right signal: credit history is by far the most important feature, followed by the ratio of income to loan amount — exactly the structure built into the dataset.

    Decision Tree


    Confusion Matrix