Regression Loader#

class oxen.loaders.RegressionLoader(data_file, pred_name, f_names)#
__init__(data_file, pred_name, f_names)#

Extracts and formats relevant features and labels from a tabular dataset for use in regression tasks.

Parameters:
  • data_file (str) – Path to a tabular file containing the input features and prediction target for a regression task

  • pred_nam (str) – Column name in data_file containing the prediction target

  • f_names (list) – List of column names in data_file containing the input features

run()#
Returns:

  • outputs[0] (features) (pl.DataFrame) – DataFrame containing only the specified input features

  • outputs[1] (prediction) (pl.Series) – Series containing the prediction target

Usage#

from oxen import LocalRepo
from oxen.loaders import RegressionLoader

repo = LocalRepo()

# Demo data for supervised image classification
repo.clone("https://hub.oxen.ai/ba/dataloader-regression")

loader = RegressionLoader(
    data_file = f"{repo.path}/prices.csv",
    pred_name = "price",
    f_names = ["sqft", "num_bed", "num_bath"]
)

X, y = loader.run()