Learn R Programming

PatientLevelPrediction (version 3.0.0)

toSparseTorchPython: Convert the plpData in COO format into a sparse python matrix using torch.sparse

Description

Converts the standard plpData to a sparse matrix firectly into python

Usage

toSparseTorchPython(plpData, population, map = NULL, temporal = F,
  pythonExePath = NULL)

Arguments

plpData

An object of type plpData with covariate in coo format - the patient level prediction data extracted from the CDM.

population

The population to include in the matrix

map

A covariate map (telling us the column number for covariates)

temporal

Whether to include timeId into tensor

pythonExePath

Location of python exe you want to use

Value

Returns a list, containing the python object name of the sparse matrix, the plpData covariateRef and a data.frame named map that tells us what covariate corresponds to each column This object is a list with the following components:

data

The python object name containing a sparse matrix with the rows corresponding to each person in the plpData and the columns corresponding to the covariates.

covariateRef

The plpData covariateRef.

map

A data.frame containing the data column ids and the corresponding covariateId from covariateRef.

Details

This function converts the covariate file from ffdf in COO format into a sparse matrix from the package Matrix

Examples

Run this code
# NOT RUN {
#TODO

# }

Run the code above in your browser using DataLab