1 of 9

CSE 163

Machine Learning

��Hunter Schafer

💬Before Class: What is last product you used that uses ML?

🎵Music: Beach Bunny

2 of 9

This Time

  • Machine Learning
    • Terminology
    • Types of ML
  • ML Code (scikit-learn)
  • Decision Trees

Last Time

  • Default Parameters
  • Plotting Code
    • seaborn
    • matplotlib
  • Principles of Data Visualization

2

3 of 9

Terms

  • Machine learning
    • Model
    • Machine learning algorithm
  • Data
    • Training Set
    • Example
    • Feature
    • Label
  • Types of ML
    • Regression
    • Classification

3

4 of 9

Features Matter

  • There exists hundreds of different model types, but the most important thing is having good features to describe your data
    • Garbage In => Garbage Out

4

5 of 9

Decision Tree

5

6 of 9

Code Recap

General ML pipeline (at least to start)

  • For classification tasks

6

# Separate data

features = data.loc[:, data.columns != 'target']

labels = data['target']

# Create and train model

model = DecisionTreeClassifier()

model.fit(features, labels)

# Predict on some data

predictions = model.predict(features)

# Assess accuracy

accuracy_score(labels, predictions)

7 of 9

Group Work:

Best Practices

When you first working with this group:

  • Introduce yourself!
  • If possible, angle one of your screens so that everyone can discuss together

Tips:

  • Starts with making sure everyone agrees to work on the same problem
  • Make sure everyone gets a chance to contribute!
  • Ask if everyone agrees and periodically ask each other questions!
  • Call TAs over for help if you need any!

7

8 of 9

Practice Session 1

  • Decision Tree Concepts (6 questions)

TAs will walk around to answer questions! Raise your hand!

Come back at 11:55!

8

9 of 9

Practice Session 2

  • DecisionTreeRegressor

TAs will walk around to answer questions! Raise your hand!

Come back at 12:15!

9