This assignment builds on your previous work and introduces you to predictive analytics through a forecasting method called a binary classifier. You will then work on how to visualize and understand a binary classifier.
- Receive an introduction to binary classifiers, logistic regression, and the results, including true-positive, false-positive, true-negative, and false-negative results
- Run a binary classification algorithm on our diabetes data
- Visualize the results in Tableau
For the following assignment, please review the instructions on how to download a blocked file in Chrome before you start your assignment.
- Assignment Instuctions: Unit 3 Self-Check Assignment 3 Diabetes Forecasting
- Google Colab Notebook: Diabetes_Classifier
- Dataset: Diabetes
- How to Download a Blocked File in Chrome
Struggling with where to start this assignment? Follow this guide to tackle your assignment easily!
Tutor’s Step-by-Step Guide: Unit 3 Self-Check Assignment 3 — Diabetes Forecasting
Step 1 — Understand the assignment goals
By the end of this task, you should be able to:
-
Explain the purpose of binary classifiers and logistic regression.
-
Apply logistic regression to a diabetes dataset.
-
Interpret outcomes using true positive, false positive, true negative, false negative.
-
Visualize your classifier results in Tableau.
Step 2 — Key concepts refresher
-
Binary classifier: Predicts outcomes that fall into one of two categories (e.g., diabetes = yes/no).
-
Logistic regression: A machine learning algorithm that predicts probabilities for binary outcomes.
-
Confusion matrix terms:
-
True Positive (TP): Model predicts diabetes = yes, and patient actually has diabetes.
-
False Positive (FP): Model predicts diabetes = yes, but patient does not have it.
-
True Negative (TN): Model predicts diabetes = no, and patient does not have it.
-
False Negative (FN): Model predicts diabetes = no, but patient actually has diabetes.
-
Step 3 — Running the model in Google Colab
-
Open Google Colab: Upload or open the provided Diabetes_Classifier.ipynb notebook.
-
Load the dataset: Make sure the diabetes dataset (likely CSV) is correctly linked in Colab.
-
Import packages: Typical imports — pandas, numpy, sklearn (LogisticRegression, train_test_split, metrics).
-
Preprocess the data:
-
Handle missing values.
-
Normalize or standardize features if needed.
-
-
Split the data:
-
Training set (e.g., 70%)
-
Testing set (30%).
-
-
Train the model:
-
Make predictions:
-
Evaluate results with confusion matrix:
Step 4 — Visualizing results in Tableau
-
Export results from Colab: Save predictions and true labels into a CSV.
-
Upload CSV into Tableau.
-
Create visuals:
-
Confusion matrix heatmap (Actual vs. Predicted).
-
Bar chart showing counts of TP, FP, TN, FN.
-
ROC curve / precision-recall curve (optional, if Colab code generates probabilities).
-
Step 5 — Writing up your submission
-
Introduction: Define binary classifiers and logistic regression.
-
Methods: Briefly describe how you ran the model in Colab.
-
Results: Present confusion matrix outcomes.
-
Visualization: Insert Tableau screenshot(s).
-
Reflection: Explain what TP, FP, TN, FN mean for healthcare decision-making (e.g., the risk of false negatives in diabetes screening).
Step 6 — Troubleshooting tips
-
If Chrome blocks downloads: Follow your course-provided instructions for allowing downloads.
-
If Colab errors appear: Check Python package versions (e.g., sklearn).
-
If Tableau doesn’t recognize your CSV: Ensure headers are included (“Actual”, “Predicted”).
Step 8 — Helpful Resources
-
Google Colab guide: https://colab.research.google.com/notebooks/intro.ipynb
-
Scikit-learn Logistic Regression docs: https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LogisticRegression.html
-
FEMA Confusion Matrix Explanation (for classifiers): https://developers.google.com/machine-learning/crash-course/classification/true-false-positive-negative
-
Tableau basics: https://www.tableau.com/learn/training
-
Chrome blocked downloads fix: https://support.google.com/chrome/answer/2898334
The post Diabetes Forecasting with Binary Classifiers and Logistic Regression appeared first on Skilled Papers.