split.dataset: Split a dataset into a design (X) matrix and labels (Y), and...

View source: R/split.dataset.R View source: R/.ipynb_checkpoints/split.dataset-checkpoint.R

split.datasetR Documentation

Split a dataset into a design (X) matrix and labels (Y), and one-hot encodes factors. Does not need to be called by the user.

Description

Split a dataset into a design (X) matrix and labels (Y), and one-hot encodes factors. Does not need to be called by the user.

Usage

## S3 method for class 'dataset'
split(formula, data)

Arguments

formula

An object of class 'formula' describing the model to be fit, to determine X and Y.

data

A 'data.frame' containing the dataset to be split.

Value

A list containing the design matrix (X), and the Y values (one-hot encoded as necessary). If Y is a factor, then raw.Y is still factors, and levels contains the levels that the factor can take.


Greg-Hallenbeck/easy.mlp documentation built on March 10, 2023, 6:31 a.m.