sampleToBayesFeatures {mmb}R Documentation

Transform an entire sample into a collection of Bayesian features.

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

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

# 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")

[Package mmb version 0.13.3 Index]