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

Is it possible to provide a scikit-learn interface? #4

Closed
hengzhe-zhang opened this issue Sep 27, 2021 · 5 comments
Closed

Is it possible to provide a scikit-learn interface? #4

hengzhe-zhang opened this issue Sep 27, 2021 · 5 comments

Comments

@hengzhe-zhang
Copy link

This project is interesting and I want to use it as the baseline algorithm for my paper. However, it seems that I need to take several steps in order to make a prediction. Consequently, is it possible to provide a scikit-learn interface for making a convenient comparison between different algorithms?

@Yura52
Copy link
Collaborator

Yura52 commented Sep 27, 2021

UPD

There are several approaches to training and prediction:

  • implement things manually (as it is done in the official example)
  • use a general purpose framework (for example, Lightning).
  • (use with caution) use a high-level library (for example, skorch provides a Scikit-Learn interface for PyTorch, which looks like what you are looking for). WARNING: high-level libraries usually provide default training parameters that can be suboptimal for the actual task at hand. You should not rely on the default parameters. Instead, you should tune them or take inspiration from pipelines for tasks that are similar to your task. In all cases, you should explicitly pass all the training parameters (such as optimizer, batch size, learning rate, weight decay, early stopping settings, epochs, etc.) to the corresponding functions.

@hengzhe-zhang
Copy link
Author

Do you mean that I only need to wrap the FTTransformer using skorch?

@Yura52
Copy link
Collaborator

Yura52 commented Sep 27, 2021

NOTE: I have updated the previous answer, please, read it first.

Do you mean that I only need to wrap the FTTransformer using skorch?

In theory, yes. Note that rtdl.FTTransformer expects two arguments (numerical and categorical features), so you will need to read this section.

@Yura52
Copy link
Collaborator

Yura52 commented Sep 29, 2021

Feel free to reopen the issue if you have more questions on the topic.

@Yura52 Yura52 closed this as completed Sep 29, 2021
@hengzhe-zhang
Copy link
Author

@Yura52 I implement a scikit-learn compatible interface for algorithms in this library and already open sourced it on GitHub. (https://github.com/zhenlingcn/scikit-rtdl)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants