Model Pipeline - Polynomial features
This pipeline shows how polynomial features transform simple input data to help a model learn more complex patterns by adding powers and interaction terms.
Jump into concepts and practice - no test required
This pipeline shows how polynomial features transform simple input data to help a model learn more complex patterns by adding powers and interaction terms.
Loss
0.5 |****
0.4 |***
0.3 |**
0.2 |*
0.1 |
1 2 3 4 5 Epochs| Epoch | Loss ↓ | Accuracy ↑ | Observation |
|---|---|---|---|
| 1 | 0.45 | 0.60 | Model starts learning with high loss and moderate accuracy |
| 2 | 0.30 | 0.75 | Loss decreases and accuracy improves as model fits polynomial features |
| 3 | 0.20 | 0.85 | Model captures nonlinear patterns better |
| 4 | 0.15 | 0.90 | Loss continues to decrease, accuracy rises |
| 5 | 0.12 | 0.92 | Training converges with low loss and high accuracy |
PolynomialFeatures in machine learning?X_poly?
from sklearn.preprocessing import PolynomialFeatures import numpy as np X = np.array([[2, 3]]) poly = PolynomialFeatures(degree=2, include_bias=False) X_poly = poly.fit_transform(X) print(X_poly)
from sklearn.preprocessing import PolynomialFeatures X = [[1, 2], [3, 4]] poly = PolynomialFeatures(degree=3) X_poly = poly.fit_transform(X) print(X_poly)
include_bias=False?