Skip to content
项目

miguelestradam3/logistic_regression_with_smote

在 GitHub 查看

关于

This project demonstrates how to build a machine learning model that predicts a person's personality type based on a set of input characteristics.

人工智能与机器学习

这些数字如何统计

可以做什么

  • Exploratory Data Analysis (EDA)
  • Data visualization with Seaborn
  • Label encoding for categorical data
  • Feature standardization

实测星标增长

24小时
0
7天
0
15天
正在收集历史
1个月
正在收集历史

各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。

README.md

原文

🧠 Personality Type Classification using Machine Learning

This project demonstrates how to build a machine learning model that predicts a person's personality type based on a set of input characteristics. The notebook follows a complete machine learning workflow, including data exploration, preprocessing, handling class imbalance, model training, and evaluation using Logistic Regression.


📌 Features

  • Exploratory Data Analysis (EDA)
  • Data visualization with Seaborn
  • Label encoding for categorical data
  • Feature standardization
  • Class imbalance handling using SMOTE
  • Train/Test split
  • Logistic Regression classifier
  • Model evaluation using multiple classification metrics

🛠 Technologies Used

  • Python
  • Pandas
  • NumPy
  • Matplotlib
  • Seaborn
  • Scikit-learn
  • imbalanced-learn (SMOTE)
  • Jupyter Notebook

📚 Libraries

pandas
numpy
matplotlib
seaborn
scikit-learn
imbalanced-learn

📊 Dataset

The project uses a synthetic personality dataset containing various personal attributes used to classify an individual's personality type.

The dataset includes multiple input features and a target variable:

  • Personality Type (Target Variable)

Categorical labels are converted into numerical values using LabelEncoder before model training.


⚙️ Machine Learning Workflow

The notebook performs the following steps:

  • Load the dataset
  • Explore and visualize the data
  • Encode categorical labels
  • Split the dataset into training and testing sets
  • Standardize features using StandardScaler
  • Balance the training data using SMOTE
  • Train a Logistic Regression model
  • Generate predictions
  • Evaluate model performance

📈 Model Evaluation

The model is evaluated using:

  • Accuracy Score
  • Precision Score
  • Recall Score
  • ROC-AUC Score
  • Confusion Matrix
  • Classification Report
  • ROC Curve

These metrics provide a comprehensive assessment of the classifier's performance.


🚀 Getting Started

Install dependencies

pip install -r requirements.txt

Or install them manually:

pip install pandas numpy matplotlib seaborn scikit-learn imbalanced-learn

▶️ Running the Project

Launch Jupyter Notebook:

jupyter notebook

Open:

main.ipynb

Run the notebook cells sequentially to reproduce the complete machine learning workflow.


🎯 Learning Objectives

This project demonstrates how to:

  • Perform exploratory data analysis
  • Encode categorical variables
  • Standardize numerical features
  • Handle imbalanced datasets using SMOTE
  • Train a Logistic Regression classifier
  • Evaluate classification models using multiple performance metrics
  • Interpret ROC curves and confusion matrices

探索相关项目

加载中…