example ppt

profileVidhi patel
  • 2 years ago
  • 1
files (1)

BINARYCLASSIFICATION.pptx

BINARY CLASSIFICATION

CSC 272 – MACHINE LEARNING

PRSENTED BY – VIDHI PATEL & SHUVERTHI KANUNGO

DATASET DESCRIPTION

Stroke Prediction Dataset (Dataset 1)

Water Quality Prediction Dataset (Dataset 2)

Interesting Facts about the Dataset

Number of Null Values in the Dataset “Water Quality Prediction Dataset”

DATA PROCESSING

Handling Missing Data

A single feature named "bmi"

‘missingno’ for handling the null value

"fillna" function from the pandas library, we replaced the null values with the respective feature medians

Handling Outlier

Comparison of Original and Transformed Distribution of AVERAGE GLUCOSE LEVEL

Comparison of Original and Transformed Distribution of BMI

our focus centered on managing null values Some of the figures illustrating this distribution are present below:

Distribution of Feature Total Dissolved Solids

Distribution of Feature pH Level Distribution

Encoding, Scaling and Normalization

One-Hot Encoding and Label Encoding to convert categorical features to numerical ones

Standard Scaler () function is use for normalize the dataset

Stroke Prediction dataset

SMOTE function are use for simplify the minority class in the stroke dataset

Model Training and Evaluation

CROSS VALIDATION

Dataset initially split into training and testing sets (80% training, 20% testing) using 'train_test_split' function.

Cross-validation implemented using Stratified K-Fold with 5 folds.

Stratified K-Fold ensures each fold maintains the same class distribution as the original dataset.

Using a moderate number of folds (5) balances stability of performance estimate and computational efficiency.

Cross-validation aids in assessing the model's performance across different subsets of data.

Model trained on resampled training data and evaluated on corresponding test set in each iteration.

Process repeated five times, and predictions as well as true labels are stored for further analysis.

Class weights computed to address imbalanced nature of the data, used during machine learning model training.

Robust cross-validation enhances generalizability and effectiveness in predicting strokes.

METHODS

Decision Tree

Decision Tree model evaluated for two datasets.

Evaluation involved varying the maximum depths hyperparameter.

Two criteria used for evaluation: entropy and Gini impurity.

Training and test accuracies recorded for each depth.

Results visualized to identify the optimal depth for the model.

Systematic evaluation helps understand model performance under different hyperparameter settings.

Entropy and Gini Graph for Stroke Prediction

Entropy and Gini Graph for Water Quality

Plot illustrates training and test accuracies against maximum depth for Entropy and Gini criteria.

Red and blue lines represent training and test accuracies for entropy, while orange and green lines represent Gini.

Training accuracy increases with higher depths, but test accuracy plateaus or decreases after a certain point.

Optimal maximum depth determined by analyzing plot: 6 for Stroke Prediction Dataset, 7 for Water Quality Prediction.

Optimal depth balances accuracy and avoids overfitting, achieving a balance between capturing patterns and generalizing.

Decision Tree model with a maximum depth of 6 identified as most suitable for the Stroke Prediction Dataset.

Support Vector Machine (SVM)

Support Vector Machine (SVM) model tailored for binary classification in Dataset 1.

Balanced class weights incorporated during training to address imbalanced classes within the dataset.

Linear kernel suitable when the relationship between features and target variable is approximately linear.

Collective use of linear kernel and balanced class weights aims for a balance between model complexity and interpretability.

Collective use of linear kernel and balanced class weights aims for a balance between model complexity and interpretability.

Balanced class weights ensure equal consideration for instances from both classes, preventing bias toward the majority class.

Overall effectiveness in handling diverse datasets emphasized.

Overall effectiveness in handling diverse datasets emphasized.

Overall effectiveness in handling diverse datasets emphasized.

Overall effectiveness in handling diverse datasets emphasized.

KNN

For Dataset 1:

KNN model with distance-based weights.

Features either scaled or unscaled based on KNN preprocessing needs.

Learns patterns in training, assigns higher weights to closer neighbors.

For Dataset 2:

KNN model configured with 10 neighbors.

Balances model complexity and stability.

More neighbors (10) for robustness to noise and outliers.

Promotes stability and generalization in scenarios where intricate patterns are not essential.

Perceptron

Perceptron used for both datasets with default settings.

Default configuration suitable for linearly separable datasets.

Balanced class weights address class imbalance during training.

Perceptron's simplicity and interpretability make it effective for binary classification.

Training and evaluation include confusion matrix and classification report for performance insights.

Classification Report

In Dataset 1 with class imbalance, F1-Score prioritized for balanced model assessment.

F1-Score's balance between precision and recall suits imbalanced datasets, providing a comprehensive measure.

Dataset 2, with null values, highlights the importance of handling missing data.

F1-Score crucial in maintaining balance between precision and recall, especially when missing data impacts accuracy.

F1-Score

Results

Conclusion and Analysis of Result

Dataset 1:

Limited F1-Score improvement with oversampling and cross-validation.

Class imbalance may benefit from adjusting weights, different sampling methods, or advanced algorithms.

Hyperparameter tuning and comprehensive feature engineering could enhance predictive accuracy.

Manual data import for the minority class may improve models.

Dataset 2:

Models perform well, but 40% of features are computationally generated.

Focus on addressing null values is crucial for refining predictions.

Techniques like imputation and models resilient to missing data (e.g., decision tree-based) may help.

Feature engineering and thorough data cleaning processes could enhance robustness and accuracy.

image1.png

image2.JPEG

image3.JPEG

image4.JPEG

image5.JPEG

image6.JPEG

image7.JPEG

image8.JPEG

image9.png