-
Notifications
You must be signed in to change notification settings - Fork 370
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
ModelMatrix need to be able to align categorical variables #946
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -79,7 +79,7 @@ function StatsBase.predict(mm::DataFrameRegressionModel, df::AbstractDataFrame) | |
newTerms = remove_response(mm.mf.terms) | ||
# create new model frame/matrix | ||
mf = ModelFrame(newTerms, df) | ||
newX = ModelMatrix(mf).m | ||
newX = ModelMatrix(mf, mm.mf.df[1:0,:]).m | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why are you passing an empty data frame? AFAICT, passing the whole object will have no additional cost. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The idea is to be explicit about that no values of the original dataframe is used. Merely the pool of any pooled data. |
||
yp = predict(mm, newX) | ||
out = DataArray(eltype(yp), size(df, 1)) | ||
out[mf.msng] = yp | ||
|
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.
Typo in "referece_df". Also please add
::AbstractDataFrame
.