Practice and reinforce the concepts from Lesson 7
In this hands-on activity, you will:
:computer: Access the exercise template here: Classification Exercise Template
In this section, you will:
:bulb: Start with KNN first! It's the most intuitive algorithm. Try k=3 and k=5 to see how the number of neighbors affects your results.
Part 2: Iris Flower Dataset :emoji: (15-20 minutes)
You will learn to:
- Work with the classic Iris dataset
- Apply classification techniques to real-world botanical data
- Perform feature analysis and visualization
- Implement multi-class classification
- Evaluate model performance on standard datasets tip Visualization tip: Create scatter plots of sepal length vs. sepal width to see how well the different species separate. This will help you understand why certain algorithms perform better.
This section covers two real-world applications:
:bulb: Important: Medical data often has missing values. Check for NaN values and handle them appropriately before training your models.
Challenge 2 - Payment Fraud Detection :emoji:
- Load and analyze financial transaction data
- Handle imbalanced datasets (fraud cases are rare!)
- Implement cost-sensitive classification
- Evaluate using appropriate metrics for imbalanced data tip Imbalanced data warning: Don't rely only on accuracy! With fraud detection, precision and recall are much more important. A model that predicts "no fraud" for everything might have 99% accuracy but be completely useless.
You will master:
:bulb: Tip Pro tip: Try combining different classifiers using voting. Sometimes an ensemble of simple models outperforms a single complex model!
:warning: Warning IMPORTANT: Submit your completed notebook here:
:link: Exercise Submission Form
Deadline: Submit before the next class session
:emoji:️ Before submitting, ensure you have:
Import errors?
Model not training?
Submission form not working?
:information_source: Info :bulb: Need help? Post questions in the class discussion forum or attend office hours. Classification can be tricky, but we're here to help!