getTargetForPyClassification: Extracts selected column from a data frame a binary class...

Description Usage Arguments Details See Also Examples

View source: R/r-helper-utilites-python.R

Description

Extracts selected column from a data frame a binary class Python array

Usage

1
getTargetForPyClassification(dataset, targetVarName, positiveClass)

Arguments

dataset

an R data frame

targetVarName

Name of the target variable for classification. Should be a categorical variable.

positiveClass

Name of the class of the target variable which should be coded as '1'

Details

Helper function, which when provided an R dataframe and a binary categorical column, extracts it from the R data frame, converts it to 1/0 class coding, and converts it to a Python array

Typically this function can be used to extract a target variable for a classifier to be provided to a Python machine learning function

See Also

Other R helper utilities for Python: getFeaturesForPyClassification, setPythonEnvir

Examples

1
2
3
4
5
## Not run: 
getTargetForPyClassification(dataset = iris,
 targetVarName = "Species", positiveClass = "setosa")

## End(Not run)

analysisPipelines documentation built on July 1, 2020, 7:09 p.m.