Overview

This package re-implements the first step of the {MASTA} package to extract features from longitudinal encounter records. Compared to {MASTA}, the input data of {IFPCA} is more compact and memory efficent. Click HERE to view input data structure.

Installation

Install development version from GitHub.

# install.packages("remotes")
remotes::install_github("celehs/IFPCA")

Load the package into R.

library(IFPCA)

Data Example

Data Preparation

library(data.table)
i <- 3 # 1, 2, 3 
# time for each code (training + validation)
url <- "https://raw.githubusercontent.com/celehs/IFPCA/master/data-raw/"
time_code <- fread(paste0(url, "time_code", i, ".csv"))
time <- time_code$month
names(time) <- time_code$id
# follow up time for training and validation sets
follow_up_train <- fread(paste0(url, "follow_up_train.csv"))
follow_up_valid <- fread(paste0(url, "follow_up_valid.csv"))
fu_train <- follow_up_train$fu_time
fu_valid <- follow_up_valid$fu_time
names(fu_train) <- follow_up_train$id
names(fu_valid) <- follow_up_valid$id
str(fu_train)
str(fu_valid)

Feature Extraction

system.time(ans <- ifpca(time, fu_train, fu_valid))
data.table(ans$TrainFt) # Extracted Features (Training) 
data.table(ans$ValidFt) # Extracted Features (Validation)

References



celehs/IFPCA documentation built on Dec. 17, 2020, 10:21 p.m.