Run Boruta on Weighted Dataset

30 views Asked by At

I have a dataset which I have split into

y = data['Target_flag']
X = reduced_data #inputs all numeric

I've also defined a random forest classifier:

forest = RandomForestClassifier(n_jobs = -1,class_weight = 'balanced', max_depth = 5)

To run boruta I have the code set up as:

feat_selector = BorutaPy(forest, n_estimators = 'auto', verbose = 0, random_state = 1)
feat_selector.fit(np.array(X), np.array(y), sample_weight = X['my_weighting'])
feat_selector.support_
feat_selector.rankings_

However, I'm getting a TypeError saying sample_weight is an unexpected argument, but I cant work out where else I can add it to my code. Does anyone know a way around this? Or does anyone know if using BorutaShap may help solve this?

0

There are 0 answers