Commit 05c4f0f7 authored by Jean-Karim Heriche's avatar Jean-Karim Heriche

Forgot to load package caret.

parent f5c2c01c
......@@ -47,7 +47,7 @@ plot_server <- function(input, output, session, rv) {
coord_cartesian(expand = TRUE)
if(!is.null(rv$clusters)) {
idx.to.na <- which(clusters == "")
if(length(idx.to.na)>0) {
if(length(idx.to.na)>0) {
clusters[idx.to.na] <- NA
}
p <- p + geom_point(aes(colour = factor(clusters[1:nrow(D)])), alpha = 0.5) +
......
# Authors: Jean-Karim Heriche
#TODO
##############################
## Feature selection Module ##
##############################
......@@ -217,9 +215,13 @@ feature_selection_server <- function(input, output, session, rv, session_parent
}
tmp <- rv$data[,input$featuresToProcess]
idx.valid.data <- which(is.finite(rowSums(tmp)))
preds <- predict(classifier.data$model, newdata = tmp[idx.valid.data,])
rv$data[idx.valid.data,]$xgboost.predictions <- classifier.data$classes[preds]
showNotification("Model predictions have been added to the data.", type = "warning")
if(length(idx.valid.data)>0) {
preds <- predict(classifier.data$model, newdata = tmp[idx.valid.data,])
rv$data[idx.valid.data,]$xgboost.predictions <- classifier.data$classes[preds]
showNotification("Model predictions have been added to the data.", type = "warning")
} else {
showNotification("Invalid data.", type = "error")
}
}
})
......
......@@ -51,6 +51,7 @@ library(RANN)
library(MASS)
library(uwot)
library(xgboost)
library(caret)
## Making data table filtering persistent
## from https://dev.to/awwsmm/reactive-datatables-in-r-with-persistent-filters-l26
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment