Open vincentarelbundock opened 9 months ago
import pandas
import polars as pl
from formulaic import model_matrix
from sklearn.linear_model import LinearRegression
df = pl.read_csv("https://vincentarelbundock.github.io/Rdatasets/csv/causaldata/thornton_hiv.csv")
y, X = model_matrix("got ~ distvct + tinc * age", df.to_pandas())
lr = LinearRegression()
lr.fit(X, y)
X.model_spec.variables
X.model_spec.formula
Do we care about this since there are no standard errors in scikit?
https://github.com/matthewwardrop/formulaic
Probably need another argument for the formula used to create
y
andX
inscikit-learn