Comments (4)
library(hardhat)
library(gapminder)
# warning? same as rhs when indicators=FALSE?
mold(country:continent ~ year, gapminder)
#> $predictors
#> # A tibble: 1,704 x 1
#> year
#> <dbl>
#> 1 1952
#> 2 1957
#> 3 1962
#> 4 1967
#> 5 1972
#> 6 1977
#> 7 1982
#> 8 1987
#> 9 1992
#> 10 1997
#> # … with 1,694 more rows
#>
#> $outcomes
#> # A tibble: 1,704 x 2
#> country continent
#> <fct> <fct>
#> 1 Afghanistan Asia
#> 2 Afghanistan Asia
#> 3 Afghanistan Asia
#> 4 Afghanistan Asia
#> 5 Afghanistan Asia
#> 6 Afghanistan Asia
#> 7 Afghanistan Asia
#> 8 Afghanistan Asia
#> 9 Afghanistan Asia
#> 10 Afghanistan Asia
#> # … with 1,694 more rows
#>
#> $preprocessor
#> Formula Preprocessor:
#>
#> # Predictors: 1
#> # Outcomes: 2
#> Intercept: FALSE
#> Indicators: TRUE
#>
#> $offset
#> NULL
mold(year ~ country:continent, gapminder, indicators = FALSE)
#> Warning: Interaction terms have been detected in `formula`. These are
#> not expanded when `indicators = FALSE`, but the individual terms will be
#> included in the output.
#> $predictors
#> # A tibble: 1,704 x 2
#> country continent
#> <fct> <fct>
#> 1 Afghanistan Asia
#> 2 Afghanistan Asia
#> 3 Afghanistan Asia
#> 4 Afghanistan Asia
#> 5 Afghanistan Asia
#> 6 Afghanistan Asia
#> 7 Afghanistan Asia
#> 8 Afghanistan Asia
#> 9 Afghanistan Asia
#> 10 Afghanistan Asia
#> # … with 1,694 more rows
#>
#> $outcomes
#> # A tibble: 1,704 x 1
#> year
#> <int>
#> 1 1952
#> 2 1957
#> 3 1962
#> 4 1967
#> 5 1972
#> 6 1977
#> 7 1982
#> 8 1987
#> 9 1992
#> 10 1997
#> # … with 1,694 more rows
#>
#> $preprocessor
#> Formula Preprocessor:
#>
#> # Predictors: 2
#> # Outcomes: 1
#> Intercept: FALSE
#> Indicators: FALSE
#>
#> $offset
#> NULL
Created on 2019-02-16 by the reprex package (v0.2.1.9000)
from hardhat.
maybe check the attr(terms, "factor")` matrix for interactions?
from hardhat.
Can use a modified version of detect_factors_in_interactions()
to look for :
in the factor matrix of the terms (*
and ^
and %in%
are all recoded with :
in the factor matrix). This would let us prevent interactions on the LHS because only model.frame()
is run.
from hardhat.
This issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org) and link to this issue.
from hardhat.
Related Issues (20)
- forge fails with non-standard roles HOT 4
- Release hardhat 1.0.0 HOT 1
- Error in out$extras$final(predictors_extras, outcomes_extras): argument "outcomes_extras" is missing, with no default HOT 15
- Release hardhat 1.1.0 HOT 2
- get_outcome_levels blueprint method? HOT 5
- Post recipes 1.0.0 upkeep HOT 1
- Release hardhat 1.2.0 HOT 1
- Pass through strings_as_factors arg HOT 3
- Problem with predicting on new data for character column HOT 5
- Problem with a formula with spaces in the name of a factor and indicators = "none" HOT 2
- `mold()` inconsistently preserves (with XY method) or ignores (with formula method) non-base vector classes HOT 2
- Do a pass over `validate_is()` with an eye towards performance HOT 1
- Avoid `as_tibble()` where possible HOT 2
- multi-outcomes support for `spruce_prob_multi` shall clarify input format for multiple `pred_levels` HOT 2
- Upkeep for hardhat HOT 1
- Regression in development version of hardhat when using sf objects HOT 3
- Release hardhat 1.3.0 HOT 1
- Dynamically calculate weights HOT 5
- Using a division on the left-hand side of a formula throws an "Interaction terms can't be specified on the LHS of `formula`" HOT 2
- importance weights not compatible with DALEXtra::model_profile HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hardhat.