Description Usage Arguments Details See Also Examples
View source: R/r-helper-utilites-python.R
Extracts selected column from a data frame a binary class Python array
1 | getTargetForPyClassification(dataset, targetVarName, positiveClass)
|
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' |
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
Other R helper utilities for Python: getFeaturesForPyClassification
,
setPythonEnvir
1 2 3 4 5 | ## Not run:
getTargetForPyClassification(dataset = iris,
targetVarName = "Species", positiveClass = "setosa")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.