Replies: 1 comment
|
Short answer The internal Thresholds come from 1 should you preprocess the long tails 2 how to see the bins import numpy as np
import matplotlib.pyplot as plt
from sklearn.ensemble import HistGradientBoostingClassifier
clf = HistGradientBoostingClassifier().fit(X, y)
edges = clf._bin_mapper.bin_thresholds_[0] # thresholds for feature 0
bins = np.r_[X[:, 0].min(), edges, X[:, 0].max()]
plt.hist(X[:, 0], bins=bins)
plt.xscale("log")
plt.show()Each array holds up to Caveat |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hello sklearn community!
I was wondering how the histograms were created and if it was possible to visualise them at all. You see a lot of my features have funky distributions with long tails (see the picture), which means a basic histogram where all the bins have the same widths will loose all the resolution at the low end of the values.
I assume the algos in HGBDT are smart and handle this (otherwise my models really wouldn't be working as well as they do), but it was wondering if:
I promise I have tried to search for this but I get drowned in a sea of articles that just state that xgboost and sklearn use histograms, they don't explain how or how to visualise. Also sorry if it's a dumb question because i misunderstood something!
Thanks for your amazing work to bring these tools to the public and non experts!
All reactions