dataframe-hasktorch-0.4.0.1: Converts between dataframes and hasktorch tensors
Safe HaskellNone
LanguageHaskell2010

DataFrame.Hasktorch

Synopsis

Documentation

toTensor :: DataFrame -> Tensor Source #

Convert a dataframe to a floating-point tensor of shape [rows, columns] (or [rows] when single-column). Throws DataFrameException if a column cannot be converted to float.

>>> toTensor df  -- where df has shape (100, 5)
Tensor with shape [100, 5]

toIntTensor :: DataFrame -> Tensor Source #

Convert a dataframe to an integer tensor of shape [rows, columns] (or [rows] when single-column). Floating-point values are rounded. Throws DataFrameException if a column cannot be converted to int.

>>> toIntTensor featuresDf  -- where featuresDf has shape (100, 3)
Tensor with shape [100, 3]