Following is the code to run my tabular regression with v1:
cat_names=[...]
cont_names=[...]
dep_var=[...]
df = pd.read_csv('/content/gdrive/My Drive/data.csv')
data = (TabularList.from_df(df, path='.', cat_names=cat_names, cont_names=cont_names, procs=[Categorify, Normalize])
.split_by_rand_pct(valid_pct = 0.3, seed = 8888)
.label_from_df(cols=dep_var)
.databunch())
learn = tabular_learner(data, layers=[2000,2000,2000,2000,1000,500,500], metrics=exp_rmspe,emb_drop=0.2)
learn.lr_find()
learn.recorder.plot()
learn.unfreeze()
learn.fit_one_cycle(10, max_lr =lr,callbacks=[SaveModelCallback(learn,
monitor='valid_loss',
mode='min',
name='/content/gdrive/My Drive/'+jobname)])
learn.load('/content/gdrive/My Drive/'+jobname)
measure=(learn.validate(learn.data.train_dl),learn.validate(learn.data.valid_dl))
print("Validation:",measure,measure[0][0]+measure[1][0])
learn.recorder.plot()
learn.recorder.plot_losses()
learn.export('/content/gdrive/My Drive/m'+jobname)
learn2 = load_learner('/content/gdrive/My Drive/','m'+jobname)
learn2.data.valid_dl =data.valid_dl
%time res=learn2.get_preds(ds_type=DatasetType.Valid)
What are the fastai2 equivalent for these functions?