segment {citrus}R Documentation

Segment Function

Description

Segments the data by running all steps in the segmentation pipeline, including output table

Usage

segment(
  data,
  modeltype = c("tree", "k-clusters"),
  FUN = NULL,
  FUN_preprocess = NULL,
  steps = c("preprocess", "model"),
  prettify = FALSE,
  print_plot = FALSE,
  hyperparameters = NULL,
  force = FALSE,
  verbose = FALSE
)

Arguments

data

data.frame, the data to segment

modeltype

character, the type of model to use to segment choices are: 'tree', 'k-clusters'

FUN

function, A user specified function to segment, if the standard methods are not wanting to be used

FUN_preprocess

function, A user specified function to preprocess, if the standard methods are not wanting to be used

steps

list, names of the steps the user want to run the data on. Options are 'preprocess' and 'model'

prettify

logical, TRUE if want cleaned up outputs, FALSE for raw output

print_plot

logical, TRUE if want to print the plot

hyperparameters

list of hyperparameters to use in the model.

force

logical, TRUE to ignore errors in validation step and force model execution.

verbose

logical whether information about the segmentation pipeline should be given.

Value

A list of three objects. A tibble providing high-level segment attributes, a lookup table (data frame) with the id and predicted segment number, and an rpart object defining the model.


[Package citrus version 1.0.2 Index]