def test_OneHotEncoder(self): df = get_baseball_df() p = Pipeline([('e', OneHotEncoder(columns=['League']))]) df = p.transform(df) info(df)
def test_ScopedTransformer(self): df = get_baseball_df() p = Pipeline([('e', ScopedTransformer(transformer=MinMaxScaler(), columns=['RS']))]) df = p.fit_transform(df, []) info(df)
def transform(self, X: pd.DataFrame): info(X) return X
from sklearn.linear_model import Lasso from litkit.data import get_baseball_df from litkit.inspect import info m = Lasso() df = get_baseball_df() y = df['RS'] X = df[['RA', 'W', 'OBP', 'SLG']] m.fit(X, y) info(m)
def test_info(self): df = get_baseball_df() info(df) info(df.values)