Skip to content

Instantly share code, notes, and snippets.

@holmesal
Created January 22, 2019 14:54
Show Gist options
  • Save holmesal/fc2d26f67caa52a44b4d92ed074f1cba to your computer and use it in GitHub Desktop.
Save holmesal/fc2d26f67caa52a44b4d92ed074f1cba to your computer and use it in GitHub Desktop.
# stick our data in a dataframe:
df = pd.DataFrame({'x': x, 'y': y});
# use 20% of our data for validation:
valid_idx = random.sample(list(df.index), int(0.2 * len(df)));
# what we're predicting:
dep_var = 'y'
# we don't have any categorical variables:
cat_names = []
# create a FastAI TabularDataBunch
data = TabularDataBunch.from_df(df=df,
dep_var=dep_var,
valid_idx=valid_idx,
cat_names=cat_names,
path=path,
bs=64,
procs=[])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment