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

Make some functions from Dask module class methods #3832

Closed
StrikerRUS opened this issue Jan 24, 2021 · 5 comments
Closed

Make some functions from Dask module class methods #3832

StrikerRUS opened this issue Jan 24, 2021 · 5 comments
Labels

Comments

@StrikerRUS
Copy link
Collaborator

It will be good to have _train() and _predict() functions (at least them, very possibly some other functions can be made methods) in a form of _LGBMModel's methods. It will improve encapsulation in Dask module.

def _train(client, data, label, params, model_factory, sample_weight=None, group=None, **kwargs):

def _predict(model, data, raw_score=False, pred_proba=False, pred_leaf=False, pred_contrib=False,

#3515 (comment)

@ShrillShrestha
Copy link
Contributor

ShrillShrestha commented Jan 24, 2021

Hi @StrikerRUS, I am a beginner and learning to contribute in open source. I am not sure if I understand the whole issue, but it seems interesting. If you can guide me, I think I can resolve it.

Do I add these:

def _train(client, data, label, params, model_factory, sample_weight=None, group=None, **kwargs):

and
def _predict(model, data, raw_score=False, pred_proba=False, pred_leaf=False, pred_contrib=False,

inside the _LGBMModel class and change to model = self._train(...)
and return statements like
return _predict(
to return super()._predict(...)

@jameslamb
Copy link
Collaborator

Hi @ShrillShrestha , thanks for the offer!

But @StrikerRUS I disagree with the label "good first issue" on this one. This will involve some design discussions that I think should be done by maintainers. It's not as simple as just moving the code around, because the decision here might be based on a discussion (that we have not had yet) about whether the Dask module should support a non-scikit, functional API similar to

def train(params, train_set, num_boost_round=100,
. Let's please not have that conversation here by the way.

@ShrillShrestha all that said...we would love you help on one other issues. Could you try #3833?

@StrikerRUS
Copy link
Collaborator Author

@jameslamb

the decision here might be based on a discussion (that we have not had yet) about whether the Dask module should support a non-scikit, functional API similar to

Makes sense! I was not aware of plans to support functions from standard API train and cv.

Feel free to close this issue because I guess code refactoring indeed will be tightened to decisions we will make.

@jameslamb
Copy link
Collaborator

Thanks! Yes sorry, I have a lot of documentation to catch up on.

Added feature requests for train() (#3846) and cv() (#3847).

I'll close this issue, thanks.

@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.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants