featureMatrix {penaltyLearning}R Documentation

featureMatrix

Description

Compute a feature matrix (segmentation problems x features).

Usage

featureMatrix(data.sequences, 
    problem.vars, data.var)

Arguments

data.sequences

data.frame of sorted sequences of data to segment.

problem.vars

character vector of columns of data.sequences to treat as segmentation problem IDs.

data.var

character vector of length 1 (column of data.sequences to treat as data to segment).

Value

Numeric feature matrix. Some entries may be missing or infinite; these columns should be removed before model training.

Author(s)

Toby Dylan Hocking

Examples


test.df <- data.frame(
  id=rep(1:2, each=10),
  x=rnorm(20))
penaltyLearning::featureMatrix(test.df, "id", "x")
if(requireNamespace("neuroblastoma")){
  data(neuroblastoma, package="neuroblastoma", envir=environment())
  one <- subset(neuroblastoma$profiles, profile.id %in% c(1,2))
  f.mat <- penaltyLearning::featureMatrix(
    one, c("profile.id", "chromosome"), "logratio")
}


[Package penaltyLearning version 2024.1.25 Index]