tabnet icon indicating copy to clipboard operation
tabnet copied to clipboard

Example notebook of how to use skorch with tabnet

Open ottonemo opened this issue 3 years ago • 11 comments

This notebook showcases how to use the tabnet PyTorch module with skorch for improved sklearn compatibility.

As discussed in https://github.com/dreamquark-ai/tabnet/issues/41 this PR adds a notebook showcasing how one would go on about using pytorch-tabnet with skorch. This is not a full port and it may still contain implementation errors, even though I took care to leave the internal bits mostly untouched. Any feedback is appreciated.

What kind of change does this PR introduce?

Adds an example notebook.

Does this PR introduce a breaking change?

No.

What needs to be documented once your changes are merged?

Link in the main README (already included).

Closing issues

None.

ottonemo avatar Apr 08 '21 17:04 ottonemo

Hi @ottonemo ,

Thanks for your PR, that's a cool inclusion. I will have a look in detail at this this evening. We could even think about adding this to the integration tests if we want it to be a staple for future versions.

eduardocarvp avatar Apr 08 '21 17:04 eduardocarvp

You have to add skorch as a dev dependency on pyproject.toml and then regenerate the lock files. You can use make start (or start-gpu) and then poetry update --lock once skorch has been added to your pyproject file.

Done. I also refined the notebook a bit and made it more comparable to the original notebook in terms of validation splitting.

ottonemo avatar Apr 09 '21 19:04 ottonemo

@ottonemo , I'm sorry for the delay on the review. I tested this weekend on a new environment installing all the packages and it seems to work well.

Could you just squash your 4 commits into 1 single commit with these rules, please? In your case I guess it would be feat: [add your commit text here] and you can of course detail more in the commit body. I can validate and merge as soon as this is done. Thanks again!

eduardocarvp avatar Apr 26 '21 07:04 eduardocarvp

@ottonemo , I'm sorry for the delay on the review. I tested this weekend on a new environment installing all the packages and it seems to work well.

Could you just squash your 4 commits into 1 single commit with these rules, please? In your case I guess it would be feat: [add your commit text here] and you can of course detail more in the commit body. I can validate and merge as soon as this is done. Thanks again!

Sorry for the delay on my part :) I hope everything is in order now!

ottonemo avatar May 25 '21 11:05 ottonemo

@Optimox @eduardocarvp Should we merge this ?

Hartorn avatar Dec 18 '21 13:12 Hartorn

@Optimox @eduardocarvp Should we merge this ?

@Hartorn, I think we probably waited too long to merge this...

As there is a new warm-start possibility I wonder if this changes things for skorch as we got closer to the scikit-learn behavior. @ottonemo could you have a look at this #340 and see if it changes how things should work?

Thank you very much and sorry for the delay...

Optimox avatar Dec 20 '21 09:12 Optimox

Users of the skorch example would just initialize with SkorchTabModel(..., warm_restart=True) so I don't think anything changes here.

ottonemo avatar Dec 20 '21 10:12 ottonemo

@ottonemo, could you please solve the conflicts so that I can merge?

-> starting accepting changes from develop branch pyproject.toml and poetry.lock files run poetry add --dev skorch -> this will update both files and then you can amend your commit to avoid conflicts

Thanks and happy holiday season!

Optimox avatar Dec 30 '21 16:12 Optimox

@ottonemo, could you please solve the conflicts so that I can merge?

-> starting accepting changes from develop branch pyproject.toml and poetry.lock files run poetry add --dev skorch -> this will update both files and then you can amend your commit to avoid conflicts

I think this branch should now be mergable :)

ottonemo avatar Feb 08 '22 12:02 ottonemo

@Optimox friendly reminder :)

ottonemo avatar Mar 11 '22 09:03 ottonemo

@eduardocarvp I think I can't merge since you requested changes (adding skorch to development dependencies), can you accept the changes and merge this ?

Optimox avatar Mar 14 '22 11:03 Optimox