Skip to content

Library Installation & Purpose

📦 Library Setup (for First Model Training)

These are the core packages you’ll need to train and evaluate your first neural model:

✅ 1. Install Everything

Run this once to install all required packages:
install.packages(c("dplyr", "lubridate", "jsonlite", "httr", "keras", "keras3", "tensorflow", "reticulate"))
Optional (recommended for modeling structure later)
install.packages("tidymodels") # Includes yardstick, recipes, parsnip, etc.

✅ 2. Load Libraries in Your Script

Put this at the top of your R file:
library(dplyr) # data wrangling (filter, mutate, join)
library(lubridate) # handle datetime fields like created_at or cancelled_at
library(jsonlite) # parse JSON responses from Recharge/Klaviyo APIs
library(httr) # make authenticated API requests
library(keras3) # modern neural network building (Keras v3)
library(tensorflow) # TensorFlow backend for keras3
library(reticulate) # Python bridge

❓ What Each Package Does

Purpose of Library
Package
Purpose
dplyr
Filter, mutate, join, and organize tabular data
lubridate
Makes it easy to convert and compare timestamps
jsonlite
Converts JSON → data.frame when pulling API data
httr
Sends API requests with headers, tokens, etc.
keras3
Build and train neural networks with clear syntax
tensorflow
Backend engine that runs keras3 models
reticulate
Allows R to use Python for heavy lifting
tidymodels
(Optional) A structured framework for modeling & evaluation
There are no rows in this table

✅ 3. Validate That Everything Works

Make sure the backend is wired correctly:
library(keras3)
library(tensorflow)

# Should output TensorFlow version
tensorflow::tf_config()
If you see an error, run:
tensorflow::install_tensorflow()
And restart your R session.

Load content from share.geckoboard.com?
Loading external content may reveal information to 3rd parties. Learn more
Allow
Load content from share.geckoboard.com?
Loading external content may reveal information to 3rd parties. Learn more
Allow
Want to print your doc?
This is not the way.
Try clicking the ··· in the right corner or using a keyboard shortcut (
CtrlP
) instead.