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

Added one hot encoding to transformers #243

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

Conversation

markusnagel
Copy link

We added a OneHotEncoding class that transforms a given source (in int) to one-hot-encoding (also known as 1-of-K encoding) as well as a corresponding test.
One-hot-encoding is useful if (1) a problem has many classes and thus by storing the class number space can be saved and (2) if a problem can be treated as different types of problems (e.g. ordinal regression, classification).

The name of the source that will be transformed.

"""
def __init__(self, data_stream, num_classes, source_name='targets',
Copy link
Contributor

Choose a reason for hiding this comment

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

You don't need an additional source_name kwarg, as which_sources will already filter out the sources to be transformed.

In fact, I think having a targets default value might not be worth it as well.

@vdumoulin
Copy link
Contributor

@markusnagel sorry about the delay, and thanks a lot for your contribution!

@markusnagel
Copy link
Author

Thanks for your feedback. Indeed the source_name was completely unnecessary. I implemented your suggestions, what do you think of it?

@aukejw
Copy link
Contributor

aukejw commented Nov 9, 2015

@vdumoulin , I squashed the corrections into one commit. Any idea what's going on with travis?

@vdumoulin
Copy link
Contributor

No idea. I restarted the build yesterday and had the same error, I'm trying again today.

Markus Nagel and others added 2 commits December 4, 2015 10:02
Conflicts:
	tests/transformers/test_transformers.py
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.

3 participants