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

Adding support for Neural Network Embedding #895

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

SourdoughCat
Copy link
Contributor

[please review the Contribution Guidelines prior to submitting your pull request. go ahead and delete this line if you've already reviewed said guidelines.]

What does this PR do?

Attempts to resolve #809

Where should the reviewer start?

Have a look at tpot.builtins.embedding_estimator

How should this PR be tested?

It has been tested on Python 3.7 on two environments; one with tensorflow 2.0.0a installed and one without tensorflow installed at all. It was tested via:

python3 -m nose tests/embedding_estimator_tests.py

Any background context you want to provide?

See also #809 - as requested. I've made an attempt to ensure the API is compliant and sensible

What are the relevant issues?

#809

Screenshots (if appropriate)

Questions:

  • Do the docs need to be updated? Maybe - let me know what you need me to do.
  • Does this PR add new (Python) dependencies? Adds new optional dependencies. You can use the MLPClassifier as part of existing dependencies (scikit-learn)

@SourdoughCat SourdoughCat changed the title initial update with embedding layer support Adding support for Neural Network Embedding Jul 26, 2019
except ImportError:
tf = None
if tf is None:
return
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you guys prefer raising a SkipTest here or leaving it like this?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SkipTest should be OK since TF should be a optional dependency.

X_transformed = np.hstack(
(self._embedding_mlp(self.estimator, X), X_transformed)
)
else:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Chose not to do checking here otherwise you'll need to do an import at the top; which adds whatever flavour of the month neural network library to be a hard dependency to this. I don't have better ideas at this point but happy for any suggestions

@coveralls
Copy link

coveralls commented Jul 26, 2019

Coverage Status

Coverage increased (+0.04%) to 96.172% when pulling 5719a87 on chappers:feat/deeplearning_embedding into 815b0e2 on EpistasisLab:master.

self: object
Returns a copy of the estimator
"""
if not issubclass(self.estimator.__class__, MLPClassifier) and not issubclass(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • not sure if this is the best way to check for Keras etc.

Q: how would we support pure tensorflow or pytorch? I've used Keras here to try to use the Keras scikit-learn wrapper

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this PR. Keras scikit-learn wrapper is good so far.

@jhmenke
Copy link
Contributor

jhmenke commented Oct 2, 2019

is this still happening?

@SourdoughCat
Copy link
Contributor Author

Up to the maintainers

@weixuanfu
Copy link
Contributor

I am sorry for late response due to out of office for more than one month. I think removing MLPClassifier/MLPRegessor (only using Keras wraper) in this transformer is more practical because MLPClassifier/MLPRegessor are too slow on large dataset. As mentioned above, it will be an optional transformer. Also, it should be highly suggested on user guide that using Keras on GPU is highly recommended when using this transformer.

@adriangb adriangb mentioned this pull request Feb 24, 2020
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

Successfully merging this pull request may close these issues.

Add deep learning features to pipeline
4 participants