LDL_ML_Main: Create, train, assess and return an ML prediction model.

View source: R/9ML_models_functions.R

LDL_ML_MainR Documentation

Create, train, assess and return an ML prediction model.

Description

This function reads data from a DATACSV.csv, or a data table file. It partitions them according to the partition parameter and labels them, trains the model (according to the ML method chosen and the first set of the partitioned data), assesses the model using the second set of the partition data and returns it.

Usage

LDL_ML_Main(DataCSV, partition, MLmethod, ReportMultiPlot = TRUE)

Arguments

DataCSV

The .csv or a data table file, path containing the data with which the model will be trained and assessed. Must contain at least 4 columns, named "CHOL", "HDL", "TG" and "LDLd", through which the train data and the validation data will be extracted.

partition

A value in the range (0,1) that stipulates what percentage of the input data will be used for training the model, while the remainder will be used to assess it.

MLmethod

A string that stipulates the Machine Learning method ("lm","rlm","glmnet","earth","svmRadial","knn","gbm","cubist" or "rf") that is to be used to train the prediction model with.

ReportMultiPlot

A boolean that allows the user to select whether the LDL_ML_Main function will plot a diagram with 5 plots, relating different stats on the newly created model. Preset to TRUE.

Value

It initializes and returns the ML prediction model. In case of bad input, it will return either -2 (illegitimate partition input) or -3 (illegitimate ML method input).

Examples

model = LDL_ML_Main(SampleData,0.7,"lm",ReportMultiPlot=FALSE)

LDLcalc documentation built on May 31, 2022, 5:07 p.m.