createFeatureForBayes: Create a Bayesian feature by name and value.

Description Usage Arguments Value Author(s) See Also Examples

View source: R/bayesFeature.R

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

1
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

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

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