sk_ds_to_tibble: Convert sci-kit learn dataset into a tibble

View source: R/utils.R

sk_ds_to_tibbleR Documentation

Convert sci-kit learn dataset into a tibble

Description

Convert sci-kit learn dataset into a tibble

Usage

sk_ds_to_tibble(data, include_group = T, feature_names = NULL)

Arguments

data

sci-kit learn data set

include_group

if TRUE appends group index to tibble and if group is numeric strats index at 1 instead of zero

feature_names

if not NULL tibble featre names

Value

tibble()

Examples

library(tidyverse)
library(sklearn)
ds <- sk_datasets()
n_samples <- 1500L
moons <- ds$make_moons(n_samples = n_samples, noise = .05)

df_moon <-
moons %>%
sk_ds_to_tibble(include_group = T, feature_names = c("x", "y", "group"))

df_moon %>% glimpse()

abresler/sklearn documentation built on July 27, 2023, 7:07 a.m.