r/PythonLearning • • 2h ago

Built my first Random Forest ML API using Python, FastAPI and Docker

been learning classical machine learning and recently finished a random forest classification project

it classifies 7 dry bean varieties using 16 numerical features

what i implemented:

  • RandomForestClassifier with 100 trees

  • 5-fold cross validation

  • GridSearchCV for hyperparameter tuning

  • 92.06% test accuracy

  • FastAPI prediction endpoint

  • HTML/CSS interface

  • Docker and pytest tests

also included a confusion matrix, feature importance plot and reproducible training instructions

github: https://github.com/Vaibh37/dry-bean-random-forest

would appreciate feedback, especially on the Python code and model evaluation

if you find it useful, consider starring the repo ⭐

1 Upvotes

0 comments sorted by