Personality Prediction ML
A machine learning model that predicts personality types (Introvert/Extrovert) using behavioral patterns and Random Forest classification with Flask REST API implementation.
Overview
This project uses machine learning to analyze behavioral patterns and predict whether someone is more likely to be an introvert or extrovert. It leverages a Random Forest Classifier trained on various behavioral indicators and provides predictions through a REST API.
Features
Predicts personality type based on 7 behavioral indicators
Random Forest Classifier with optimized performance
REST API implementation using Flask
Comprehensive data visualization and analysis
Data preprocessing and feature scaling
Model persistence using pickle
Tech Stack
Python 3.x
scikit-learn
Flask
pandas
numpy
matplotlib
seaborn
Project Structure
API Endpoints
POST /predict
Predicts personality type based on behavioral inputs.
Request Body:
Response:
Setup Guide
Create virtual environment:
Install dependencies:
Dependencies
Create requirements.txt with:
Model Details
Algorithm: Random Forest Classifier
Features: 7 behavioral indicators
Preprocessing: StandardScaler for feature scaling
Performance: Evaluated using accuracy and classification report
Persistence: Models saved using pickle format
Data Analysis
The project includes comprehensive data analysis in main.ipynb:
Feature importance visualization
Correlation analysis
Distribution plots
Personality type distributions
Model performance comparisons
API Implementation
The Flask API (api.py) provides:
RESTful endpoint for predictions
Input validation
Error handling
Model loading and preprocessing
JSON response formatting
Environment
Python 3.x
Linux/Unix environment
Required packages listed in requirements.txt
1 like · 8 views · Jun 24, 2025
Developed a personality prediction ML model using Random Forest and Flask API.