knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",

  # Customize output of figures
  out.width = '80%',
  fig.align = "center",
  fig.width = 7,
  fig.height = 5
)

This is how to get started with jofou.lib.

EDA function:

Load Libraries

Load the following Libraries

library(tidyverse)
library(jofou.lib)

Get the Iris data

The only requirement is that the data must have the type of variables your looking to summarize.

head(iris)

Make EDA with the my_inspect group functions

Step 1: Types of variables

Use my_inspect_types() to quickly get a summary of your data.

iris %>%
 my_inspect_types()

Step 2: Look at numeric variables

Use my_inspect_num() to quickly get a summary of your numerical variables.

iris %>%
 my_inspect_num()

Look at correlation between numerical variables.

iris %>%
 my_inspect_cor()

Look at the distribution of numeric variables.

iris %>%
 my_num_dist()

Look at the correlation between numeric variables.

iris %>%
 my_corr_num_graph()

Step 4: Look at categorical variables

Use my_inspect_cat() to quickly get a summary of your categorical variables.

iris %>%
 my_inspect_cat()

Or see the most frequently used categorical variables.

iris %>%
 my_inspect_imb()

Use my_cat_dist() to look at the distribution of categorical variables.

iris %>%
 my_cat_dist()

Step 4: Look at NAs

Use my_inspect_na() to quickly know where are the NAs in your data.

iris %>%
 my_inspect_na()

Utilities function:

Load Libraries

Load the following Libraries

library(tidyverse)
library(jofou.lib)

Get the Iris data

The only requirement is that the data must have the type of variables your looking to summarize.

head(iris)

Function 1: Calculate mode

Use calculate_mode() to quickly get the mode of your categorical variable.

iris %>%
  mutate(cat_Sepal.Length=round(Sepal.Length, digits = 0)) %>%
  group_by(cat_Sepal.Length) %>%
  summarise(mode_species=calculate_mode(Species))

Function 2: Not in

Use %ni%() remove value in variable.

iris %>%
  filter(Species %ni% "setosa") %>%
  group_by(Species) %>%
  summarise(nb=dplyr::n())

ML function:

Load Libraries

Load the following Libraries

library(tidyverse)
library(lubridate)
library(timetk)
library(parsnip)
library(rsample)
library(modeltime)
library(jofou.lib)

Prepare the data

data_prepared_tbl <- m4_monthly %>% filter(id == "M750")
# Split Data 80/20
splits <- initial_time_split(data_prepared_tbl, prop = 0.9)

Create a fitted model

model_fit_arima <- arima_reg() %>%
   set_engine(engine = "auto_arima") %>%
   fit(value ~ date, data = training(splits))

Function 1: Calibrate and plot

Use calibrate_and_plot() to quickly get the visual result of the fitted model.

calibrate_and_plot(model_fit_arima, type="testing")


Jofou/jofou.lib documentation built on May 22, 2022, 11:42 a.m.