Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quantile LightGBM - inconsistent deciles #3448

Closed
TomekPro opened this issue Oct 9, 2020 · 2 comments
Closed

Quantile LightGBM - inconsistent deciles #3448

TomekPro opened this issue Oct 9, 2020 · 2 comments

Comments

@TomekPro
Copy link

TomekPro commented Oct 9, 2020

Hi, I'm doing Quantile LightGBM, defined as follows:

QuantileEstimator(lgb.LGBMRegressor(n_jobs=-1,
                             seed=1234,
                             learning_rate=0.1,
                             reg_sqrt=True,
                             objective = 'quantile',
                             n_estimators=100))

Where QuantileEstimator is just:

class QuantileEstimator(BaseEstimator, RegressorMixin):

    def __init__(self, model):
        """
        """
        self.alphas = [round(x, 1) for x in np.arange(0.1, 1, 0.1)]
        self.model_factory = []
        self.model = model
        super().__init__()

    def fit(self, X, y=None):
        
        for a in self.alphas:
            model_i = clone(self.model)
            model_i = model_i.set_params(**{'alpha': a})
            model_fitted = model_i.fit(X, y)
            self.model_factory.append(model_fitted)
        return self

    def predict(self, X):
        predictions = pd.DataFrame()
        for a, m in zip(self.alphas, self.model_factory):
            predictions["y_pred_" + str(a)] = m.predict(X)
        return predictions

Sometimes it happens that following decile for individual predictiions has lower value than the previous one.
image

Any idea why that's happening? I understand that those are different models, but still as I set the same seed I would expect that the results for different deciles should be monotonic.

@StrikerRUS
Copy link
Collaborator

Duplicate of #3447.

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity since it was closed. To start a new related discussion, open a new issue at https://github.com/microsoft/LightGBM/issues including a reference to this.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants