You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
X = dataset[['body_mass_g', 'species']]# conventionally, we use capital X when there are multiple predictors
418
418
y = dataset['bill_depth_mm']
419
419
```
420
420
@@ -423,20 +423,21 @@ Since the species column is coded as a string, we need to convert it into a nume
423
423
By default, we drop the first category to avoid multicollinearity—this means the omitted category serves as the reference group when interpreting model coefficients.
424
424
```python
425
425
# One-hot encode species (drop_first avoids multicollinearity)
426
-
X = pd.get_dummies(X, columns=['species'], drop_first=True)
0 commit comments