From 92234abc9bd5f92ce423905ac2b48e0c10c1df7d Mon Sep 17 00:00:00 2001 From: Petter Olsson Date: Fri, 15 Nov 2024 03:41:01 -0800 Subject: [PATCH] Pushed from Domino: https://ykb.domino-eval.com/workspace/petter/mlops-best-practices?executionId=6734940e0b77b232dfd8c697 --- apps/.ipynb_checkpoints/lead_gen-checkpoint.R | 12 ++++++++---- apps/lead_gen.R | 12 ++++++++---- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/apps/.ipynb_checkpoints/lead_gen-checkpoint.R b/apps/.ipynb_checkpoints/lead_gen-checkpoint.R index f22c310..a8343f3 100644 --- a/apps/.ipynb_checkpoints/lead_gen-checkpoint.R +++ b/apps/.ipynb_checkpoints/lead_gen-checkpoint.R @@ -30,7 +30,10 @@ ui <- fluidPage( numericInput(inputId="feat5", label='Segmentation', value=10), - actionButton("predict", "Predict") + numericInput(inputId="feat6", + label='Segmentation', + value=1), + actionButton("predict", "Predict") ), # Show a plot of the generated distribution @@ -46,14 +49,15 @@ ui <- fluidPage( ) ) -prediction <- function(inpFeat1, inpFeat2, inpFeat3, inpFeat4, inpFeat5) { +prediction <- function(inpFeat1, inpFeat2, inpFeat3, inpFeat4, inpFeat5, inpFeat6) { # Ensure inputs are treated as numeric inpFeat1 <- as.numeric(inpFeat1) inpFeat2 <- as.numeric(inpFeat2) inpFeat3 <- as.numeric(inpFeat3) inpFeat4 <- as.numeric(inpFeat4) inpFeat5 <- as.numeric(inpFeat5) - + inpFeat6 <- as.numeric(inpFeat6) + # Payload Design: 'LIMIT_BAL', 'PAY_4', 'PAY_3', 'PAY_2', 'PAY_0', 'DEFAULT' payload <- toJSON(list( data = list( @@ -155,7 +159,7 @@ server <- function(input, output, session) { updateTabsetPanel(session, "inTabset", selected = paste0("pnlPredict", input$controller) ) - result <- prediction(input$feat1, input$feat2, input$feat3, input$feat4, input$feat5) + result <- prediction(input$feat1, input$feat2, input$feat3, input$feat4, input$feat5, input$feat6) # Check if the result is valid if (is.null(result$result[[1]][[1]]) || is.na(result$result[[1]][[1]])) { diff --git a/apps/lead_gen.R b/apps/lead_gen.R index f22c310..a8343f3 100644 --- a/apps/lead_gen.R +++ b/apps/lead_gen.R @@ -30,7 +30,10 @@ ui <- fluidPage( numericInput(inputId="feat5", label='Segmentation', value=10), - actionButton("predict", "Predict") + numericInput(inputId="feat6", + label='Segmentation', + value=1), + actionButton("predict", "Predict") ), # Show a plot of the generated distribution @@ -46,14 +49,15 @@ ui <- fluidPage( ) ) -prediction <- function(inpFeat1, inpFeat2, inpFeat3, inpFeat4, inpFeat5) { +prediction <- function(inpFeat1, inpFeat2, inpFeat3, inpFeat4, inpFeat5, inpFeat6) { # Ensure inputs are treated as numeric inpFeat1 <- as.numeric(inpFeat1) inpFeat2 <- as.numeric(inpFeat2) inpFeat3 <- as.numeric(inpFeat3) inpFeat4 <- as.numeric(inpFeat4) inpFeat5 <- as.numeric(inpFeat5) - + inpFeat6 <- as.numeric(inpFeat6) + # Payload Design: 'LIMIT_BAL', 'PAY_4', 'PAY_3', 'PAY_2', 'PAY_0', 'DEFAULT' payload <- toJSON(list( data = list( @@ -155,7 +159,7 @@ server <- function(input, output, session) { updateTabsetPanel(session, "inTabset", selected = paste0("pnlPredict", input$controller) ) - result <- prediction(input$feat1, input$feat2, input$feat3, input$feat4, input$feat5) + result <- prediction(input$feat1, input$feat2, input$feat3, input$feat4, input$feat5, input$feat6) # Check if the result is valid if (is.null(result$result[[1]][[1]]) || is.na(result$result[[1]][[1]])) {