Skip to content

Commit

Permalink
Update _index.md
Browse files Browse the repository at this point in the history
  • Loading branch information
pcc-git authored Feb 29, 2024
1 parent 1aeaa4d commit c5e7875
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions content/Slides/p4/d2/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,13 @@ Day 2: Training a Classifier

## Welcome to class!

![alt text](tropical-year-illustration.png)

[Shire Reckoning](https://shire-reckoning.com/calendar.html)

#### Announcements
1. Coding Challenge Practice - Thursday, March 7

#### Spiritual thought

##### Are facts true?
Expand Down Expand Up @@ -127,17 +133,20 @@ y = dwellings_ml[#what variable is the "target"?]
#### Decision Tree Example

```python
# create the model
classifier = DecisionTreeClassifier()

# train the model
classifier.fit(x_train, y_train)
#%%
# Create a decision tree
classifier_DT = DecisionTreeClassifier(max_depth = 4)

# Fit the decision tree
classifier_DT.fit(x_train, y_train)

# Test the decision tree (make predictions)
y_predicted_DT = classifier_DT.predict(x_test)

# make predictions
y_predictions = classifier.predict(x_test)
# Evaluate the decision tree
print("Accuracy:", metrics.accuracy_score(y_test, y_predicted_DT))

# test how accurate predictions are
metrics.accuracy_score(y_test, y_predictions)
```

#### How to Improve Accuracy
Expand Down

0 comments on commit c5e7875

Please sign in to comment.