Skip to content

sinemceviker/Data-Analysis_01

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

Data Imputation and Classification Performance

Project Overview This project focuses on the process of imputing missing values in a dataset and evaluating the performance of a classification model after the data has been processed. The dataset used is the Pima Indians Diabetes Database which contains medical data for predicting the presence of diabetes in individuals. Various imputation techniques such as mean, median, mode, and K-Nearest Neighbors (KNN) are applied to handle missing values, followed by the training and evaluation of a classification model.

Key Steps

  1. Data Preprocessing The first step involves inspecting the dataset and analyzing missing values. Initially, the dataset contains no missing values, but simulation is applied to introduce missing data. This process helps in evaluating the performance of different imputation methods.

  2. Missing Data Analysis After introducing missing values through simulation, a summary of missing data is generated. The analysis is performed on each column to understand the extent of missing data, which will help in selecting appropriate imputation techniques.

  3. Imputation Techniques To handle missing data, four different imputation techniques are applied:

Mean Imputation: Missing values are replaced with the mean value of the respective column. Median Imputation: Missing values are replaced with the median value of the respective column. Mode Imputation: Missing values are replaced with the most frequent value (mode) of the respective column. K-Nearest Neighbors (KNN) Imputation: A more sophisticated method that fills in missing values by considering the closest neighbors in the dataset. 4. Model Training and Evaluation After imputing the missing values, a classification model is trained to predict the outcome variable (whether the person has diabetes or not). The model’s performance is evaluated using a confusion matrix and classification metrics, including precision, recall, F1-score, and accuracy.

  1. Classification Performance Results Confusion Matrix: Shows the number of true positives, true negatives, false positives, and false negatives. Classification Report: Displays precision, recall, and F1-score for both classes (diabetes and no diabetes). Accuracy: The overall accuracy of the classification model.
  2. Final Outcome After evaluating the performance of the classification model, the accuracy was found to be 99.87%, indicating that the imputation techniques, especially KNN, effectively handled the missing values and did not significantly impact the model’s predictive power.

Project Files

data_analysis.py: Python script containing the data preprocessing, missing data analysis, imputation techniques, and model evaluation. diabetes_data.csv: The dataset used for the analysis, containing medical data for predicting diabetes. README.md: This file, explaining the details of the project. Requirements The following Python libraries are required to run the project:

pandas numpy scikit-learn matplotlib You can install these dependencies using pip:

bash pip install pandas numpy scikit-learn matplotlib How to Run Clone this repository or download the files. Install the necessary dependencies (listed above). Run the data_analysis.py script to perform the analysis and evaluate the model. bash

python data_analysis.py

Results

Confusion Matrix:

[[500 0] [ 1 267]] Classification Report:

          precision    recall  f1-score   support

       0       1.00      1.00      1.00       500
       1       1.00      1.00      1.00       268

accuracy                           1.00       768

macro avg 1.00 1.00 1.00 768 weighted avg 1.00 1.00 1.00 768 Accuracy: 99.87%

Conclusion This project demonstrates how various imputation methods can be effectively used to handle missing data in medical datasets. The classification model, after handling missing values, shows excellent performance with high accuracy, precision, and recall values.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published