Objetivo del presente rmarkdown

El presente script tiene como objetivo elaborar la predicción para el conjunto de prueba del proyecto final.

load("../models/Modelo_1.RData")
load("../brief/DatosParaProyecto.RData")

Generando el RData proyecto final

prediccion_final = predict(object = modelo_1_1,
                    newdata = Test, type = "response")
# punto de corte = 0.451
Test$Loan.Status.Prob = prediccion_final
# Test$Loan.Status = ifelse(Test$Loan.Status.Prob > Corte_modelo_1_1, "Fully Paid", "Charged Off")
Test$Loan.Status = ifelse(Test$Loan.Status.Prob > 0.451, "Fully Paid", "Charged Off")

ggplot(Test, aes(y="preds", x=Loan.Status.Prob))+
  geom_jitter(alpha=0.5, color="violetred")+
  geom_violin(alpha=0.5)+
  geom_boxplot(width = 0.3, fill = "white", alpha = 0.5)+
  scale_x_continuous(labels=c("0%", "25%", "50%", "75%", "100%"), name = "Respuesta")+
  scale_y_discrete(labels=c(""), name=NULL)+
  ggtitle("Predicciones finales para el conjunto Test")+
  geom_vline(xintercept = 0.451, color = "firebrick")+
  theme_bw()

Gráfica, código y salida de consola no. 1 (distribución variable de respuesta conjunto test)

Guardando el dataframe

write_csv(Test, "../datasets/Test_final.csv")
save(Test, file = "../models/Proyecto Final.RData")