sampleToBayesFeatures: Transform an entire sample into a collection of Bayesian...

Description Usage Arguments Value Author(s) Examples

View source: R/bayesFeature.R

Description

Helper function that takes one sample (e.g., a row of a dataframe with validation data) and transforms it into a data.frame where each row corresponds to one feature (and its value) of the sample. This is done using @seealso createFeatureForBayes. This operation can be thought of transposing a matrix.

Usage

1
sampleToBayesFeatures(dfRow, targetCol)

Arguments

dfRow

a row of a data.frame with a value for each feature.

targetCol

the name of the feature (column in the data.frame) that is the target variable for classification or regression.

Value

a data.frame where the first row is the feature that represents the label.

Author(s)

Sebastian Hönel sebastian.honel@lnu.se

Examples

1
2
3
4
# Converts all features of iris; the result is a data.frame of length
# equal to the amount of features in iris (5). The first feature is
# targetCol (has isLabel=TRUE).
samp <- mmb::sampleToBayesFeatures(dfRow = iris[15,], targetCol = "Species")

mmb documentation built on Oct. 23, 2020, 5:21 p.m.