Skip to content

Instantly share code, notes, and snippets.

View abmathewks's full-sized avatar

Abraham Mathew abmathewks

View GitHub Profile
AddMissingDates <- function(
AGG_TS_DATA = FINAL_DATA[data_type == "TRAIN"],
DATE_COLUMN = "date_ymd",
TARGET_COLUMN = "visits",
OTHER_COLUMNS = c("revenue_segment", "line", "serviceline_segment",
"finance_group", "finance_sub_group"),
DEBUG = TRUE){
if(DEBUG) message("AddMissingDates: Function Initialized \n")
#' GET_NETWORK_SUMMARY
#'
#' @param DATA_DT The name of the data table
#' @param USE_THESE_FEATURES a vector of all variable names
#' @param DO_SAMPLE Logical value for if the data should be sampled
#' @param DO_SAMPLE_FRAC If Do Sample is set to true, what percentage
### EXECUTE ANALYSIS WITH AVERAGES AND IDEALIZED SLOTS
### PREDICT FOR 2020
#################################################################################################
### SET PARAMETERS
data_path = "K:/Data Excellence/4 - Reducing Direct Clinical Costs/ATM/NP_Supply/NP_Supply_Estimation_V3/data/NP_Supply_Data_With_2020.csv"
use_these_packages <- c("dplyr", "ggplot2", "data.table", "lubridate", "stringr", "boot")
### text_extraction.py
#################################################################################
#################################################################################
### PRELIMINARIES
import os
os.chdir("/Users/abrahammathew/Desktop/LZ_demo_poc/test_data")
import re
-- VM 25
----------------------------------------------------------
----------------------------------------------------------
DROP TABLE #AllCHA
############################################################################
### FUNCTION TO EXTRACT DATA FROM SQL
get_sql_data <- function(driver = "SQL Server",
server = "sdl02-vm161",
db_name = "OpsDW",
query_text = which_query){