Title: | Regression Data Analysis System |
---|---|
Description: | Perform a supervised data analysis on a database through a 'shiny' graphical interface. It includes methods such as linear regression, penalized regression, k-nearest neighbors, decision trees, ada boosting, extreme gradient boosting, random forest, neural networks, deep learning and support vector machines. |
Authors: | Oldemar Rodriguez [aut, cre], Andres Navarro D. [ctb, prg], Diego Jimenez A. [ctb, prg], Ariel Arroyo S. [ctb, prg], Joseline Quiros M. [ctb, prg] |
Maintainer: | Oldemar Rodriguez <[email protected]> |
License: | GPL (>=2) |
Version: | 3.0.2 |
Built: | 2024-10-31 20:28:01 UTC |
Source: | https://github.com/PROMiDAT/regressoR |
The application server-side
app_server(input, output, session)
app_server(input, output, session)
input , output , session
|
Internal parameters for shiny. DO NOT REMOVE. |
creates a string representative of a vector
as_string_c(vect, quote = TRUE)
as_string_c(vect, quote = TRUE)
vect |
a vector with values |
quote |
a logical value. If TRUE, the values on the vector will be surrounded by quotes. |
as_string_c(c("A", "B", "C")) as_string_c(c(5, 6, 7)) as_string_c(c(5, 6, 7), quote = FALSE) as_string_c(iris$Species)
as_string_c(c("A", "B", "C")) as_string_c(c(5, 6, 7)) as_string_c(c(5, 6, 7), quote = FALSE) as_string_c(iris$Species)
generates the graph of variable importance.
boosting_importance_plot( model, titles = c("Importancia de Variables segun Influencia Relativa", "Influencia Relativa", "Variable") )
boosting_importance_plot( model, titles = c("Importancia de Variables segun Influencia Relativa", "Influencia Relativa", "Variable") )
model |
boosting model(gbm). |
titles |
Labels on the chart |
helps to get the maximum of n.minobsinnode and bag.fraction values with which no error is generated in the model.
calibrate_boosting(data)
calibrate_boosting(data)
data |
the name of the learning data. |
calibrate_boosting(iris)
calibrate_boosting(iris)
get penalized regression coefficients.
coef_lambda(data, variable.pred, model, log.lambda = NULL)
coef_lambda(data, variable.pred, model, log.lambda = NULL)
data |
dataframe |
variable.pred |
the name of the variable to be predicted. |
model |
a penalized regression model(cv.glmnet). |
log.lambda |
numerical. Logarithm of lambda in case you don't want to use the optimal lambda. |
Create disjunctive columns to a data.frame.
datos.disyuntivos(data, var)
datos.disyuntivos(data, var)
data |
a data.frame object. |
var |
the column name to apply disjunctive code. |
data.frame
Diego Jimenez <[email protected]>
datos.disyuntivos(iris, "Species")
datos.disyuntivos(iris, "Species")
this function generates the call code of the scatter function.
disp_models(prediction, model_name, var_pred)
disp_models(prediction, model_name, var_pred)
prediction |
the name of the prediction object. |
model_name |
the name of the model. |
var_pred |
the name of the variable to be predicted. |
disp_models("prediction.knn", "KNN", "Species")
disp_models("prediction.knn", "KNN", "Species")
makes the graph of the tree.
dt_plot(model)
dt_plot(model)
model |
a decision trees model(rpart). |
Graph the coefficients and lambdas of a cv.glmnet model
e_coeff_landa( cv.glm, log.lambda = NULL, titles = c("Coeficientes", "Seleccionado", "Automatico") )
e_coeff_landa( cv.glm, log.lambda = NULL, titles = c("Coeficientes", "Seleccionado", "Automatico") )
cv.glm |
a cv.glmnet model. |
log.lambda |
number that specifies the logarithm of the selected lambda |
titles |
labels on the chart |
echarts4r plot
Ariel Arroyo <[email protected]>
Eval character vectors to JS code
e_JS(...)
e_JS(...)
... |
character vectors to evaluate |
Joseline Quiros <[email protected]>
e_JS('5 * 3')
e_JS('5 * 3')
Graph a cv.glmnet model
e_posib_lambda( cv.glm, log.lambda = NULL, titles = c("Error Cuadratico Medio", "Curva Inferior", "Curva Superior", "Seleccionado", "Automatico", "Coeficientes Distintos de Cero") )
e_posib_lambda( cv.glm, log.lambda = NULL, titles = c("Error Cuadratico Medio", "Curva Inferior", "Curva Superior", "Seleccionado", "Automatico", "Coeficientes Distintos de Cero") )
cv.glm |
a cv.glmnet model. |
log.lambda |
number that specifies the logarithm of the selected lambda |
titles |
labels on the chart |
echarts4r plot
Ariel Arroyo <[email protected]>
concat and execute a text in R.
exe(..., envir = parent.frame())
exe(..., envir = parent.frame())
... |
one or more texts to be concatenated and executed. |
envir |
the environment in which expr is to be evaluated. |
the result of the execute.
exe("5+5") exe("5","+","5") exe("plot(iris$Species)")
exe("5+5") exe("5","+","5") exe("plot(iris$Species)")
gets the code of a function in text form.
extract_code(funcion, envir = parent.frame())
extract_code(funcion, envir = parent.frame())
funcion |
the name of the function to be extracted. |
envir |
the environment in which expr is to be evaluated. |
extract_code("cat") extract_code("plot") parse(text = extract_code("plot"))
extract_code("cat") extract_code("plot") parse(text = extract_code("plot"))
calculates indices to measure accuracy of a model.
general_indices(real, prediccion)
general_indices(real, prediccion)
real |
the real values in traning-testing. |
prediccion |
the prediction values in traning-testing. |
a list with the Correlation, Relative Error, Mean Absolute Error and Root Mean Square Error.
real <- rnorm(45) prediction <- rnorm(45) model <- "KNN" general_indices(real, prediction)
real <- rnorm(45) prediction <- rnorm(45) model <- "KNN" general_indices(real, prediction)
graphs the importance of variables for the random forest model according to the percentage increase in mean square error.
importance_plot_rf( model.rf, titles = c("Importancia de Variables Segun el Porcentaje de Incremento del MSE", "Aumento porcentual del error cuadratico medio", "Variable") )
importance_plot_rf( model.rf, titles = c("Importancia de Variables Segun el Porcentaje de Incremento del MSE", "Aumento porcentual del error cuadratico medio", "Variable") )
model.rf |
a random forest model. |
titles |
labels on the chart |
echarts4r plot
Ariel Arroyo <[email protected]>
graph of the neural network.
nn_plot(model)
nn_plot(model)
model |
a neural network model(neuralnet) |
Generate a pair chart
pairs_power(data, decimals = 2)
pairs_power(data, decimals = 2)
data |
A DataFrame |
decimals |
Number of numbers after the decimal point. |
graph of variance explained in the predictors according to components used.
plot_pred_rd( model, n.comp, titles = c("Varianza Explicada en Predictores", "Numero de Componentes", "Porcentaje de Varianza Explicada") )
plot_pred_rd( model, n.comp, titles = c("Varianza Explicada en Predictores", "Numero de Componentes", "Porcentaje de Varianza Explicada") )
model |
a dimension reduction model. |
n.comp |
the optimum number of components. |
titles |
labels on the chart |
echarts4r plot
Ariel Arroyo <[email protected]>
scatter plot between the actual value of the variable to be predicted and the prediction of the model.
plot_real_prediction( real, prediction, model = "", titles = c("Predicciones vs Valores Reales", "Valor Real", "Prediccion") )
plot_real_prediction( real, prediction, model = "", titles = c("Predicciones vs Valores Reales", "Valor Real", "Prediccion") )
real |
the real values in traning-testing. |
prediction |
the prediction values in traning-testing. |
model |
the name of the model of the scatter plot. |
titles |
Labels on the chart |
echarts4r plot
Ariel Arroyo <[email protected]>
graph the root mean square error of cross validation according to components used.
plot_RMSE( model, n.comp, titles = c("RMSE Segun Numero de Componentes", "Numero de Componente", "RMSE") )
plot_RMSE( model, n.comp, titles = c("RMSE Segun Numero de Componentes", "Numero de Componente", "RMSE") )
model |
a dimension reduction model. |
n.comp |
the optimum number of components. |
titles |
labels on the chart |
echarts4r plot
Ariel Arroyo <[email protected]>
graph of the variance explained in the variable to predict according to the components used.
plot_var_pred_rd( model, n.comp, titles = c("Varianza Explicada en Variable a Predecir", "Numero de Componente", "Porcentaje de Varianza Explicada") )
plot_var_pred_rd( model, n.comp, titles = c("Varianza Explicada en Variable a Predecir", "Numero de Componente", "Porcentaje de Varianza Explicada") )
model |
a dimension reduction model. |
n.comp |
the optimum number of components. |
titles |
labels on the chart |
echarts4r plot
Ariel Arroyo <[email protected]>
generates a dimension reduction model.
rd_model(data, variable.pred, mode = 0, scale = TRUE)
rd_model(data, variable.pred, mode = 0, scale = TRUE)
data |
dataframe |
variable.pred |
the name of the variable to be predicted. |
mode |
the method of dimension reduction is defined as mode=1 is the MCP, and mode=0 the ACP. |
scale |
the scale parameter of the model. |
generates the prediction of a dimension reduction model.
rd_prediction(model, test.data, ncomp = NULL)
rd_prediction(model, test.data, ncomp = NULL)
model |
dimension reduction model(pcr/plsr). |
test.data |
dataframe. |
ncomp |
a numerical value in case you don't want to use the optimum number of components. |
get the information of the coefficients of the linear regression model
rl_coeff(modelo)
rl_coeff(modelo)
modelo |
linear regression model |
generates a penalized regression model.
rlr_model(data, variable.pred, alpha = 0, standardize = TRUE)
rlr_model(data, variable.pred, alpha = 0, standardize = TRUE)
data |
dataframe |
variable.pred |
the name of the variable to be predicted. |
alpha |
the alpha parameter of the model. |
standardize |
the standardize parameter of the model. |
generates the prediction of the penalized regression model.
rlr_prediction(model, test.data, variable.pred, log.lambda = NULL)
rlr_prediction(model, test.data, variable.pred, log.lambda = NULL)
model |
a penalized regression model(cv.glmnet). |
test.data |
dataframe. |
variable.pred |
the name of the variable to be predicted. |
log.lambda |
numerical. Logarithm of lambda in case you don't want to use the optimal lambda. |
returns the name of the penalty according to the alpha.
rlr_type(alpha_rlr = 0)
rlr_type(alpha_rlr = 0)
alpha_rlr |
the penalty is defined as alpha=1 is the lasso penalty, and alpha=0 the ridge penalty. |
rlr_type(1) rlr_type(0)
rlr_type(1) rlr_type(0)
Run the Shiny Application
run_app(...)
run_app(...)
... |
A series of options to be used inside the app. |
summarizes a variable by returning the minimum, first quartile, third quartile and maximum value.
summary_indices(data)
summary_indices(data)
data |
a numeric vector. |
summary_indices(iris$Sepal.Length)
summary_indices(iris$Sepal.Length)