Given a data.frame with one or multiple features as constructed by @seealso createFeatureForBayes and a name, extracts the value of the feature specified by name.

getValueOfBayesFeatures(dfFeature, featName)

Arguments

dfFeature

a data.frame for a single feature or variable as constructed by @seealso createFeatureForBayes.

featName

the name of the feature or variable of which to obtain the value.

Value

the value of the feature.

Examples

feats <- rbind( mmb::createFeatureForBayes( "Petal.Width", value = mean(iris$Petal.Width)), mmb::createFeatureForBayes( name = "Species", iris[1,]$Species, isLabel = TRUE) ) print(mmb::getValueOfBayesFeatures(feats, "Species"))
#> [1] "setosa"
print(mmb::getValueOfBayesFeatures(feats, "Petal.Width"))
#> [1] 1.199333