Closed ishitadaga closed 4 years ago
@ishitadaga sample_weight isn't a parameter for KNeighborsRegressor, see the docs here: https://scikit-learn.org/stable/modules/generated/sklearn.neighbors.KNeighborsRegressor.html#sklearn.neighbors.KNeighborsRegressor.fit Generally ngboost can use any of the base models in sklearn, you'll need to setup params specific to the base model you'd like to try. Sklearn base models : https://scikit-learn.org/stable/supervised_learning.html#supervised-learning
@ishitadaga I would consider asking the sklearn people to implement sample_weight
for knn regression. It should be trivial to take a weighted average of outcomes among the nearest neighbors instead of an unweighted average. Or to make a neighbor with weight 5 count as all 5 neighbors, etc. I'm sure others have thought about this.
I am new to ngboost, and was trying to use KNeighborsRegressor as my base learner, but it gives me this error:
TypeError: fit() got an unexpected keyword argument 'sample_weight'
. How do I solve this, and also what all other base regressors can I use other than DecisionTreeRegressor.