fit_and_report: Fit and report

Description Usage Arguments Value Examples

View source: R/rb4model.R

Description

: fits a model and returns the train and validation errors as a list

Usage

1
fit_and_report(X, y, Xv, yv, method, m_type = "regression")

Arguments

X

The features of the training set

y

The target of the training set

Xv

The feature of the validation set

yv

The target of the validation set

method

A machine learning model, can either be classification or regression

m_type

The type for calculating error (default = 'regression')

Value

an array of train and validation error

Examples

1
2
3
4
5
x1<- iris[1:2][1:100,]
x2<-iris[1:2][100:150,]
y1<- iris$Petal.Length[1:100]
y2<-iris$Petal.Length[100:150]
result_r <- fit_and_report(x1,y1,x2,y2,'glm','regression')

UBC-MDS/rb4model documentation built on March 31, 2020, 12:54 a.m.