knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
The goal of add2impala is to parse statistical metrics and encoding in SQL using R. If you want to calculate KS statistic in R, free to try rawKS.
The development version from GitHub with:
# install.packages("devtools") devtools::install_github("JiaxiangBU/add2impala")
library(add2impala) library(tidyverse)
parse_ks_sql(verbose = 0, y_hat = "pred", y = "target", table = "opd.table") parse_ks_sql(verbose = 1, y_hat = "pred", y = "target", table = "opd.table") parse_ks_sql(verbose = 2, y_hat = "pred", y = "target", table = "opd.table")
The measurment explanation is here (Chinese).
inputs <- row.names(mtcars) inputs %>% head
# remotes::install_github("daranzolin/inferregex") return_regex(inputs, verbose = "recommend") return_regex(inputs, verbose = "all") return_regex(inputs, verbose = "lazy")
rolling_ks( y_hat = "pred", y = "target", table = "opd.test_pred_table", time_variable = "inserttime" )
library(RODBC) impala <- odbcConnect("Impala")
cat2int(feature = "cyl", table = "opd.sqlsave_test_ljx") %>% write_rds("output/output_cat2int.rds")
output_cat2int <- cat2int(feature = "cyl", table = "opd.sqlsave_test_ljx")
output_cat2int <- read_rds("output/output_cat2int.rds")
output_cat2int %>% cat
可以方便把 SQL 反馈的结果,做成 markdown 格式,方便分享到 GitHub 或者 GitLab 上。
library(RODBC) impala <- odbcConnect("Impala")
paste_sql_result("describe opd.sqlsave_test_ljx") %>% write_rds("output/output_paste_sql_result1.rds")
output_paste_sql_result1 <- paste_sql_result("describe opd.sqlsave_test_ljx")
output_paste_sql_result1 <- read_rds("output/output_paste_sql_result1.rds")
output_paste_sql_result1 %>% cat
paste_sql_result("select * from opd.sqlsave_test_ljx limit 100") %>% write_rds("output/output_paste_sql_result2.rds")
output_paste_sql_result2 <- paste_sql_result("select * from opd.sqlsave_test_ljx limit 100")
output_paste_sql_result2 <- read_rds("output/output_paste_sql_result2.rds")
output_paste_sql_result2 %>% cat
r add2pkg::add_disclaimer()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.