Skip to content

Instantly share code, notes, and snippets.

@anand086
Created July 6, 2021 06:56
Show Gist options
  • Save anand086/3b10f51a9422e7242f6da4083736974f to your computer and use it in GitHub Desktop.
Save anand086/3b10f51a9422e7242f6da4083736974f to your computer and use it in GitHub Desktop.
from fastai.tabular.all import *
path = untar_data(URLs.ADULT_SAMPLE)
dls = TabularDataLoaders.from_csv(path/'adult.csv', path=path, y_names="salary",
cat_names = ['workclass', 'education', 'marital-status', 'occupation',
'relationship', 'race'],
cont_names = ['age', 'fnlwgt', 'education-num'],
procs = [Categorify, FillMissing, Normalize])
learn = tabular_learner(dls, metrics=accuracy)
learn.fit_one_cycle(3)
learn.show_results()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment