-
Notifications
You must be signed in to change notification settings - Fork 33
Remove some uses of CategoricalArrays, update docs #15
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
Conversation
Since we now assume all non-Real columns are categorical, we can get rid of some methods.
function ModelFrame(trms::Terms, d::AbstractDataTable; | ||
contrasts::Dict = Dict()) | ||
df, msng = null_omit(DataTable(map(x -> d[x], trms.eterms))) | ||
names!(df, convert(Vector{Symbol}, map(string, trms.eterms))) | ||
for c in eachcol(df) _droplevels!(c[2]) end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kleinschmidt Can you confirm this is OK? I've checked that unused levels continue to be skipped (since we call unique
), but I'd like to be sure I'm not missing something.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. This is covered by tests: https://github.com/JuliaStats/StatsModels.jl/blob/master/test/modelmatrix.jl#L275
Codecov Report
@@ Coverage Diff @@
## master #15 +/- ##
==========================================
+ Coverage 93.11% 94.25% +1.14%
==========================================
Files 5 5
Lines 334 331 -3
==========================================
+ Hits 311 312 +1
+ Misses 23 19 -4
Continue to review full report at Codecov.
|
function ModelFrame(trms::Terms, d::AbstractDataTable; | ||
contrasts::Dict = Dict()) | ||
df, msng = null_omit(DataTable(map(x -> d[x], trms.eterms))) | ||
names!(df, convert(Vector{Symbol}, map(string, trms.eterms))) | ||
for c in eachcol(df) _droplevels!(c[2]) end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. This is covered by tests: https://github.com/JuliaStats/StatsModels.jl/blob/master/test/modelmatrix.jl#L275
The first commit fixes docs which were not updated by #13.
The second one removes special cases for
CategoricalArray
which are no longer really needed.