mattharrison / effective_xgboost_book

262 stars 25 forks source link

Violin Plot p.98 #15

Open FutureGoose opened 8 months ago

FutureGoose commented 8 months ago

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.