Learn R Programming

analysisPipelines (version 1.0.2)

getFeaturesForPyClassification: Extracts selected columns from a data frame as a Python array

Description

Extracts selected columns from a data frame as a Python array

Usage

getFeaturesForPyClassification(dataset, featureNames)

Arguments

dataset

an R data frame

featureNames

Column names to be extracted from the R data frames. A character vector.

Details

Helper function, which when provided an R data frame and a set of column/ feature names, extracts them from the R data frame as a matrix and converts them to the equivalent Python array.

Typically this function can be used when providing a feature matrix to a Python machine learning function

See Also

Other R helper utilities for Python: getTargetForPyClassification, setPythonEnvir

Examples

Run this code
# NOT RUN {
 getFeaturesForPyClassification(dataset = iris,
 featureNames = c("Sepal.Length", "Sepal.Width"))
# }

Run the code above in your browser using DataLab