Comparison Between Different Boosting Algorithms
After fitting the data to the model, all of the algorithms return almost similar kind of results. Here LightGBM seems to perform poorly compared to other algorithms and XGBoost performs well in this case.
To visualize the performance of all the algorithms on the same data, we can also plot the graph between the y_test and y_pred of all the algorithms.
Python3
import matplotlib.pyplot as plt import seaborn as sns fig, ax = plt.subplots(figsize = ( 11 , 5 )) ax = sns.lineplot(x = y_test, y = y_pred1, label = 'GradientBoosting' ) ax1 = sns.lineplot(x = y_test, y = y_pred2, label = 'XGBoost' ) ax2 = sns.lineplot(x = y_test, y = y_pred3, label = 'AdaBoost' ) ax3 = sns.lineplot(x = y_test, y = y_pred4, label = 'CatBoost' ) ax4 = sns.lineplot(x = y_test, y = y_pred5, label = 'LightGBM' ) ax.set_xlabel( 'y_test' , color = 'g' ) ax.set_ylabel( 'y_pred' , color = 'g' ) |
Output:
We can see in the above chart, that represents the y_test and y_pred values predicted by every algorithm. Here we can see that LightGBM and CatBoost tend to perform poorly compared to other algorithms as they are predicting the values of y_pred very higher or lower than other algorithms. XGBoost and GradientBoosting perform well on this data, which we can clearly see from the image as their predictions seem like averaging of all the other algorithms from the graph.
GradientBoosting vs AdaBoost vs XGBoost vs CatBoost vs LightGBM
Boosting algorithms are one of the best-performing algorithms among all the other Machine Learning algorithms with the best performance and higher accuracies. All the boosting algorithms work on the basis of learning from the errors of the previous model trained and tried avoiding the same mistakes made by the previously trained weak learning algorithm.
It is also a big interview question that might be asked in data science interviews. In this article, we will be discussing the main difference between GradientBoosting, AdaBoost, XGBoost, CatBoost, and LightGBM algorithms, with their working mechanisms and their mathematics of them.