| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
DataFrame.Transform.Serialize
Description
Persist and reload a fitted Transform.
A Transform is just an ordered list of named output expressions, so it
serializes through the same JSON wire format as any pipeline (see
DataFrame.Expr.Serialize). Save a fitted preprocessing/feature transform in one
process and reload it in another with applyTransform to run inference:
Right t <- loadTransformFromFile "scaler.json" let scored = applyTransform t newData
Documentation
encodeTransform :: Transform -> Either String Value Source #
Encode a transform's output expressions to JSON.
decodeTransform :: Value -> Either String Transform Source #
Decode a transform produced by encodeTransform.
saveTransformToFile :: FilePath -> Transform -> IO (Either String ()) Source #
Encode a transform and write it to a file. No file is written on failure.
loadTransformFromFile :: FilePath -> IO (Either String Transform) Source #
Load a transform produced by saveTransformToFile.