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

Add labelmap2vec. #29

Merged
merged 2 commits into from Nov 19, 2018
Merged

Add labelmap2vec. #29

merged 2 commits into from Nov 19, 2018

Conversation

holtri
Copy link
Contributor

@holtri holtri commented Nov 17, 2018

This adds functionality to convert a labelmap into a label vector.

Example:

julia> labelvec = [:yes,:no,:no,:yes,:yes]
5-element Array{Symbol,1}:
 :yes
 :no
 :no
 :yes
 :yes

julia> lm = labelmap(labelvec)
Dict{Symbol,Array{Int64,1}} with 2 entries:
  :yes => [1, 4, 5]
  :no  => [2, 3]

julia> labelmap2vec(lm)
5-element Array{Symbol,1}:
 :yes
 :no
 :no
 :yes
 :yes

@coveralls
Copy link

Coverage Status

Coverage decreased (-14.4%) to 85.593% when pulling 322beb2 on holtri:lm2vec into a21c5b5 on JuliaML:master.

@coveralls
Copy link

coveralls commented Nov 17, 2018

Coverage Status

Coverage decreased (-14.4%) to 85.593% when pulling 51d06b5 on holtri:lm2vec into a21c5b5 on JuliaML:master.

@holtri
Copy link
Contributor Author

holtri commented Nov 17, 2018

Coverage decrease seems to be related to issues with coverage reporting: JuliaCI/Coverage.jl#187
JuliaLang/julia#28192

Copy link
Member

@Evizero Evizero left a comment

Choose a reason for hiding this comment

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

I can see how this could be useful, thanks!

I order for me to merge could you do one of the following two things:

  • add a docstring to labelmap2vec and an entry for it in the docs.
  • not export labelmap2vec

@oxinabox
Copy link
Member

I think the docstring should mention it is the inverse function of labelmap

@Evizero Evizero merged commit 8ca45bf into JuliaML:master Nov 19, 2018
@Evizero
Copy link
Member

Evizero commented Nov 19, 2018

thanks!

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.

None yet

4 participants