I have this code and the problem is when I try to fit it. It says
TypeError: an integer is required (got type NoneType)
Data is from Kaggle House Price Prediction competition.
Fastai version: 1.0.34
from fastai import *
from fastai.tabular import *
df = pd.read_csv('train.csv')
dep_var = 'SalePrice'
cat_names = []
cont_names = []
for label in df:
if label == 'SalePrice':
continue
if len(set(df[label])) > 30 and df[label].dtype != object:
cont_names.append(label)
else:
cat_names.append(label)
procs = [FillMissing, Categorify, Normalize]
data = (TabularList.from_df(df, path='', cat_names=cat_names, cont_names=cont_names, procs=procs)
.split_by_idx(range(800,1000))
.label_from_df(cols=dep_var)
.databunch())
data.show_batch(rows=10)
learn = tabular_learner(data, layers=[200,100], metrics=accuracy)
learn.model
learn.fit_one_cycle(1, 1e-2)