Import Data and handle it
The BI class can import data from a csv file or from a dictionary for data that can’t be stored in a tabular format.
Import tabular data from a csv file
m.data(data_path, sep=';') m$data(data_path, sep=';')Import non tabular data
First you need to create your own dictionary with the data.
m.data_on_model = dict(
ID1 = Value1,
ID2 = Value2,
)keys <- c("ID1","ID2")
values <- list(Value1,Value2)
data = py_dict(keys, values, convert = TRUE)
m$data_on_model=dataHandle data
For tabular data, you can use some functions to manipulate the data:
Perform one-hot encoding
OHE: One-hot encoding is a technique that converts categorical variables into binary variables. This is useful when you have a large number of categories and want to use them as features in a model.Create index encoding for categorical columns
index: Index encoding is a technique that assigns a unique integer value to each category in a categorical variable. This is useful when you have a large number of categories and want to use them as features in a model.Scale
scale: Standardize the data by subtracting the mean and dividing the result by the standard deviation X_i = \frac{X_i - \mu}{\sigma}.