effective_xgboost_book
effective_xgboost_book copied to clipboard
Violin Plot p.98
The violinplot
function in seaborn doesn't need a kind
parameter because it's already clear what kind of plot you want—a violin plot. You may have confused this with the catplot
or factorplot
functions, which do require a kind
parameter because those functions can generate different kinds of plots.
The corrected line should simply remove the kind
argument:
sns.violinplot(x='max_depth', y='loss', data=hyper2hr, ax=ax)
Please note: To replicate the color-coded output as shown in the example from the book, you will need to incorporate color distinctions, which can be achieved by utilizing the 'hue' parameter in your code.