createFeatureForBayes {mmb}R Documentation

Create a Bayesian feature by name and value.

Description

Transforms a sample's feature's value into a dataframe, that holds its name, type and value. Currently supports numeric, factor, character and boolean values. Note that factor is internally converted to character.

Usage

createFeatureForBayes(name, value, isLabel = FALSE, isDiscrete = FALSE)

Arguments

name

the name of the feature or variable.

value

the value of the feature or variable.

isLabel

default FALSE. Indicates whether this feature or variable is the target variable (the label or value to predict).

isDiscrete

default FALSE. Used to indicate whether the feature or variable given is discrete. This will also be set to true if the value given is a charater, factor or a logical.

Value

A data.frame with one row holding all the feature's value's properties.

Author(s)

Sebastian Hönel sebastian.honel@lnu.se

See Also

sampleToBayesFeatures that uses this function

Examples

feat <- mmb::createFeatureForBayes(
  name = "Petal.Width", value = mean(iris$Petal.Width))
featTarget <- mmb::createFeatureForBayes(
  name = "Species", iris[1,]$Species, isLabel = TRUE)

[Package mmb version 0.13.3 Index]