Package: modelc 1.0.0.0
Hugo Saavedra
modelc: A Linear Model to 'SQL' Compiler
This is a cross-platform linear model to 'SQL' compiler. It generates 'SQL' from linear and generalized linear models. Its interface consists of a single function, modelc(), which takes the output of lm() or glm() functions (or any object which has the same signature) and outputs a 'SQL' character vector representing the predictions on the scale of the response variable as described in Dunn & Smith (2018) <doi:10.1007/978-1-4419-0118-7> and originating in Nelder & Wedderburn (1972) <doi:10.2307/2344614>. The resultant 'SQL' can be included in a 'SELECT' statement and returns output similar to that of the glm.predict() or lm.predict() predictions, assuming numeric types are represented in the database using sufficient precision. Currently log and identity link functions are supported.
Authors:
modelc_1.0.0.0.tar.gz
modelc_1.0.0.0.zip(r-4.5)modelc_1.0.0.0.zip(r-4.4)modelc_1.0.0.0.zip(r-4.3)
modelc_1.0.0.0.tgz(r-4.4-any)modelc_1.0.0.0.tgz(r-4.3-any)
modelc_1.0.0.0.tar.gz(r-4.5-noble)modelc_1.0.0.0.tar.gz(r-4.4-noble)
modelc_1.0.0.0.tgz(r-4.4-emscripten)modelc_1.0.0.0.tgz(r-4.3-emscripten)
modelc.pdf |modelc.html✨
modelc/json (API)
# Install 'modelc' in R: |
install.packages('modelc', repos = c('https://sparkfish.r-universe.dev', 'https://cloud.r-project.org')) |
Bug tracker:https://github.com/sparkfish/modelc/issues
compilergeneralized-linear-modelslinear-modelssqltranspiler
Last updated 4 years agofrom:2f6a779e23. Checks:OK: 7. Indexed: yes.
Target | Result | Date |
---|---|---|
Doc / Vignettes | OK | Nov 14 2024 |
R-4.5-win | OK | Nov 14 2024 |
R-4.5-linux | OK | Nov 14 2024 |
R-4.4-win | OK | Nov 14 2024 |
R-4.4-mac | OK | Nov 14 2024 |
R-4.3-win | OK | Nov 14 2024 |
R-4.3-mac | OK | Nov 14 2024 |
Exports:modelc
Dependencies:
Readme and manuals
Help Manual
Help page | Topics |
---|---|
Wrap the model SQL in the appropriate link function inverse to return scaled predictions | apply_linkinverse |
Get SQL representing a continuous term in the model with no interactions | build_additive_term |
Build SQL CASE statements representing the factors in the model | build_factor_case_statements |
Build a SQL interaction term | build_interaction_term |
Get SQL representing the intercept term given the R model and parameter name | build_intercept |
Build a SQL product | build_product |
Extract the level from the factor name | extract_level |
Extract the coefficient of a model parameter | extract_parameter_coefficient |
Extract parameters from a linear model | extract_parameters |
Extract the factor name from an R model | get_factor_name |
Check if an R model contains a coefficient | has_parameter |
Detect if the given model term is a factor | is_factor |
Detect if the given model term is an interaction | is_interaction |
Check if the given parameter is the intercept | is_intercept |
Compile an R model to a valid TSQL formula | modelc |