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

Remove @views from OHE #51

Merged
merged 1 commit into from
Mar 12, 2021
Merged

Remove @views from OHE #51

merged 1 commit into from
Mar 12, 2021

Conversation

glennmoy
Copy link
Member

@glennmoy glennmoy commented Mar 12, 2021

This isn't needed since we're directly applying setindex! on result.
Benchmarks below confirm no loss of performance

julia> using FeatureTransforms, Random

julia> Random.seed!(1);

julia> X = rand(1.0:10.0, 100, 100);

julia> t = OneHotEncoding(1:10);

julia>  @time FeatureTransforms.apply(X, t; dims=1);
           @time FeatureTransforms.apply(X, t; dims=1);
# this branch
  0.129256 seconds (685.02 k allocations: 34.652 MiB, 6.44% gc time)
  0.000381 seconds (10.01 k allocations: 254.109 KiB)

# main
  0.131076 seconds (685.94 k allocations: 34.710 MiB, 8.55% gc time)
  0.000418 seconds (10.01 k allocations: 254.109 KiB)

@codecov
Copy link

codecov bot commented Mar 12, 2021

Codecov Report

Merging #51 (33abe28) into main (2bb89cb) will increase coverage by 0.17%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #51      +/-   ##
==========================================
+ Coverage   98.85%   99.02%   +0.17%     
==========================================
  Files           9        9              
  Lines          87      103      +16     
==========================================
+ Hits           86      102      +16     
  Misses          1        1              
Impacted Files Coverage Δ
src/one_hot_encoding.jl 100.00% <100.00%> (ø)
src/scaling.jl 100.00% <0.00%> (ø)
src/periodic.jl 100.00% <0.00%> (ø)
src/transformers.jl 100.00% <0.00%> (ø)
src/linear_combination.jl 100.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2bb89cb...33abe28. Read the comment docs.

Copy link
Member

@morris25 morris25 left a comment

Choose a reason for hiding this comment

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

Does this need a version bump?

@glennmoy glennmoy merged commit 04bd5b5 into main Mar 12, 2021
@glennmoy glennmoy deleted the gm/remove_views branch June 21, 2021 12:57
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.

2 participants