Model Pipeline - LightGBM
LightGBM is a fast and efficient tool that builds many small decision trees to make predictions. It learns from data step-by-step, improving its guesses over time.
Jump into concepts and practice - no test required
LightGBM is a fast and efficient tool that builds many small decision trees to make predictions. It learns from data step-by-step, improving its guesses over time.
Loss
0.7 |****
0.6 |***
0.5 |**
0.4 |*
0.3 |
1 2 3 4 5 Epochs| Epoch | Loss ↓ | Accuracy ↑ | Observation |
|---|---|---|---|
| 1 | 0.65 | 0.6 | Model starts learning basic patterns |
| 2 | 0.5 | 0.7 | Loss decreases, accuracy improves |
| 3 | 0.42 | 0.75 | Model captures more complex patterns |
| 4 | 0.38 | 0.78 | Steady improvement in performance |
| 5 | 0.35 | 0.8 | Model converges with good accuracy |
import lightgbm as lgb.import lightgbm as lgb
from sklearn.datasets import load_iris
from sklearn.model_selection import train_test_split
from sklearn.metrics import accuracy_score
iris = load_iris()
X_train, X_test, y_train, y_test = train_test_split(iris.data, iris.target, test_size=0.2, random_state=42)
train_data = lgb.Dataset(X_train, label=y_train)
params = {'objective': 'multiclass', 'num_class': 3, 'verbose': -1}
model = lgb.train(params, train_data, num_boost_round=10)
preds = model.predict(X_test)
preds_labels = preds.argmax(axis=1)
print(accuracy_score(y_test, preds_labels))import lightgbm as lgb
train_data = lgb.Dataset(X_train, label=y_train)
params = {'objective': 'binary'}
model = lgb.train(params, train_data, num_round=100)