Introduction

Here I will submit an entry to the Homesite Competition on Kaggle Competition using Google Colab to get a first pass submission going, but mainly ignore what was discovered in the initial exploratory data analysis at this time, since we want a baseline for comparison after applying what we learn there to see how it improves (or not) our submission then.

Setup fastai and Google drive

!pip install -Uqq fastai
from fastai.tabular.all import *

The snippet below is only useful in Colab for accessing my Google Drive and is straight out the fastbook source code in Github

global gdrive
gdrive = Path('/content/gdrive/My Drive')
from google.colab import drive
if not gdrive.exists(): drive.mount(str(gdrive.parent))

Only add the Kaggle bits below if I'm running locally, in Collab they're already here


!ls /content/gdrive/MyDrive/Kaggle/kaggle.json
/content/gdrive/MyDrive/Kaggle/kaggle.json

Useful links here:

Path.cwd()
Path('/content')

Setup kaggle environment parameters

!mkdir -p ~/.kaggle
!cp /content/gdrive/MyDrive/Kaggle/kaggle.json ~/.kaggle/
!chmod 600 ~/.kaggle/kaggle.json
from kaggle import api
path = Path.cwd()
path.ls()
(#4) [Path('/content/.config'),Path('/content/models'),Path('/content/gdrive'),Path('/content/sample_data')]
path = path/"gdrive/MyDrive/Kaggle/homesite_data"
path.mkdir(exist_ok=True)
Path.BASE_PATH = path
api.competition_download_cli('homesite-quote-conversion', path=path)
file_extract(path/"homesite-quote-conversion.zip")
file_extract(path/"train.csv.zip")
file_extract(path/"test.csv.zip")
homesite-quote-conversion.zip: Skipping, found more recently modified local copy (use --force to force download)
path
Path('.')
path.ls()
(#9) [Path('homesite-quote-conversion.zip'),Path('models'),Path('sample_submission.csv.zip'),Path('test.csv.zip'),Path('train.csv.zip'),Path('train.csv'),Path('test.csv'),Path('sample_submission.csv'),Path('submission.csv')]

Exploring the Homesite data

First set the random seed so that the results are reproducible

set_seed(42)
df_train = pd.read_csv(path/"train.csv", low_memory=False)
df_train.head()
QuoteNumber Original_Quote_Date QuoteConversion_Flag Field6 Field7 Field8 Field9 Field10 Field11 Field12 CoverageField1A CoverageField1B CoverageField2A CoverageField2B CoverageField3A CoverageField3B CoverageField4A CoverageField4B CoverageField5A CoverageField5B CoverageField6A CoverageField6B CoverageField8 CoverageField9 CoverageField11A CoverageField11B SalesField1A SalesField1B SalesField2A SalesField2B SalesField3 SalesField4 SalesField5 SalesField6 SalesField7 SalesField8 SalesField9 SalesField10 SalesField11 SalesField12 ... GeographicField44A GeographicField44B GeographicField45A GeographicField45B GeographicField46A GeographicField46B GeographicField47A GeographicField47B GeographicField48A GeographicField48B GeographicField49A GeographicField49B GeographicField50A GeographicField50B GeographicField51A GeographicField51B GeographicField52A GeographicField52B GeographicField53A GeographicField53B GeographicField54A GeographicField54B GeographicField55A GeographicField55B GeographicField56A GeographicField56B GeographicField57A GeographicField57B GeographicField58A GeographicField58B GeographicField59A GeographicField59B GeographicField60A GeographicField60B GeographicField61A GeographicField61B GeographicField62A GeographicField62B GeographicField63 GeographicField64
0 1 2013-08-16 0 B 23 0.9403 0.0006 965 1.0200 N 17 23 17 23 15 22 16 22 13 22 13 23 T D 2 1 7 18 3 8 0 5 5 24 V 48649 0 0 0 0 ... 8 4 20 22 10 8 6 5 15 13 19 18 16 14 21 23 21 23 16 11 22 24 7 14 -1 17 15 17 14 18 9 9 -1 8 -1 18 -1 10 N CA
1 2 2014-04-22 0 F 7 1.0006 0.0040 548 1.2433 N 6 8 6 8 5 7 5 8 13 22 13 23 T E 5 9 5 14 6 18 1 5 5 11 P 26778 0 0 1 1 ... 23 24 11 15 21 24 6 11 21 21 18 15 20 20 13 12 12 12 15 9 13 11 11 20 -1 9 18 21 8 7 10 10 -1 11 -1 17 -1 20 N NJ
2 4 2014-08-25 0 F 7 1.0006 0.0040 548 1.2433 N 7 12 7 12 6 10 7 11 25 25 13 23 T J 4 6 3 10 4 11 1 5 5 11 K 8751 0 0 2 2 ... 21 22 24 25 20 22 7 13 23 23 20 19 20 20 18 20 19 21 20 19 11 8 3 3 -1 5 21 24 12 15 15 18 -1 21 -1 11 -1 8 N NJ
3 6 2013-04-15 0 J 10 0.9769 0.0004 1,165 1.2665 N 3 2 3 2 2 2 3 2 13 22 13 23 Y F 15 23 8 19 14 24 0 5 5 23 V 43854 0 0 0 0 ... 3 1 14 22 6 2 7 14 11 8 19 18 18 16 13 12 13 12 17 13 5 2 3 4 -1 7 14 14 14 18 6 5 -1 10 -1 9 -1 21 N TX
4 8 2014-01-25 0 E 23 0.9472 0.0006 1,487 1.3045 N 8 13 8 13 7 11 7 13 13 22 13 23 T F 4 6 3 6 3 6 1 5 5 7 R 12505 1 0 0 0 ... 24 25 9 11 25 25 5 3 22 22 21 21 17 15 25 25 25 25 17 13 13 11 3 4 -1 7 11 9 10 10 18 22 -1 10 -1 11 -1 12 N IL

5 rows × 299 columns

df_train.shape
(260753, 299)
df_test = pd.read_csv(path/"test.csv", low_memory=False)
df_test.head()
QuoteNumber Original_Quote_Date Field6 Field7 Field8 Field9 Field10 Field11 Field12 CoverageField1A CoverageField1B CoverageField2A CoverageField2B CoverageField3A CoverageField3B CoverageField4A CoverageField4B CoverageField5A CoverageField5B CoverageField6A CoverageField6B CoverageField8 CoverageField9 CoverageField11A CoverageField11B SalesField1A SalesField1B SalesField2A SalesField2B SalesField3 SalesField4 SalesField5 SalesField6 SalesField7 SalesField8 SalesField9 SalesField10 SalesField11 SalesField12 SalesField13 ... GeographicField44A GeographicField44B GeographicField45A GeographicField45B GeographicField46A GeographicField46B GeographicField47A GeographicField47B GeographicField48A GeographicField48B GeographicField49A GeographicField49B GeographicField50A GeographicField50B GeographicField51A GeographicField51B GeographicField52A GeographicField52B GeographicField53A GeographicField53B GeographicField54A GeographicField54B GeographicField55A GeographicField55B GeographicField56A GeographicField56B GeographicField57A GeographicField57B GeographicField58A GeographicField58B GeographicField59A GeographicField59B GeographicField60A GeographicField60B GeographicField61A GeographicField61B GeographicField62A GeographicField62B GeographicField63 GeographicField64
0 3 2014-08-12 E 16 0.9364 0.0006 1,487 1.3045 N 4 4 4 4 3 3 3 4 13 22 13 23 Y K 13 22 6 16 9 21 0 5 5 11 P 67052 0 0 0 0 0 ... 22 23 9 12 25 25 6 9 4 2 16 12 20 20 2 2 2 1 1 1 10 7 25 25 -1 19 19 22 12 15 1 1 -1 1 -1 20 -1 25 Y IL
1 5 2013-09-07 F 11 0.9919 0.0038 564 1.1886 N 8 14 8 14 7 12 8 13 13 22 13 23 T E 4 5 3 6 3 6 1 5 5 4 R 27288 1 0 0 0 0 ... 23 24 12 21 23 25 7 11 16 14 13 6 17 15 7 5 7 5 13 7 14 14 7 14 -1 4 1 1 5 3 10 10 -1 5 -1 5 -1 21 N NJ
2 7 2013-03-29 F 15 0.8945 0.0038 564 1.0670 N 11 18 11 18 10 16 10 18 13 22 13 23 T E 3 3 5 14 3 9 1 5 5 23 V 65264 0 1 2 2 0 ... 16 18 9 10 14 16 6 8 20 19 17 14 16 13 20 22 20 22 20 18 10 7 4 7 -1 11 13 12 18 22 10 11 -1 20 -1 22 -1 11 N NJ
3 9 2015-03-21 K 21 0.8870 0.0004 1,113 1.2665 Y 14 22 15 22 13 20 22 25 13 22 13 23 Y F 5 9 9 20 5 16 1 5 5 11 R 32725 1 1 1 1 0 ... 11 11 9 10 11 13 15 21 14 12 17 13 10 6 20 22 20 22 19 16 12 11 4 6 -1 13 10 8 5 3 8 8 -1 13 -1 8 -1 21 N TX
4 10 2014-12-10 B 25 0.9153 0.0007 935 1.0200 N 4 5 4 5 4 4 4 5 13 22 13 23 Y D 12 21 1 1 3 6 0 5 5 11 T 56025 0 1 1 1 0 ... 9 8 25 25 9 3 9 18 7 4 16 12 13 9 8 6 8 6 11 5 19 21 13 21 -1 23 11 8 5 3 7 7 -1 3 -1 22 -1 21 N CA

5 rows × 298 columns

df_test.shape
(173836, 298)
y_column = df_train.columns.difference(df_test.columns)
y_column
Index(['QuoteConversion_Flag'], dtype='object')

From this it looks like QuoteConversion_Flag is the value we want to predict. Let's take a look at this

type(df_train.QuoteConversion_Flag)
pandas.core.series.Series
df_train.QuoteConversion_Flag.unique()
array([0, 1])
type(df_train.QuoteConversion_Flag.unique()[0])
numpy.int64

Make this a boolean for the purpose of generating predictions as a binary classification

df_train.QuoteConversion_Flag = df_train.QuoteConversion_Flag.astype(dtype='boolean')

Let's see how the training data outcomes are balanced

df_train.QuoteConversion_Flag.describe()
count     260753
unique         2
top        False
freq      211859
Name: QuoteConversion_Flag, dtype: object
train_data_balance = pd.DataFrame(df_train["QuoteConversion_Flag"]).groupby("QuoteConversion_Flag")
train_data_balance["QuoteConversion_Flag"].describe()
count unique top freq
QuoteConversion_Flag
False 211859 1 False 211859
True 48894 1 True 48894

We have about 5 times as many "No Sale" data rows as we do data that shows a successful sale happened. This data bias may have an impact on the effectiveness of our model to predict positive sales results

First things first

Learning from my colleague Tim's work already we know:

  • Quotenumber is unique so we can make it the index
  • Original_Quote_Date column should be set as a date type

Additionally, we should make sure to apply any changes to data types to both train and test data so predictions don't fail later on

df_train = df_train.set_index('QuoteNumber')
df_test = df_test.set_index('QuoteNumber')

We may have some NaN values for Original_Quote_Date in either the training or test dataset, but let's confirm there are none.

df_train['Original_Quote_Date'].isna().sum(), df_test['Original_Quote_Date'].isna().sum()
(0, 0)
df_train['Original_Quote_Date'] = pd.to_datetime(df_train['Original_Quote_Date'])
df_test['Original_Quote_Date'] = pd.to_datetime(df_test['Original_Quote_Date'])

Goal: Quick and dirty model training, assuming fastai defaults for everything

y_names = [y_column[0]]
y_names
['QuoteConversion_Flag']
cont_names, cat_names = cont_cat_split(df_train, dep_var=y_names)
len(cont_names), len(cat_names)
(151, 146)
"QuoteConversion_Flag" in cont_names, "QuoteConversion_Flag" in cat_names #Make sure we've gotten our y-column excluded
(False, False)
procs = [Categorify, FillMissing, Normalize]
splits = RandomSplitter()(range_of(df_train))
to = TabularPandas(df=df_train, procs=procs, cat_names=cat_names, cont_names=cont_names, y_names=y_names, splits=splits)
dls = to.dataloaders()
dls.valid.show_batch()
Original_Quote_Date Field6 Field10 Field12 CoverageField5A CoverageField5B CoverageField6A CoverageField6B CoverageField8 CoverageField9 SalesField3 SalesField4 SalesField5 SalesField7 SalesField9 SalesField10 SalesField11 SalesField13 SalesField14 SalesField15 PersonalField1 PersonalField2 PersonalField5 PersonalField6 PersonalField7 PersonalField8 PersonalField9 PersonalField11 PersonalField12 PersonalField13 PersonalField16 PersonalField17 PersonalField18 PersonalField19 PersonalField22 PersonalField23 PersonalField24 PersonalField25 PersonalField26 PersonalField27 PersonalField28 PersonalField29 PersonalField30 PersonalField31 PersonalField32 PersonalField33 PersonalField34 PersonalField35 PersonalField36 PersonalField37 PersonalField38 PersonalField39 PersonalField40 PersonalField41 PersonalField42 PersonalField43 PersonalField44 PersonalField45 PersonalField46 PersonalField47 PersonalField48 PersonalField49 PersonalField50 PersonalField51 PersonalField52 PersonalField53 PersonalField54 PersonalField55 PersonalField56 PersonalField57 PersonalField58 PersonalField59 PersonalField60 PersonalField61 PersonalField62 PersonalField63 PersonalField64 PersonalField65 PersonalField66 PersonalField67 PersonalField68 PersonalField69 PersonalField70 PersonalField71 PersonalField72 PersonalField73 PersonalField74 PersonalField75 PersonalField76 PersonalField77 PersonalField78 PersonalField79 PersonalField80 PersonalField81 PersonalField82 PersonalField83 PropertyField2A PropertyField3 PropertyField4 PropertyField5 PropertyField6 PropertyField7 PropertyField8 PropertyField9 PropertyField10 PropertyField11A PropertyField11B PropertyField12 PropertyField13 PropertyField14 PropertyField15 PropertyField17 PropertyField18 PropertyField19 PropertyField20 PropertyField22 PropertyField23 PropertyField27 PropertyField28 PropertyField30 PropertyField31 PropertyField32 PropertyField33 PropertyField34 PropertyField35 PropertyField36 PropertyField37 PropertyField38 GeographicField5A GeographicField5B GeographicField10A GeographicField10B GeographicField14A GeographicField14B GeographicField18A GeographicField21A GeographicField22A GeographicField22B GeographicField23A GeographicField56A GeographicField60A GeographicField61A GeographicField62A GeographicField62B GeographicField63 GeographicField64 PersonalField84_na PropertyField29_na Field7 Field8 Field9 Field11 CoverageField1A CoverageField1B CoverageField2A CoverageField2B CoverageField3A CoverageField3B CoverageField4A CoverageField4B CoverageField11A CoverageField11B SalesField1A SalesField1B SalesField2A SalesField2B SalesField6 SalesField8 SalesField12 PersonalField4A PersonalField4B PersonalField10A PersonalField10B PersonalField14 PersonalField15 PersonalField84 PropertyField1A PropertyField1B PropertyField2B PropertyField16A PropertyField16B PropertyField21A PropertyField21B PropertyField24A PropertyField24B PropertyField25 PropertyField26A PropertyField26B PropertyField29 PropertyField39A PropertyField39B GeographicField1A GeographicField1B GeographicField2A GeographicField2B GeographicField3A GeographicField3B GeographicField4A GeographicField4B GeographicField6A GeographicField6B GeographicField7A GeographicField7B GeographicField8A GeographicField8B GeographicField9A GeographicField9B GeographicField11A GeographicField11B GeographicField12A GeographicField12B GeographicField13A GeographicField13B GeographicField15A GeographicField15B GeographicField16A GeographicField16B GeographicField17A GeographicField17B GeographicField18B GeographicField19A GeographicField19B GeographicField20A GeographicField20B GeographicField21B GeographicField23B GeographicField24A GeographicField24B GeographicField25A GeographicField25B GeographicField26A GeographicField26B GeographicField27A GeographicField27B GeographicField28A GeographicField28B GeographicField29A GeographicField29B GeographicField30A GeographicField30B GeographicField31A GeographicField31B GeographicField32A GeographicField32B GeographicField33A GeographicField33B GeographicField34A GeographicField34B GeographicField35A GeographicField35B GeographicField36A GeographicField36B GeographicField37A GeographicField37B GeographicField38A GeographicField38B GeographicField39A GeographicField39B GeographicField40A GeographicField40B GeographicField41A GeographicField41B GeographicField42A GeographicField42B GeographicField43A GeographicField43B GeographicField44A GeographicField44B GeographicField45A GeographicField45B GeographicField46A GeographicField46B GeographicField47A GeographicField47B GeographicField48A GeographicField48B GeographicField49A GeographicField49B GeographicField50A GeographicField50B GeographicField51A GeographicField51B GeographicField52A GeographicField52B GeographicField53A GeographicField53B GeographicField54A GeographicField54B GeographicField55A GeographicField55B GeographicField56B GeographicField57A GeographicField57B GeographicField58A GeographicField58B GeographicField59A GeographicField59B GeographicField60B GeographicField61B QuoteConversion_Flag
0 2015-01-02 J 1,113 N 1 2 1 6 X C 0 5 5 V 0 1 1 1 1 1 1 1 7 0 N 1 2 0 1 2 XB YJ ZP YJ 1 0 0 0 0 0 1 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 -1 N N Y 0 J 1 0 1 -1 21 4 2 C 2 1 2 0 0 2 1 6 B Y K Y G N 2 N N N -1 13 -1 25 -1 24 -1 -1 -1 15 -1 -1 -1 -1 -1 15 N TX True True 26.0 0.8870 0.0004 1.2665 5.0 7.0 5.0 7.0 5.000000 6.0 5.0 7.0 25.0 25.0 25.0 25.0 25.0 25.0 11.000000 6253.999581 1.000000e+00 8.0 10.0 6.0 10.0 2.0 19.0 2.0 8.000000 12.0 24.0 3.0 4.0 5.0 7.0 6.0 9.0 1.0 12.000000 18.0 -7.737822e-13 13.0 16.0 8.0 17.0 -1.0 -1.0 6.0 6.0 18.0 20.0 23.0 24.0 24.0 25.0 23.0 24.0 20.0 23.0 24.999999 25.0 25.0 25.0 25.0 25.0 24.0 24.0 19.0 24.0 2.000000 2.0 9.0 11.0 13.0 5.0 15.0 14.0 22.0 24.0 25.0 19.000000 21.0 10.0 14.0 24.0 25.0 5.0 7.0 4.0 3.0 6.0 7.0 5.0 4.0 12.0 20.0 4.000000 3.0 7.0 6.0 3.0 3.0 5.0 4.0 5.0 11.0 4.0 3.0 4.0 5.0 15.0 23.0 14.0 10.0 9.0 10.0 11.0 15.0 11.0 11.0 9.0 11.0 12.0 14.0 13.0 21.0 -1.0 -1.0 -1.0 -1.0 -1.000000 -1.0 -1.0 -1.0 -1.000001 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 13.0 13.0 9.000000 8.0 6.0 4.0 5.0 12.0 False
1 2013-05-21 B 965 N 13 22 13 23 T D 0 5 5 P 0 0 0 0 0 0 0 0 7 0 N 1 2 0 1 2 ZA ZE XR XD 1 0 0 0 0 1 2 2 0 1 1 1 1 0 0 0 0 0 0 0 0 1 0 1 1 1 2 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 1 1 1 2 0 0 0 0 1 -1 N N Y 0 D 0 0 1 -1 21 2 2 C 4 4 3 0 0 2 1 13 B N K N G Y 2 N N N -1 13 -1 25 -1 7 -1 -1 -1 15 -1 -1 -1 -1 -1 24 N CA False False 23.0 0.9403 0.0006 1.0200 25.0 25.0 25.0 25.0 22.999999 25.0 25.0 25.0 1.0 1.0 17.0 24.0 5.0 17.0 15.000000 8001.001088 2.523887e-08 -1.0 -1.0 8.0 16.0 4.0 24.0 2.0 15.000000 20.0 12.0 24.0 25.0 25.0 25.0 15.0 21.0 3.0 5.000000 5.0 -7.737822e-13 1.0 1.0 8.0 17.0 25.0 25.0 19.0 21.0 10.0 9.0 2.0 6.0 4.0 6.0 2.0 6.0 2.0 8.0 2.000000 4.0 3.0 5.0 2.0 5.0 6.0 6.0 2.0 6.0 21.000000 25.0 21.0 3.0 5.0 4.0 9.0 9.0 7.0 17.0 16.0 19.000000 22.0 16.0 19.0 21.0 20.0 25.0 25.0 22.0 25.0 9.0 15.0 12.0 19.0 6.0 10.0 20.999999 24.0 25.0 25.0 17.0 24.0 11.0 17.0 4.0 9.0 7.0 8.0 9.0 17.0 2.0 5.0 14.0 11.0 7.0 8.0 5.0 5.0 7.0 3.0 22.0 23.0 10.0 10.0 9.0 18.0 24.0 24.0 21.0 22.0 23.000000 24.0 24.0 25.0 25.000000 25.0 22.0 23.0 14.0 14.0 3.0 4.0 10.0 22.0 24.0 1.000000 1.0 14.0 18.0 23.0 2.0 False
2 2013-12-26 J 1,165 N 13 22 13 23 Y A 1 4 3 Q 0 0 0 0 0 0 1 1 7 0 N 1 2 0 1 2 XQ ZK XF ZN 1 0 0 0 0 0 1 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 -1 N N Y 0 O 1 0 1 -1 21 4 3 C 2 0 4 0 0 2 2 10 B N M Y G N 2 N N N -1 23 -1 25 -1 10 -1 -1 -1 15 -1 -1 -1 -1 -1 21 N TX True True 1.0 0.8922 0.0004 1.2665 11.0 19.0 11.0 19.0 15.000000 22.0 11.0 18.0 6.0 12.0 7.0 19.0 5.0 16.0 20.000000 42071.999796 2.523887e-08 8.0 11.0 7.0 14.0 1.0 10.0 2.0 2.000000 1.0 4.0 8.0 16.0 11.0 19.0 19.0 23.0 1.0 24.999999 25.0 -7.737822e-13 18.0 22.0 3.0 6.0 10.0 7.0 11.0 12.0 20.0 22.0 3.0 10.0 23.0 23.0 6.0 16.0 6.0 14.0 3.000000 10.0 23.0 22.0 5.0 16.0 24.0 23.0 7.0 15.0 2.000000 9.0 13.0 7.0 9.0 7.0 17.0 5.0 10.0 21.0 23.0 19.000000 21.0 10.0 13.0 24.0 25.0 4.0 4.0 5.0 4.0 4.0 3.0 7.0 9.0 4.0 5.0 5.000000 4.0 3.0 2.0 4.0 4.0 2.0 2.0 2.0 2.0 2.0 1.0 4.0 5.0 5.0 10.0 17.0 15.0 7.0 7.0 10.0 14.0 9.0 6.0 1.0 1.0 4.0 1.0 6.0 5.0 13.0 11.0 22.0 23.0 23.000000 23.0 14.0 14.0 14.000000 15.0 19.0 16.0 1.0 1.0 5.0 9.0 5.0 10.0 7.0 16.000000 20.0 7.0 6.0 9.0 16.0 False
3 2014-06-12 E 1,487 N 1 2 1 6 T F 1 5 5 Q 0 0 0 0 0 0 1 1 7 0 N 1 3 0 5 2 XR ZQ ZW XC 1 0 0 0 0 0 1 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 -1 N N Y 0 R 0 0 1 -1 21 3 1 A 9 1 1 0 0 2 1 4 B N O N G N 0 N Y N -1 13 -1 25 -1 17 -1 -1 25 25 -1 -1 -1 -1 -1 11 N IL True True 16.0 0.9392 0.0006 1.3045 8.0 13.0 8.0 13.0 11.000000 18.0 7.0 12.0 4.0 6.0 4.0 11.0 4.0 12.0 11.000000 12451.999162 2.523887e-08 5.0 5.0 -1.0 -1.0 2.0 6.0 2.0 24.999999 25.0 12.0 5.0 10.0 8.0 13.0 5.0 6.0 2.0 3.000000 3.0 -7.737822e-13 5.0 4.0 6.0 13.0 18.0 19.0 14.0 16.0 14.0 14.0 9.0 17.0 11.0 17.0 9.0 17.0 14.0 17.0 9.000000 17.0 13.0 17.0 9.0 17.0 9.0 12.0 7.0 16.0 2.000000 7.0 16.0 19.0 17.0 4.0 11.0 23.0 18.0 1.0 1.0 0.999999 1.0 1.0 1.0 1.0 1.0 5.0 6.0 8.0 10.0 6.0 9.0 13.0 20.0 9.0 15.0 7.000000 10.0 10.0 11.0 10.0 18.0 6.0 5.0 3.0 7.0 6.0 7.0 3.0 4.0 7.0 11.0 18.0 17.0 17.0 22.0 12.0 18.0 20.0 21.0 12.0 21.0 18.0 19.0 6.0 7.0 20.0 20.0 21.0 21.0 17.000000 14.0 20.0 22.0 20.000000 22.0 21.0 20.0 14.0 13.0 3.0 5.0 7.0 14.0 14.0 10.000000 11.0 15.0 18.0 19.0 7.0 False
4 2013-09-05 B 965 N 13 22 1 6 Y E 1 4 3 Q 0 0 0 0 0 0 1 1 7 0 N 1 2 0 1 2 ZA ZE XR XD 1 0 0 0 0 1 2 2 0 1 1 1 1 0 0 0 0 0 0 0 0 1 0 1 1 1 2 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 1 1 1 2 0 0 0 0 1 -1 N N Y 0 O 1 0 1 -1 21 4 2 C 4 1 3 0 0 2 4 4 B N N Y H Y 1 N N N -1 13 -1 25 -1 7 -1 -1 -1 15 -1 -1 -1 -1 -1 14 N CA False True 25.0 0.9403 0.0006 1.0200 11.0 18.0 11.0 19.0 15.000000 22.0 11.0 18.0 6.0 12.0 6.0 16.0 4.0 13.0 21.000000 44150.000527 2.523887e-08 18.0 22.0 25.0 25.0 2.0 24.0 2.0 5.000000 7.0 19.0 10.0 19.0 11.0 18.0 12.0 18.0 2.0 8.000000 11.0 -7.737822e-13 11.0 12.0 10.0 20.0 12.0 11.0 12.0 14.0 18.0 21.0 2.0 4.0 2.0 2.0 1.0 1.0 2.0 3.0 2.000000 6.0 1.0 1.0 2.0 2.0 1.0 2.0 1.0 2.0 22.000001 25.0 24.0 2.0 3.0 3.0 6.0 6.0 4.0 18.0 18.0 23.000000 24.0 22.0 24.0 22.0 22.0 9.0 14.0 15.0 22.0 5.0 6.0 9.0 13.0 25.0 25.0 10.000000 16.0 8.0 7.0 8.0 14.0 7.0 8.0 5.0 11.0 16.0 23.0 4.0 6.0 2.0 1.0 2.0 4.0 7.0 7.0 8.0 7.0 11.0 10.0 3.0 5.0 10.0 9.0 22.0 24.0 15.0 13.0 16.0 11.0 11.000000 6.0 20.0 22.0 19.000000 22.0 16.0 11.0 17.0 18.0 9.0 17.0 16.0 10.0 7.0 20.000000 23.0 8.0 8.0 10.0 5.0 False
5 2014-05-13 J 1,113 N 13 22 25 25 Y A 1 5 5 P 0 0 0 0 0 0 1 1 6 1 Y 1 2 0 1 2 XS XV ZW YN 1 0 0 0 0 0 1 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 25 N N Y 0 I 1 0 1 -1 21 4 0 B 2 2 3 1 0 2 9 10 B N O N H N 0 N N N -1 22 -1 25 -1 21 -1 -1 -1 15 -1 -1 -1 25 -1 16 N TX True True 26.0 0.8928 0.0004 1.2665 13.0 21.0 13.0 21.0 12.000000 19.0 13.0 20.0 5.0 10.0 10.0 22.0 6.0 18.0 11.000000 61651.999632 2.523887e-08 9.0 12.0 17.0 22.0 5.0 10.0 2.0 11.000000 15.0 25.0 7.0 14.0 13.0 21.0 21.0 24.0 1.0 24.999999 25.0 -7.737822e-13 17.0 21.0 2.0 1.0 8.0 6.0 14.0 16.0 6.0 3.0 14.0 22.0 23.0 23.0 15.0 22.0 20.0 22.0 15.000000 22.0 22.0 22.0 16.0 22.0 24.0 23.0 13.0 22.0 2.000000 2.0 2.0 10.0 12.0 2.0 3.0 4.0 23.0 24.0 25.0 15.000000 13.0 8.0 11.0 20.0 18.0 7.0 10.0 5.0 5.0 8.0 14.0 6.0 7.0 6.0 10.0 3.000000 2.0 10.0 11.0 3.0 3.0 12.0 19.0 1.0 1.0 9.0 14.0 10.0 19.0 10.0 17.0 8.0 6.0 13.0 17.0 3.0 4.0 9.0 8.0 11.0 16.0 16.0 18.0 10.0 18.0 9.0 6.0 18.0 16.0 18.000000 17.0 4.0 3.0 5.000000 3.0 20.0 17.0 11.0 8.0 5.0 9.0 19.0 13.0 12.0 25.000001 25.0 1.0 1.0 15.0 25.0 False
6 2014-05-28 J 1,113 N 13 22 13 23 T F 1 5 5 P 0 0 0 0 0 0 1 1 7 0 N 1 3 0 5 2 XO XE YF XX 1 0 0 0 0 0 1 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 -1 N N Y 0 I 1 0 1 -1 21 4 2 C 1 0 2 1 0 2 1 17 B N K N E N 0 N Y N -1 24 -1 25 -1 16 -1 -1 -1 15 -1 -1 -1 -1 -1 15 N TX True True 26.0 0.8928 0.0004 1.2665 5.0 8.0 6.0 8.0 5.000000 7.0 5.0 7.0 5.0 9.0 11.0 22.0 13.0 24.0 11.000000 3548.000679 2.523887e-08 1.0 1.0 -1.0 -1.0 1.0 13.0 2.0 3.000000 3.0 10.0 7.0 15.0 5.0 8.0 5.0 7.0 3.0 1.000000 1.0 -7.737822e-13 11.0 12.0 10.0 20.0 11.0 10.0 14.0 16.0 1.0 1.0 12.0 20.0 23.0 22.0 13.0 20.0 15.0 19.0 14.000000 20.0 22.0 22.0 14.0 20.0 23.0 20.0 8.0 18.0 2.000000 6.0 16.0 9.0 11.0 3.0 6.0 5.0 21.0 19.0 20.0 13.000000 10.0 7.0 10.0 16.0 14.0 8.0 13.0 11.0 17.0 8.0 14.0 6.0 7.0 3.0 2.0 13.000000 20.0 6.0 5.0 25.0 25.0 10.0 14.0 6.0 14.0 6.0 7.0 5.0 9.0 8.0 12.0 13.0 9.0 12.0 15.0 21.0 23.0 8.0 5.0 11.0 18.0 14.0 17.0 8.0 16.0 12.0 10.0 22.0 23.0 23.000000 24.0 15.0 15.0 16.000000 17.0 24.0 24.0 22.0 24.0 1.0 1.0 4.0 23.0 24.0 8.000000 8.0 6.0 4.0 23.0 2.0 False
7 2013-07-12 F 564 N 13 22 13 23 T E 1 5 5 T 0 1 4 0 0 0 1 1 7 0 N 1 2 0 1 2 ZT XR YQ ZV 1 0 0 0 0 0 1 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 -1 N N Y 0 R 1 0 1 -1 21 1 1 A 4 0 1 1 0 2 1 4 B N K Y E Y 1 N N N -1 17 -1 25 -1 15 -1 -1 -1 17 -1 -1 -1 -1 -1 21 N NJ True True 11.0 0.9919 0.0038 1.1886 4.0 5.0 4.0 5.0 4.000000 4.0 4.0 5.0 6.0 11.0 4.0 11.0 5.0 17.0 0.999999 27491.000189 4.000000e+00 9.0 12.0 10.0 19.0 2.0 16.0 2.0 23.000000 24.0 10.0 4.0 6.0 4.0 5.0 4.0 5.0 2.0 3.000000 2.0 -7.737822e-13 12.0 13.0 8.0 17.0 11.0 9.0 2.0 2.0 14.0 15.0 5.0 14.0 10.0 16.0 5.0 15.0 6.0 15.0 4.000000 15.0 10.0 16.0 5.0 16.0 11.0 17.0 6.0 15.0 2.000000 12.0 18.0 22.0 22.0 22.0 24.0 17.0 18.0 21.0 22.0 18.000000 19.0 13.0 17.0 22.0 21.0 8.0 13.0 6.0 6.0 12.0 21.0 5.0 5.0 10.0 16.0 7.000000 9.0 13.0 17.0 10.0 17.0 11.0 18.0 9.0 19.0 14.0 22.0 4.0 5.0 11.0 18.0 22.0 19.0 14.0 19.0 11.0 15.0 20.0 21.0 8.0 9.0 20.0 21.0 6.0 7.0 11.0 8.0 6.0 2.0 6.000000 3.0 9.0 7.0 9.000000 7.0 14.0 8.0 15.0 15.0 9.0 17.0 14.0 11.0 9.0 15.000000 19.0 4.0 3.0 1.0 21.0 False
8 2014-01-27 F 548 N 13 22 13 23 T E 0 5 5 K 0 0 0 0 0 0 1 1 7 0 N 1 3 0 5 2 XR ZQ ZW XC 1 0 0 0 0 0 1 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 -1 N N Y 0 R 1 0 1 -1 21 4 1 C 1 1 2 5 0 2 1 15 A N O N G Y 1 N Y N -1 18 -1 25 -1 13 -1 -1 -1 19 -1 -1 -1 -1 -1 9 N NJ True True 11.0 0.9838 0.0040 1.1886 7.0 12.0 7.0 12.0 6.000000 10.0 7.0 11.0 4.0 6.0 3.0 7.0 3.0 8.0 7.000000 36990.000050 2.523887e-08 5.0 5.0 -1.0 -1.0 1.0 6.0 2.0 8.000000 12.0 24.0 6.0 11.0 7.0 12.0 5.0 6.0 2.0 4.000000 3.0 -7.737822e-13 7.0 5.0 5.0 9.0 19.0 19.0 18.0 21.0 14.0 15.0 4.0 13.0 9.0 13.0 5.0 13.0 5.0 12.0 4.000000 15.0 8.0 13.0 5.0 14.0 9.0 11.0 5.0 12.0 2.000000 12.0 19.0 20.0 19.0 18.0 21.0 19.0 11.0 10.0 4.0 8.000000 3.0 3.0 2.0 11.0 3.0 4.0 4.0 7.0 8.0 6.0 6.0 9.0 13.0 8.0 13.0 4.000000 3.0 6.0 4.0 8.0 14.0 9.0 12.0 2.0 1.0 5.0 5.0 2.0 2.0 10.0 16.0 23.0 21.0 9.0 11.0 11.0 15.0 18.0 19.0 10.0 14.0 15.0 17.0 6.0 11.0 20.0 20.0 17.0 14.0 20.000000 20.0 14.0 14.0 14.000000 14.0 19.0 15.0 10.0 7.0 7.0 13.0 4.0 6.0 3.0 1.000000 1.0 12.0 15.0 21.0 5.0 False
9 2013-01-15 E 1,480 N 13 22 25 25 Y A 1 3 4 P 0 0 0 0 0 0 1 1 7 0 N 1 2 0 1 2 XB XV YG XX 1 0 0 0 0 0 1 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 -1 N N Y 0 J 1 0 1 -1 21 1 3 C 4 1 2 1 0 2 1 3 B N O Y H N 2 N N N -1 13 -1 25 -1 22 -1 25 -1 24 -1 -1 -1 -1 -1 24 Y IL True True 8.0 0.9368 0.0006 1.2714 14.0 21.0 14.0 21.0 12.000000 20.0 13.0 21.0 5.0 9.0 6.0 17.0 3.0 11.0 23.000000 18181.999560 2.523887e-08 13.0 16.0 6.0 12.0 5.0 14.0 2.0 3.000000 3.0 12.0 8.0 17.0 14.0 21.0 17.0 22.0 2.0 11.000000 16.0 -7.737822e-13 12.0 13.0 7.0 16.0 8.0 5.0 9.0 9.0 9.0 7.0 10.0 19.0 12.0 18.0 10.0 19.0 16.0 19.0 9.000000 18.0 13.0 18.0 10.0 18.0 10.0 15.0 11.0 22.0 2.000000 8.0 11.0 20.0 19.0 5.0 13.0 25.0 15.0 16.0 15.0 17.000000 17.0 10.0 13.0 21.0 20.0 3.0 2.0 5.0 5.0 4.0 3.0 10.0 15.0 4.0 5.0 10.000000 15.0 11.0 14.0 8.0 13.0 6.0 6.0 10.0 20.0 6.0 8.0 8.0 16.0 7.0 11.0 17.0 15.0 13.0 17.0 11.0 17.0 19.0 20.0 10.0 13.0 9.0 5.0 6.0 5.0 10.0 7.0 8.0 2.0 1.999999 1.0 25.0 25.0 25.000000 25.0 18.0 15.0 22.0 24.0 3.0 5.0 2.0 18.0 21.0 16.000000 21.0 18.0 22.0 10.0 8.0 False
roc_auc_binary = RocAucBinary()
learn = tabular_learner(dls, metrics=roc_auc_binary)
type(roc_auc_binary)
fastai.metrics.AccumMetric
learn.lr_find()
SuggestedLRs(valley=tensor(0.0025))

Note I ran fit_one_cycle with a value of 10 when prepping this notebook for publishing, but the test results came out suspiciously high on 1 outputs, given that the test submission I ran before was heavily weighted with 0 outputs and got a 0.83 score when I ran with 5 but I didn't set the random seed value then, so hopefully by setting the random seed this learning rate recommendation won't change when I run this notebook again later.

learn.fit_one_cycle(5, 0.0025)
epoch train_loss valid_loss roc_auc_score time
0 0.191083 0.190373 0.956380 01:57
1 0.182042 1.114478 0.961028 01:58
2 0.170142 0.192774 0.961783 01:58
3 0.160787 0.401845 0.963326 01:58
4 0.153714 0.460429 0.962740 01:58

Referenced another Kaggle notebook for this, we don't need it but it's good to see what fastai metrics is actually packaging up for you

preds, targs = learn.get_preds()
from sklearn.metrics import roc_auc_score
valid_score = roc_auc_score(to_np(targs), to_np(preds[:,1]))
valid_score
0.9627402127903286
to_test = TabularPandas(df=df_test, procs=procs, cat_names=cat_names, cont_names=cont_names)
test_dls = to_test.dataloaders()
test_dls.show_batch()
Original_Quote_Date Field6 Field10 Field12 CoverageField5A CoverageField5B CoverageField6A CoverageField6B CoverageField8 CoverageField9 SalesField3 SalesField4 SalesField5 SalesField7 SalesField9 SalesField10 SalesField11 SalesField13 SalesField14 SalesField15 PersonalField1 PersonalField2 PersonalField5 PersonalField6 PersonalField7 PersonalField8 PersonalField9 PersonalField11 PersonalField12 PersonalField13 PersonalField16 PersonalField17 PersonalField18 PersonalField19 PersonalField22 PersonalField23 PersonalField24 PersonalField25 PersonalField26 PersonalField27 PersonalField28 PersonalField29 PersonalField30 PersonalField31 PersonalField32 PersonalField33 PersonalField34 PersonalField35 PersonalField36 PersonalField37 PersonalField38 PersonalField39 PersonalField40 PersonalField41 PersonalField42 PersonalField43 PersonalField44 PersonalField45 PersonalField46 PersonalField47 PersonalField48 PersonalField49 PersonalField50 PersonalField51 PersonalField52 PersonalField53 PersonalField54 PersonalField55 PersonalField56 PersonalField57 PersonalField58 PersonalField59 PersonalField60 PersonalField61 PersonalField62 PersonalField63 PersonalField64 PersonalField65 PersonalField66 PersonalField67 PersonalField68 PersonalField69 PersonalField70 PersonalField71 PersonalField72 PersonalField73 PersonalField74 PersonalField75 PersonalField76 PersonalField77 PersonalField78 PersonalField79 PersonalField80 PersonalField81 PersonalField82 PersonalField83 PropertyField2A PropertyField3 PropertyField4 PropertyField5 PropertyField6 PropertyField7 PropertyField8 PropertyField9 PropertyField10 PropertyField11A PropertyField11B PropertyField12 PropertyField13 PropertyField14 PropertyField15 PropertyField17 PropertyField18 PropertyField19 PropertyField20 PropertyField22 PropertyField23 PropertyField27 PropertyField28 PropertyField30 PropertyField31 PropertyField32 PropertyField33 PropertyField34 PropertyField35 PropertyField36 PropertyField37 PropertyField38 GeographicField5A GeographicField5B GeographicField10A GeographicField10B GeographicField14A GeographicField14B GeographicField18A GeographicField21A GeographicField22A GeographicField22B GeographicField23A GeographicField56A GeographicField60A GeographicField61A GeographicField62A GeographicField62B GeographicField63 GeographicField64 PersonalField84_na PropertyField29_na Field7 Field8 Field9 Field11 CoverageField1A CoverageField1B CoverageField2A CoverageField2B CoverageField3A CoverageField3B CoverageField4A CoverageField4B CoverageField11A CoverageField11B SalesField1A SalesField1B SalesField2A SalesField2B SalesField6 SalesField8 SalesField12 PersonalField4A PersonalField4B PersonalField10A PersonalField10B PersonalField14 PersonalField15 PersonalField84 PropertyField1A PropertyField1B PropertyField2B PropertyField16A PropertyField16B PropertyField21A PropertyField21B PropertyField24A PropertyField24B PropertyField25 PropertyField26A PropertyField26B PropertyField29 PropertyField39A PropertyField39B GeographicField1A GeographicField1B GeographicField2A GeographicField2B GeographicField3A GeographicField3B GeographicField4A GeographicField4B GeographicField6A GeographicField6B GeographicField7A GeographicField7B GeographicField8A GeographicField8B GeographicField9A GeographicField9B GeographicField11A GeographicField11B GeographicField12A GeographicField12B GeographicField13A GeographicField13B GeographicField15A GeographicField15B GeographicField16A GeographicField16B GeographicField17A GeographicField17B GeographicField18B GeographicField19A GeographicField19B GeographicField20A GeographicField20B GeographicField21B GeographicField23B GeographicField24A GeographicField24B GeographicField25A GeographicField25B GeographicField26A GeographicField26B GeographicField27A GeographicField27B GeographicField28A GeographicField28B GeographicField29A GeographicField29B GeographicField30A GeographicField30B GeographicField31A GeographicField31B GeographicField32A GeographicField32B GeographicField33A GeographicField33B GeographicField34A GeographicField34B GeographicField35A GeographicField35B GeographicField36A GeographicField36B GeographicField37A GeographicField37B GeographicField38A GeographicField38B GeographicField39A GeographicField39B GeographicField40A GeographicField40B GeographicField41A GeographicField41B GeographicField42A GeographicField42B GeographicField43A GeographicField43B GeographicField44A GeographicField44B GeographicField45A GeographicField45B GeographicField46A GeographicField46B GeographicField47A GeographicField47B GeographicField48A GeographicField48B GeographicField49A GeographicField49B GeographicField50A GeographicField50B GeographicField51A GeographicField51B GeographicField52A GeographicField52B GeographicField53A GeographicField53B GeographicField54A GeographicField54B GeographicField55A GeographicField55B GeographicField56B GeographicField57A GeographicField57B GeographicField58A GeographicField58B GeographicField59A GeographicField59B GeographicField60B GeographicField61B
0 2015-01-27 C 1,487 Y 25 25 13 23 T A 1 3 4 P 0 1 2 0 1 1 1 1 7 0 N 1 2 0 1 2 XD XS YP XC 1 0 0 0 0 0 1 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 -1 N N Y 0 R 1 0 1 -1 21 2 2 C 4 1 3 0 0 2 1 13 B N O Y H N 2 N N N -1 13 -1 25 -1 22 -1 25 -1 24 -1 -1 -1 -1 -1 8 N IL True False 23.0 0.9108 0.0006 1.3045 7.0 11.0 7.0 11.0 10.0 16.0 11.0 19.0 4.000000 7.0 4.0 11.0 4.0 13.0 11.0 32021.999980 2.000000e+00 23.0 24.0 6.0 12.0 2.0 1.0 2.0 10.000000 14.0 17.0 5.0 10.0 7.0 11.0 8.0 11.0 2.0 5.0 5.0 3.896914e-12 12.0 13.0 7.0 15.0 12.0 10.0 9.0 10.0 21.0 23.0 10.000000 18.0 12.0 18.0 10.000000 18.0 15.000000 18.0 9.0 18.0 13.0 18.0 9.0 18.0 10.0 13.0 11.000000 20.0 2.0 8.0 18.0 20.0 19.0 4.0 11.0 25.0 15.0 16.000000 15.0 17.000000 17.0 10.0 13.0 21.000000 20.0 12.0 19.0 7.0 8.0 8.0 13.0 15.0 22.0 7.000000 11.0 7.0 9.0 11.0 13.0 11.0 20.0 10.0 14.0 3.0 7.0 9.0 13.0 13.0 22.0 9.0 13.0 18.0 18.0 16.0 21.0 11.0 17.0 17.0 19.0 10.0 14.0 18.0 19.0 6.0 7.0 14.0 12.0 16.0 11.0 8.0 4.0 16.0 17.0 15.0 16.0 15.0 9.0 10.0 7.0 9.0 17.0 10.0 14.0 15.0 16.000000 21.0 16.0 20.0 8.0 25.0
1 2013-06-03 J 1,165 N 13 22 25 25 X G 1 4 3 V 0 0 0 0 0 0 1 0 6 1 N 1 2 0 1 2 ZF XS YP XC 1 0 0 0 0 1 2 1 0 0 0 0 3 1 1 1 1 0 0 0 0 1 1 1 1 1 3 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 1 1 1 1 3 0 0 0 0 1 -1 N N Y 0 D 1 0 1 -1 21 2 2 A 4 0 3 0 0 2 1 10 B N K Y E N 1 N N N -1 16 -1 25 -1 23 -1 -1 -1 15 25 -1 -1 -1 -1 22 N TX False True 10.0 0.9691 0.0004 1.2665 7.0 12.0 7.0 12.0 7.0 10.0 7.0 12.0 21.999999 25.0 8.0 20.0 8.0 20.0 17.0 34853.000023 -3.006702e-08 14.0 18.0 19.0 23.0 3.0 4.0 2.0 24.999999 25.0 4.0 3.0 5.0 7.0 12.0 16.0 21.0 1.0 25.0 25.0 3.896914e-12 23.0 25.0 2.0 2.0 5.0 3.0 1.0 1.0 19.0 22.0 20.000000 23.0 21.0 20.0 21.000000 23.0 20.000000 23.0 21.0 23.0 21.0 21.0 21.0 23.0 23.0 20.0 19.000000 23.0 2.0 5.0 4.0 13.0 15.0 3.0 7.0 15.0 25.0 16.000000 14.0 19.000000 23.0 8.0 11.0 25.000000 25.0 4.0 4.0 9.0 13.0 6.0 8.0 5.0 4.0 2.000000 2.0 3.0 2.0 6.0 4.0 3.0 2.0 11.0 17.0 3.0 4.0 1.0 1.0 4.0 5.0 7.0 11.0 14.0 12.0 8.0 9.0 9.0 10.0 12.0 12.0 10.0 13.0 6.0 2.0 7.0 13.0 5.0 2.0 18.0 16.0 16.0 14.0 3.0 2.0 3.0 2.0 23.0 24.0 1.0 1.0 7.0 15.0 24.0 18.0 21.0 10.000000 11.0 3.0 2.0 2.0 18.0
2 2013-08-12 B 965 N 25 25 1 6 T D 1 5 5 K 0 0 0 0 0 0 1 1 6 1 N 1 2 0 1 2 ZA ZE XR XD 1 0 0 0 0 1 2 2 0 1 1 1 1 0 0 0 0 0 0 0 0 1 0 1 1 1 2 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 1 1 1 2 0 0 0 0 1 -1 Y Y Y 0 O 0 0 1 -1 21 4 2 C 1 1 2 1 0 2 1 4 B N M Y F Y 2 N N N -1 13 -1 25 -1 10 -1 -1 -1 15 -1 -1 -1 -1 -1 9 N CA False True 24.0 0.9403 0.0006 1.0200 11.0 19.0 11.0 19.0 15.0 22.0 11.0 18.0 3.000000 3.0 3.0 8.0 2.0 3.0 21.0 44821.999987 -3.006702e-08 14.0 18.0 7.0 16.0 4.0 24.0 2.0 17.000000 21.0 20.0 9.0 18.0 11.0 19.0 10.0 16.0 2.0 7.0 8.0 3.896914e-12 8.0 7.0 11.0 21.0 13.0 13.0 3.0 2.0 17.0 19.0 2.000000 9.0 8.0 9.0 2.000000 9.0 2.000000 4.0 2.0 9.0 5.0 8.0 2.0 9.0 10.0 15.0 3.000000 9.0 3.0 18.0 15.0 4.0 7.0 5.0 15.0 4.0 1.0 15.000000 13.0 16.000000 14.0 16.0 21.0 15.000000 10.0 11.0 18.0 6.0 5.0 6.0 8.0 5.0 4.0 6.000000 10.0 12.0 19.0 11.0 13.0 10.0 17.0 9.0 12.0 7.0 16.0 11.0 18.0 3.0 4.0 3.0 8.0 3.0 4.0 7.0 7.0 8.0 8.0 14.0 14.0 1.0 1.0 11.0 12.0 10.0 18.0 12.0 10.0 15.0 9.0 6.0 2.0 11.0 9.0 10.0 9.0 16.0 11.0 14.0 13.0 8.0 15.0 23.0 14.0 14.0 7.000000 6.0 10.0 11.0 6.0 2.0
3 2013-09-09 J 1,165 N 13 22 13 23 T G 1 5 5 P 0 0 0 0 0 0 1 1 6 1 N 1 2 0 1 2 ZA ZE XR XD 1 0 0 0 0 1 2 2 0 1 1 1 1 0 0 0 0 0 0 0 0 1 0 1 1 1 2 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 1 1 1 2 0 0 0 0 1 -1 Y Y Y 0 J 0 0 1 -1 21 4 2 C 1 1 2 1 0 2 1 10 B N O N H N 0 N N N -1 14 -1 25 25 25 -1 -1 -1 15 -1 -1 -1 -1 -1 19 N TX False False 23.0 0.9497 0.0004 1.2665 11.0 18.0 11.0 18.0 10.0 16.0 10.0 18.0 3.000000 3.0 9.0 21.0 7.0 19.0 4.0 60604.999581 -3.006702e-08 17.0 21.0 5.0 6.0 2.0 24.0 2.0 9.000000 13.0 15.0 4.0 7.0 11.0 18.0 11.0 17.0 1.0 19.0 23.0 3.896914e-12 9.0 10.0 4.0 8.0 17.0 17.0 24.0 25.0 6.0 3.0 24.000001 25.0 23.0 23.0 23.999999 25.0 24.999999 25.0 24.0 24.0 23.0 23.0 24.0 24.0 23.0 22.0 23.999999 25.0 2.0 5.0 13.0 11.0 14.0 6.0 16.0 15.0 22.0 11.000000 5.0 10.000000 4.0 5.0 4.0 13.000000 5.0 11.0 18.0 7.0 8.0 6.0 8.0 16.0 23.0 25.000001 25.0 10.0 15.0 12.0 15.0 4.0 5.0 10.0 14.0 13.0 23.0 10.0 15.0 6.0 12.0 17.0 23.0 18.0 16.0 16.0 22.0 15.0 22.0 17.0 18.0 10.0 13.0 13.0 15.0 12.0 19.0 18.0 17.0 20.0 20.0 17.0 16.0 17.0 18.0 17.0 19.0 21.0 20.0 3.0 1.0 4.0 6.0 4.0 15.0 17.0 6.000000 4.0 15.0 19.0 24.0 9.0
4 2014-09-16 B 935 N 13 22 13 23 Y D 1 5 5 P 0 0 0 0 0 0 1 1 7 0 N 1 2 0 1 2 ZA ZE XR XD 1 0 0 0 0 1 2 2 0 0 1 1 1 0 0 0 0 0 0 0 0 1 0 0 1 1 2 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 1 1 2 0 0 0 0 1 -1 N N Y 0 O 0 0 1 -1 21 4 0 B 4 0 3 0 0 2 1 6 D N O Y G Y 2 N N N -1 13 -1 25 -1 10 -1 -1 -1 15 -1 -1 -1 -1 25 25 N CA False True 25.0 0.9153 0.0007 1.0200 5.0 8.0 1.0 1.0 2.0 1.0 5.0 7.0 10.000000 20.0 2.0 4.0 3.0 10.0 11.0 23616.000116 -3.006702e-08 13.0 17.0 14.0 21.0 5.0 24.0 2.0 10.000000 14.0 20.0 8.0 17.0 5.0 8.0 3.0 2.0 2.0 2.0 1.0 3.896914e-12 5.0 4.0 22.0 25.0 10.0 8.0 12.0 13.0 14.0 15.0 2.000000 9.0 8.0 9.0 2.000000 9.0 2.000000 4.0 2.0 9.0 5.0 8.0 2.0 9.0 10.0 15.0 3.000000 9.0 3.0 19.0 24.0 9.0 11.0 14.0 19.0 4.0 1.0 15.000000 13.0 16.000000 14.0 16.0 21.0 15.000000 10.0 7.0 12.0 11.0 17.0 9.0 17.0 9.0 14.0 6.000000 9.0 15.0 22.0 12.0 14.0 10.0 18.0 18.0 24.0 15.0 23.0 10.0 16.0 3.0 4.0 3.0 7.0 3.0 5.0 5.0 4.0 7.0 6.0 14.0 14.0 2.0 1.0 9.0 4.0 10.0 18.0 7.0 4.0 11.0 5.0 10.0 5.0 5.0 3.0 5.0 3.0 17.0 12.0 19.0 21.0 12.0 21.0 22.0 12.0 11.0 13.000000 15.0 8.0 7.0 8.0 11.0
5 2013-06-13 J 1,165 N 13 22 13 23 T G 0 5 5 Q 0 0 0 0 0 0 0 0 7 0 N 1 3 0 5 2 ZA ZE XR XD 1 0 0 0 0 1 2 2 0 1 1 1 1 0 0 0 0 0 0 0 0 1 0 1 1 1 2 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 1 1 1 2 0 0 0 0 1 -1 Y Y Y 0 J 0 0 1 -1 21 4 2 A 4 1 3 1 0 2 1 4 B N K Y G N 2 N Y N -1 24 -1 25 -1 15 -1 -1 -1 15 -1 -1 -1 -1 -1 20 N TX False False 23.0 0.9691 0.0004 1.2665 11.0 18.0 11.0 18.0 9.0 16.0 10.0 17.0 3.000000 4.0 24.0 25.0 18.0 24.0 1.0 31184.999971 -3.006702e-08 -1.0 -1.0 -1.0 -1.0 3.0 24.0 2.0 3.000000 3.0 10.0 12.0 21.0 11.0 18.0 18.0 23.0 3.0 7.0 8.0 3.896914e-12 19.0 22.0 9.0 18.0 10.0 8.0 10.0 11.0 10.0 8.0 12.000000 20.0 23.0 22.0 14.000000 20.0 21.000000 23.0 14.0 21.0 23.0 23.0 15.0 21.0 23.0 20.0 8.000000 17.0 2.0 5.0 14.0 9.0 11.0 3.0 9.0 5.0 21.0 19.000000 20.0 13.000000 10.0 7.0 10.0 16.000000 14.0 18.0 23.0 13.0 19.0 10.0 19.0 20.0 24.0 6.000000 9.0 7.0 10.0 11.0 13.0 12.0 20.0 16.0 23.0 25.0 25.0 10.0 16.0 5.0 8.0 8.0 12.0 13.0 9.0 12.0 15.0 23.0 24.0 8.0 5.0 11.0 18.0 15.0 17.0 8.0 16.0 1.0 1.0 23.0 24.0 24.0 25.0 1.0 1.0 1.0 1.0 16.0 11.0 6.0 3.0 9.0 17.0 10.0 17.0 19.0 9.000000 9.0 9.0 9.0 8.0 20.0
6 2013-07-23 J 1,165 N 13 22 13 23 T F 1 5 5 P 0 0 0 0 0 0 1 1 6 1 N 1 2 0 1 2 ZA ZE XR XD 1 0 0 0 0 1 2 2 0 1 1 1 1 0 0 0 0 0 0 0 0 1 0 1 1 1 2 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 1 1 1 2 0 0 0 0 1 -1 N N Y 0 J 0 0 1 -1 21 4 0 B 1 0 0 0 0 2 1 10 B N N N G N 0 N N N -1 21 -1 25 -1 23 -1 -1 -1 15 25 -1 -1 -1 -1 23 N TX False False 23.0 0.9691 0.0004 1.2665 4.0 4.0 4.0 4.0 3.0 3.0 3.0 3.0 6.000000 12.0 15.0 24.0 23.0 25.0 1.0 4841.000848 -3.006702e-08 5.0 6.0 8.0 17.0 2.0 24.0 2.0 10.000000 15.0 10.0 2.0 1.0 4.0 4.0 6.0 9.0 1.0 12.0 18.0 3.896914e-12 19.0 23.0 2.0 3.0 7.0 4.0 3.0 2.0 11.0 10.0 20.000000 23.0 22.0 22.0 20.000000 23.0 21.000000 23.0 21.0 23.0 21.0 22.0 21.0 23.0 23.0 23.0 18.000000 23.0 2.0 4.0 8.0 15.0 16.0 2.0 1.0 15.0 25.0 18.000000 16.0 15.000000 13.0 10.0 14.0 17.000000 16.0 2.0 2.0 3.0 2.0 11.0 20.0 4.0 3.0 2.000000 2.0 3.0 2.0 4.0 3.0 2.0 2.0 10.0 14.0 3.0 5.0 3.0 3.0 3.0 3.0 8.0 13.0 10.0 7.0 16.0 22.0 8.0 7.0 10.0 9.0 6.0 6.0 18.0 19.0 5.0 3.0 5.0 3.0 24.0 24.0 20.0 20.0 2.0 2.0 3.0 2.0 19.0 16.0 1.0 1.0 6.0 13.0 15.0 16.0 18.0 11.000000 12.0 11.0 13.0 3.0 21.0
7 2013-07-27 E 1,480 N 13 22 13 23 T K 1 5 5 R 1 0 0 0 0 0 1 1 7 0 N 1 2 0 1 2 ZA ZE XR XD 1 0 0 0 0 1 2 2 0 1 1 1 1 0 0 0 0 0 0 0 0 1 0 1 1 1 2 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 1 1 1 2 0 0 0 0 1 -1 N N Y 0 N 0 0 1 -1 21 1 0 B 4 0 0 0 0 2 1 10 B N O N G N 0 N N N -1 13 -1 25 -1 22 -1 -1 -1 17 -1 -1 -1 -1 -1 13 N IL False False 23.0 0.9487 0.0006 1.3045 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 10.000000 19.0 2.0 5.0 8.0 20.0 4.0 9426.999381 -3.006702e-08 3.0 3.0 25.0 25.0 1.0 24.0 2.0 24.999999 25.0 5.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 3.0 2.0 3.896914e-12 9.0 9.0 10.0 19.0 6.0 4.0 3.0 2.0 9.0 8.0 12.000000 19.0 13.0 19.0 12.000000 19.0 16.000000 19.0 11.0 19.0 15.0 19.0 11.0 19.0 11.0 18.0 12.000000 22.0 2.0 3.0 15.0 13.0 15.0 5.0 13.0 23.0 10.0 2.000000 2.0 2.000001 2.0 2.0 2.0 2.000001 2.0 7.0 10.0 1.0 1.0 10.0 19.0 8.0 10.0 3.000000 2.0 2.0 1.0 14.0 18.0 4.0 5.0 13.0 20.0 7.0 17.0 10.0 16.0 1.0 1.0 13.0 22.0 16.0 14.0 16.0 22.0 9.0 10.0 19.0 20.0 3.0 5.0 25.0 25.0 2.0 1.0 9.0 6.0 8.0 3.0 8.0 4.0 10.0 8.0 10.0 8.0 14.0 8.0 7.0 4.0 7.0 14.0 9.0 5.0 2.0 25.000001 25.0 1.0 1.0 9.0 14.0
8 2014-07-31 E 1,487 N 13 22 13 23 Y K 1 5 5 Q 0 0 0 0 0 0 1 1 7 0 N 1 3 1 5 2 ZA ZE XR XD 1 0 0 0 0 1 2 2 0 0 1 1 1 0 0 0 0 0 0 0 0 1 0 0 1 1 2 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 1 1 2 0 0 0 0 1 -1 N N Y 0 R 0 0 1 -1 21 4 2 C 5 0 1 0 0 2 1 10 B N O N G N 0 N Y N -1 13 -1 25 -1 17 -1 -1 25 25 -1 -1 -1 -1 -1 16 N IL False False 23.0 0.9392 0.0006 1.3045 2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0 16.000000 24.0 3.0 7.0 6.0 19.0 11.0 67123.999677 -3.006702e-08 1.0 1.0 -1.0 -1.0 1.0 24.0 2.0 15.000000 19.0 9.0 2.0 2.0 2.0 2.0 2.0 2.0 1.0 6.0 8.0 3.896914e-12 12.0 15.0 6.0 13.0 12.0 10.0 4.0 3.0 12.0 11.0 8.000000 16.0 11.0 17.0 9.000000 16.0 11.000000 16.0 8.0 16.0 13.0 17.0 9.0 17.0 9.0 12.0 7.000000 16.0 2.0 6.0 6.0 19.0 17.0 4.0 10.0 23.0 18.0 1.000001 1.0 0.999999 1.0 1.0 1.0 0.999999 1.0 4.0 3.0 3.0 2.0 7.0 10.0 9.0 14.0 4.000000 4.0 8.0 11.0 13.0 16.0 7.0 11.0 8.0 9.0 5.0 13.0 12.0 19.0 3.0 3.0 10.0 15.0 18.0 17.0 18.0 23.0 10.0 11.0 16.0 17.0 8.0 8.0 16.0 18.0 6.0 6.0 16.0 14.0 14.0 8.0 9.0 5.0 20.0 23.0 20.0 23.0 19.0 16.0 14.0 13.0 5.0 9.0 4.0 22.0 24.0 18.000000 22.0 13.0 16.0 2.0 25.0
9 2015-01-06 F 548 N 13 22 1 6 Y E 0 4 3 P 0 0 2 0 0 0 0 0 6 1 N 1 2 0 1 2 ZH XV YP XC 1 0 0 0 0 0 1 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 -1 N N Y 0 R 1 0 1 -1 21 1 0 B 4 0 2 0 0 2 1 13 B N N Y H Y 1 N N N -1 19 -1 25 -1 16 -1 -1 -1 17 -1 -1 -1 -1 -1 14 N NJ True True 7.0 1.0005 0.0040 1.2433 5.0 6.0 5.0 6.0 7.0 12.0 5.0 6.0 11.000000 21.0 3.0 7.0 4.0 14.0 20.0 8238.999442 2.000000e+00 4.0 5.0 13.0 20.0 2.0 8.0 2.0 7.000000 11.0 8.0 4.0 9.0 5.0 6.0 8.0 11.0 1.5 8.0 11.0 3.896914e-12 18.0 22.0 7.0 15.0 14.0 13.0 14.0 16.0 15.0 17.0 5.000000 16.0 10.0 15.0 5.000000 16.0 7.000000 16.0 4.0 12.0 9.0 14.0 5.0 14.0 11.0 17.0 7.000000 16.0 2.0 11.0 12.0 22.0 22.0 23.0 24.0 17.0 18.0 18.000000 17.0 14.000000 13.0 7.0 10.0 19.000000 18.0 3.0 3.0 3.0 2.0 6.0 6.0 10.0 16.0 14.000000 22.0 6.0 7.0 5.0 3.0 7.0 11.0 9.0 14.0 3.0 6.0 8.0 11.0 10.0 18.0 25.0 25.0 24.0 24.0 23.0 25.0 12.0 20.0 19.0 20.0 7.0 7.0 17.0 18.0 5.0 3.0 17.0 15.0 14.0 9.0 14.0 10.0 19.0 21.0 18.0 20.0 16.0 11.0 8.0 5.0 6.0 11.0 13.0 9.0 6.0 13.000000 16.0 8.0 7.0 16.0 8.0

Doing inferences based on this blog post from Walk With Fastai

row, cls, probs = learn.predict(df_test.iloc[0])
row.show()
Original_Quote_Date Field6 Field10 Field12 CoverageField5A CoverageField5B CoverageField6A CoverageField6B CoverageField8 CoverageField9 SalesField3 SalesField4 SalesField5 SalesField7 SalesField9 SalesField10 SalesField11 SalesField13 SalesField14 SalesField15 PersonalField1 PersonalField2 PersonalField5 PersonalField6 PersonalField7 PersonalField8 PersonalField9 PersonalField11 PersonalField12 PersonalField13 PersonalField16 PersonalField17 PersonalField18 PersonalField19 PersonalField22 PersonalField23 PersonalField24 PersonalField25 PersonalField26 PersonalField27 PersonalField28 PersonalField29 PersonalField30 PersonalField31 PersonalField32 PersonalField33 PersonalField34 PersonalField35 PersonalField36 PersonalField37 PersonalField38 PersonalField39 PersonalField40 PersonalField41 PersonalField42 PersonalField43 PersonalField44 PersonalField45 PersonalField46 PersonalField47 PersonalField48 PersonalField49 PersonalField50 PersonalField51 PersonalField52 PersonalField53 PersonalField54 PersonalField55 PersonalField56 PersonalField57 PersonalField58 PersonalField59 PersonalField60 PersonalField61 PersonalField62 PersonalField63 PersonalField64 PersonalField65 PersonalField66 PersonalField67 PersonalField68 PersonalField69 PersonalField70 PersonalField71 PersonalField72 PersonalField73 PersonalField74 PersonalField75 PersonalField76 PersonalField77 PersonalField78 PersonalField79 PersonalField80 PersonalField81 PersonalField82 PersonalField83 PropertyField2A PropertyField3 PropertyField4 PropertyField5 PropertyField6 PropertyField7 PropertyField8 PropertyField9 PropertyField10 PropertyField11A PropertyField11B PropertyField12 PropertyField13 PropertyField14 PropertyField15 PropertyField17 PropertyField18 PropertyField19 PropertyField20 PropertyField22 PropertyField23 PropertyField27 PropertyField28 PropertyField30 PropertyField31 PropertyField32 PropertyField33 PropertyField34 PropertyField35 PropertyField36 PropertyField37 PropertyField38 GeographicField5A GeographicField5B GeographicField10A GeographicField10B GeographicField14A GeographicField14B GeographicField18A GeographicField21A GeographicField22A GeographicField22B GeographicField23A GeographicField56A GeographicField60A GeographicField61A GeographicField62A GeographicField62B GeographicField63 GeographicField64 PersonalField84_na PropertyField29_na Field7 Field8 Field9 Field11 CoverageField1A CoverageField1B CoverageField2A CoverageField2B CoverageField3A CoverageField3B CoverageField4A CoverageField4B CoverageField11A CoverageField11B SalesField1A SalesField1B SalesField2A SalesField2B SalesField6 SalesField8 SalesField12 PersonalField4A PersonalField4B PersonalField10A PersonalField10B PersonalField14 PersonalField15 PersonalField84 PropertyField1A PropertyField1B PropertyField2B PropertyField16A PropertyField16B PropertyField21A PropertyField21B PropertyField24A PropertyField24B PropertyField25 PropertyField26A PropertyField26B PropertyField29 PropertyField39A PropertyField39B GeographicField1A GeographicField1B GeographicField2A GeographicField2B GeographicField3A GeographicField3B GeographicField4A GeographicField4B GeographicField6A GeographicField6B GeographicField7A GeographicField7B GeographicField8A GeographicField8B GeographicField9A GeographicField9B GeographicField11A GeographicField11B GeographicField12A GeographicField12B GeographicField13A GeographicField13B GeographicField15A GeographicField15B GeographicField16A GeographicField16B GeographicField17A GeographicField17B GeographicField18B GeographicField19A GeographicField19B GeographicField20A GeographicField20B GeographicField21B GeographicField23B GeographicField24A GeographicField24B GeographicField25A GeographicField25B GeographicField26A GeographicField26B GeographicField27A GeographicField27B GeographicField28A GeographicField28B GeographicField29A GeographicField29B GeographicField30A GeographicField30B GeographicField31A GeographicField31B GeographicField32A GeographicField32B GeographicField33A GeographicField33B GeographicField34A GeographicField34B GeographicField35A GeographicField35B GeographicField36A GeographicField36B GeographicField37A GeographicField37B GeographicField38A GeographicField38B GeographicField39A GeographicField39B GeographicField40A GeographicField40B GeographicField41A GeographicField41B GeographicField42A GeographicField42B GeographicField43A GeographicField43B GeographicField44A GeographicField44B GeographicField45A GeographicField45B GeographicField46A GeographicField46B GeographicField47A GeographicField47B GeographicField48A GeographicField48B GeographicField49A GeographicField49B GeographicField50A GeographicField50B GeographicField51A GeographicField51B GeographicField52A GeographicField52B GeographicField53A GeographicField53B GeographicField54A GeographicField54B GeographicField55A GeographicField55B GeographicField56B GeographicField57A GeographicField57B GeographicField58A GeographicField58B GeographicField59A GeographicField59B GeographicField60B GeographicField61B QuoteConversion_Flag
0 2014-08-12 E 1,487 N 13 22 13 23 Y K 0 5 5 P 0 0 0 0 0 0 1 1 6 1 N 1 3 0 5 2 YH XR XQ ZQ 1 0 0 0 0 0 1 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 -1 N N Y 0 D 1 0 1 -1 24 1 2 A 1 0 2 0 0 2 1 19 B N N Y G N 2 N Y N -1 13 -1 25 -1 19 -1 -1 -1 24 -1 -1 -1 -1 -1 25 Y IL True True 16.0 0.9364 0.0006 1.3045 4.0 4.0 4.0 4.0 3.0 3.0 3.0 4.0 13.0 22.0 6.0 16.0 9.0 21.0 11.0 67051.999655 2.523887e-08 11.0 14.0 -1.0 -1.0 5.0 14.0 2.0 18.0 23.0 4.0 3.0 5.0 4.0 4.0 6.0 8.0 1.5 7.0 8.0 -7.737822e-13 18.0 21.0 25.0 25.0 9.0 6.0 1.0 1.0 24.0 25.0 9.0 18.0 12.0 18.0 10.0 18.0 16.0 19.0 9.0 18.0 13.0 18.0 9.0 18.0 10.0 13.0 8.0 17.0 2.0 10.0 20.0 19.0 18.0 4.0 9.0 25.0 15.0 16.0 15.0 17.0 17.0 10.0 13.0 21.0 20.0 25.0 25.0 16.0 22.0 25.0 25.0 8.0 11.0 10.0 17.0 11.0 17.0 24.000001 25.0 15.0 23.0 24.999999 25.0 -1.0 -1.0 21.0 24.0 18.0 24.0 11.0 18.0 18.0 16.0 20.0 24.0 11.0 17.0 22.0 23.0 9.0 12.0 24.999999 25.0 6.0 9.0 4.0 2.0 16.0 12.0 20.0 20.0 2.0 2.0 2.0 1.0 1.0 1.0 10.0 7.0 25.0 25.0 19.0 19.0 22.0 12.0 15.0 1.0 1.0 1.0 20.0 False
dl_test = learn.dls.test_dl(df_test.iloc[:])
dl_test.show_batch()
Original_Quote_Date Field6 Field10 Field12 CoverageField5A CoverageField5B CoverageField6A CoverageField6B CoverageField8 CoverageField9 SalesField3 SalesField4 SalesField5 SalesField7 SalesField9 SalesField10 SalesField11 SalesField13 SalesField14 SalesField15 PersonalField1 PersonalField2 PersonalField5 PersonalField6 PersonalField7 PersonalField8 PersonalField9 PersonalField11 PersonalField12 PersonalField13 PersonalField16 PersonalField17 PersonalField18 PersonalField19 PersonalField22 PersonalField23 PersonalField24 PersonalField25 PersonalField26 PersonalField27 PersonalField28 PersonalField29 PersonalField30 PersonalField31 PersonalField32 PersonalField33 PersonalField34 PersonalField35 PersonalField36 PersonalField37 PersonalField38 PersonalField39 PersonalField40 PersonalField41 PersonalField42 PersonalField43 PersonalField44 PersonalField45 PersonalField46 PersonalField47 PersonalField48 PersonalField49 PersonalField50 PersonalField51 PersonalField52 PersonalField53 PersonalField54 PersonalField55 PersonalField56 PersonalField57 PersonalField58 PersonalField59 PersonalField60 PersonalField61 PersonalField62 PersonalField63 PersonalField64 PersonalField65 PersonalField66 PersonalField67 PersonalField68 PersonalField69 PersonalField70 PersonalField71 PersonalField72 PersonalField73 PersonalField74 PersonalField75 PersonalField76 PersonalField77 PersonalField78 PersonalField79 PersonalField80 PersonalField81 PersonalField82 PersonalField83 PropertyField2A PropertyField3 PropertyField4 PropertyField5 PropertyField6 PropertyField7 PropertyField8 PropertyField9 PropertyField10 PropertyField11A PropertyField11B PropertyField12 PropertyField13 PropertyField14 PropertyField15 PropertyField17 PropertyField18 PropertyField19 PropertyField20 PropertyField22 PropertyField23 PropertyField27 PropertyField28 PropertyField30 PropertyField31 PropertyField32 PropertyField33 PropertyField34 PropertyField35 PropertyField36 PropertyField37 PropertyField38 GeographicField5A GeographicField5B GeographicField10A GeographicField10B GeographicField14A GeographicField14B GeographicField18A GeographicField21A GeographicField22A GeographicField22B GeographicField23A GeographicField56A GeographicField60A GeographicField61A GeographicField62A GeographicField62B GeographicField63 GeographicField64 PersonalField84_na PropertyField29_na Field7 Field8 Field9 Field11 CoverageField1A CoverageField1B CoverageField2A CoverageField2B CoverageField3A CoverageField3B CoverageField4A CoverageField4B CoverageField11A CoverageField11B SalesField1A SalesField1B SalesField2A SalesField2B SalesField6 SalesField8 SalesField12 PersonalField4A PersonalField4B PersonalField10A PersonalField10B PersonalField14 PersonalField15 PersonalField84 PropertyField1A PropertyField1B PropertyField2B PropertyField16A PropertyField16B PropertyField21A PropertyField21B PropertyField24A PropertyField24B PropertyField25 PropertyField26A PropertyField26B PropertyField29 PropertyField39A PropertyField39B GeographicField1A GeographicField1B GeographicField2A GeographicField2B GeographicField3A GeographicField3B GeographicField4A GeographicField4B GeographicField6A GeographicField6B GeographicField7A GeographicField7B GeographicField8A GeographicField8B GeographicField9A GeographicField9B GeographicField11A GeographicField11B GeographicField12A GeographicField12B GeographicField13A GeographicField13B GeographicField15A GeographicField15B GeographicField16A GeographicField16B GeographicField17A GeographicField17B GeographicField18B GeographicField19A GeographicField19B GeographicField20A GeographicField20B GeographicField21B GeographicField23B GeographicField24A GeographicField24B GeographicField25A GeographicField25B GeographicField26A GeographicField26B GeographicField27A GeographicField27B GeographicField28A GeographicField28B GeographicField29A GeographicField29B GeographicField30A GeographicField30B GeographicField31A GeographicField31B GeographicField32A GeographicField32B GeographicField33A GeographicField33B GeographicField34A GeographicField34B GeographicField35A GeographicField35B GeographicField36A GeographicField36B GeographicField37A GeographicField37B GeographicField38A GeographicField38B GeographicField39A GeographicField39B GeographicField40A GeographicField40B GeographicField41A GeographicField41B GeographicField42A GeographicField42B GeographicField43A GeographicField43B GeographicField44A GeographicField44B GeographicField45A GeographicField45B GeographicField46A GeographicField46B GeographicField47A GeographicField47B GeographicField48A GeographicField48B GeographicField49A GeographicField49B GeographicField50A GeographicField50B GeographicField51A GeographicField51B GeographicField52A GeographicField52B GeographicField53A GeographicField53B GeographicField54A GeographicField54B GeographicField55A GeographicField55B GeographicField56B GeographicField57A GeographicField57B GeographicField58A GeographicField58B GeographicField59A GeographicField59B GeographicField60B GeographicField61B
0 2014-08-12 E 1,487 N 13 22 13 23 Y K 0 5 5 P 0 0 0 0 0 0 1 1 6 1 N 1 3 0 5 2 YH XR XQ ZQ 1 0 0 0 0 0 1 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 -1 N N Y 0 D 1 0 1 -1 24 1 2 A 1 0 2 0 0 2 1 19 B N N Y G N 2 N Y N -1 13 -1 25 -1 19 -1 -1 -1 24 -1 -1 -1 -1 -1 25 Y IL True True 16.0 0.9364 0.0006 1.3045 4.0 4.0 4.0 4.0 3.0 3.0 3.000000 4.0 13.0 22.0 6.0 16.0 9.0 21.0 11.000000 67051.999655 2.523887e-08 11.0 14.0 -1.000000 -1.0 5.0 14.0 2.0 18.0 23.0 4.0 3.0 5.0 4.0 4.0 6.0 8.0 1.5 7.0 8.0 -7.737822e-13 18.0 21.0 25.0 25.0 9.0 6.0 1.0 1.0 24.0 25.0 9.0 18.0 12.0 18.0 10.0 18.0 16.000000 19.0 9.0 18.0 13.0 18.0 9.000000 18.0 10.0 13.0 8.0 17.0 2.0 10.0 20.0 19.0 18.0 4.0 9.0 25.0 15.0 16.0 15.0 17.0 17.0 10.0 13.0 21.000000 20.0 25.0 25.0 16.0 22.0 25.0 25.0 8.0 11.0 10.0 17.0 11.0 17.0 24.000001 25.0 15.0 23.0 24.999999 25.0 -1.0 -1.0 21.0 24.0 18.0 24.0 11.0 18.0 18.0 16.0 20.0 24.0 11.0 17.0 22.0 23.0 9.0 12.0 24.999999 25.0 6.0 9.0 4.0 2.0 16.0 12.0 20.0 20.0 2.0 2.0 2.0 1.0 1.0 1.0 10.0 7.0 25.0 25.0 19.0 19.0 22.0 12.0 15.0 1.0 1.0 1.0 20.0
1 2013-09-07 F 564 N 13 22 13 23 T E 1 5 5 R 1 0 0 0 0 0 1 1 6 1 N 1 2 0 1 2 YF XS YP XC 1 0 0 0 0 0 1 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 -1 N N Y 0 J 1 0 1 -1 21 1 1 A 4 1 1 1 0 2 1 10 B N O Y H N 1 N N N -1 20 -1 25 -1 13 -1 -1 -1 22 -1 -1 -1 -1 -1 21 N NJ True True 11.0 0.9919 0.0038 1.1886 8.0 14.0 8.0 14.0 7.0 12.0 8.000000 13.0 4.0 5.0 3.0 6.0 3.0 6.0 4.000000 27288.000271 2.523887e-08 15.0 20.0 9.000000 18.0 2.0 4.0 2.0 22.0 24.0 10.0 7.0 15.0 8.0 14.0 5.0 6.0 1.0 10.0 15.0 -7.737822e-13 5.0 3.0 17.0 24.0 17.0 17.0 15.0 17.0 10.0 9.0 4.0 13.0 9.0 13.0 5.0 13.0 5.000000 12.0 4.0 15.0 8.0 13.0 5.000000 14.0 9.0 11.0 5.0 12.0 2.0 16.0 22.0 23.0 24.0 21.0 22.0 22.0 14.0 10.0 4.0 10.0 5.0 5.0 5.0 13.000000 6.0 9.0 14.0 8.0 10.0 12.0 22.0 7.0 10.0 9.0 15.0 11.0 18.0 14.000000 18.0 5.0 7.0 19.000000 24.0 6.0 14.0 16.0 23.0 6.0 12.0 11.0 19.0 25.0 25.0 15.0 20.0 12.0 20.0 23.0 24.0 12.0 21.0 23.000000 25.0 7.0 11.0 16.0 14.0 13.0 6.0 17.0 15.0 7.0 5.0 7.0 5.0 13.0 7.0 14.0 14.0 7.0 14.0 4.0 1.0 1.0 5.0 3.0 10.0 10.0 5.0 5.0
2 2013-03-29 F 564 N 13 22 13 23 T E 1 5 5 V 0 1 2 0 0 0 1 1 6 1 N 1 2 0 1 2 XE ZH YK ZN 1 0 0 0 0 0 1 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 -1 N N Y 0 R 1 0 1 -1 24 1 2 C 1 0 2 1 0 2 1 10 B N M Y G Y 1 N N N -1 16 -1 25 -1 11 -1 -1 -1 18 -1 -1 -1 -1 -1 11 N NJ True True 15.0 0.8945 0.0038 1.0670 11.0 18.0 11.0 18.0 10.0 16.0 10.000000 18.0 3.0 3.0 5.0 14.0 3.0 9.0 23.000000 65263.998972 2.000000e+00 12.0 15.0 22.000001 24.0 4.0 10.0 2.0 6.0 9.0 23.0 8.0 17.0 11.0 18.0 12.0 18.0 1.0 20.0 24.0 -7.737822e-13 11.0 12.0 3.0 6.0 16.0 16.0 15.0 18.0 14.0 16.0 4.0 10.0 10.0 16.0 5.0 11.0 6.000000 13.0 4.0 10.0 10.0 16.0 5.000000 10.0 11.0 18.0 5.0 13.0 2.0 13.0 15.0 21.0 20.0 19.0 21.0 16.0 16.0 15.0 11.0 11.0 7.0 6.0 7.0 13.000000 7.0 7.0 11.0 15.0 21.0 5.0 5.0 3.0 2.0 14.0 21.0 8.0 12.0 12.000000 15.0 14.0 22.0 7.000000 7.0 5.0 11.0 9.0 14.0 13.0 22.0 8.0 13.0 22.0 19.0 11.0 14.0 11.0 16.0 16.0 18.0 9.0 10.0 14.000000 16.0 6.0 8.0 20.0 19.0 17.0 14.0 16.0 13.0 20.0 22.0 20.0 22.0 20.0 18.0 10.0 7.0 4.0 7.0 11.0 13.0 12.0 18.0 22.0 10.0 11.0 20.0 22.0
3 2015-03-21 K 1,113 Y 13 22 13 23 Y F 1 5 5 R 1 1 1 0 0 0 1 1 6 1 N 1 2 0 1 2 XR YY XT XC 1 0 0 0 0 0 1 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 -1 N N Y 0 Q 1 0 1 -1 21 4 2 C 4 1 2 1 0 2 1 4 B N M N G N 0 N N N -1 14 -1 25 25 25 -1 -1 -1 15 -1 -1 -1 -1 -1 21 N TX True True 21.0 0.8870 0.0004 1.2665 14.0 22.0 15.0 22.0 13.0 20.0 21.999999 25.0 5.0 9.0 9.0 20.0 5.0 16.0 11.000000 32725.000016 1.000000e+00 5.0 6.0 7.000000 15.0 3.0 5.0 2.0 5.0 8.0 6.0 5.0 10.0 14.0 22.0 13.0 18.0 2.0 8.0 11.0 -7.737822e-13 7.0 5.0 9.0 18.0 11.0 9.0 13.0 15.0 22.0 24.0 24.0 25.0 23.0 23.0 24.0 25.0 25.000001 25.0 24.0 24.0 23.0 23.0 23.999999 24.0 23.0 22.0 24.0 25.0 2.0 7.0 13.0 11.0 14.0 6.0 16.0 15.0 22.0 11.0 5.0 10.0 4.0 5.0 4.0 13.000000 5.0 7.0 10.0 3.0 2.0 5.0 5.0 9.0 14.0 15.0 22.0 7.0 10.0 9.000000 8.0 13.0 22.0 6.000000 5.0 3.0 7.0 8.0 11.0 11.0 20.0 17.0 23.0 14.0 12.0 15.0 20.0 10.0 14.0 11.0 11.0 9.0 10.0 11.000000 13.0 15.0 21.0 14.0 12.0 17.0 13.0 10.0 6.0 20.0 22.0 20.0 22.0 19.0 16.0 12.0 11.0 4.0 6.0 13.0 10.0 8.0 5.0 3.0 8.0 8.0 13.0 8.0
4 2014-12-10 B 935 N 13 22 13 23 Y D 0 5 5 T 0 1 1 0 0 0 1 1 7 0 N 1 1 0 4 2 ZA ZE XR XD 1 0 0 0 0 1 2 2 0 0 1 1 1 0 0 0 0 0 0 0 0 1 0 0 1 1 2 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 1 1 2 0 0 0 0 1 -1 N N Y 0 R 0 0 1 -1 21 2 1 C 1 0 2 0 0 2 1 10 B N O Y H N 1 Y N N -1 13 -1 25 -1 7 -1 -1 -1 15 -1 -1 -1 -1 -1 21 N CA False True 25.0 0.9153 0.0007 1.0200 4.0 5.0 4.0 5.0 4.0 4.0 4.000000 5.0 12.0 21.0 1.0 1.0 3.0 6.0 11.000000 56024.998915 1.000000e+00 1.0 1.0 4.000000 2.0 2.0 24.0 2.0 2.0 2.0 8.0 5.0 11.0 4.0 5.0 4.0 4.0 1.0 9.0 12.0 -7.737822e-13 10.0 11.0 2.0 4.0 12.0 11.0 1.0 1.0 11.0 9.0 2.0 8.0 4.0 6.0 2.0 6.0 2.000000 9.0 2.0 3.0 3.0 5.0 2.000000 5.0 6.0 6.0 2.0 6.0 15.0 23.0 17.0 4.0 8.0 6.0 17.0 13.0 8.0 17.0 15.0 15.0 13.0 15.0 18.0 14.000000 7.0 7.0 10.0 12.0 19.0 8.0 14.0 7.0 9.0 2.0 1.0 15.0 21.0 12.000000 15.0 16.0 23.0 9.000000 13.0 16.0 24.0 6.0 8.0 4.0 6.0 2.0 5.0 11.0 7.0 8.0 9.0 6.0 5.0 9.0 8.0 25.0 25.0 9.000000 3.0 9.0 18.0 7.0 4.0 16.0 12.0 13.0 9.0 8.0 6.0 8.0 6.0 11.0 5.0 19.0 21.0 13.0 21.0 23.0 11.0 8.0 5.0 3.0 7.0 7.0 3.0 22.0
5 2013-07-19 B 965 N 13 22 13 23 Y D 0 5 5 V 0 0 0 0 0 0 1 1 7 0 N 1 2 0 1 2 ZA ZE XR XD 1 0 0 0 0 1 2 2 0 1 1 1 1 0 0 0 0 0 0 0 0 1 0 1 1 1 2 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 1 1 1 2 0 0 0 0 1 -1 N N Y 0 O 0 0 1 -1 21 2 2 C 1 1 4 0 0 2 1 10 B N O N H Y 2 N N N -1 13 -1 25 -1 7 -1 -1 -1 15 -1 -1 -1 -1 -1 8 N CA False True 24.0 0.9403 0.0006 1.0200 11.0 18.0 11.0 18.0 10.0 16.0 10.000000 18.0 6.0 12.0 6.0 17.0 4.0 14.0 24.000000 42867.999917 2.523887e-08 15.0 19.0 5.000000 7.0 3.0 24.0 2.0 15.0 20.0 20.0 10.0 19.0 11.0 18.0 13.0 19.0 1.0 21.0 24.0 -7.737822e-13 12.0 14.0 13.0 23.0 14.0 13.0 6.0 6.0 14.0 15.0 2.0 3.0 4.0 5.0 2.0 5.0 2.000000 2.0 2.0 6.0 3.0 6.0 2.000000 6.0 5.0 5.0 2.0 5.0 15.0 23.0 24.0 2.0 2.0 2.0 4.0 7.0 2.0 13.0 8.0 14.0 11.0 11.0 16.0 14.000000 9.0 10.0 18.0 9.0 12.0 8.0 14.0 18.0 24.0 12.0 20.0 13.0 20.0 9.000000 9.0 11.0 19.0 15.000000 23.0 7.0 16.0 12.0 20.0 5.0 8.0 3.0 6.0 2.0 3.0 6.0 5.0 8.0 7.0 14.0 14.0 2.0 4.0 10.000000 10.0 21.0 23.0 12.0 10.0 17.0 13.0 15.0 12.0 6.0 4.0 6.0 4.0 17.0 12.0 14.0 14.0 11.0 20.0 21.0 10.0 6.0 10.0 12.0 9.0 9.0 2.0 20.0
6 2014-07-28 E 1,487 N 13 22 13 23 Y K 1 5 5 K 0 0 0 0 0 0 1 1 7 0 N 1 2 0 1 2 ZA ZE XR XD 1 0 0 0 0 1 2 2 0 0 1 1 1 0 0 0 0 0 0 0 0 1 0 0 1 1 2 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 1 1 2 0 0 0 0 1 -1 Y N Y 0 N 0 0 1 -1 21 1 2 C 2 1 1 0 0 2 1 10 B N O N E N 0 N N N -1 13 -1 25 -1 23 -1 -1 -1 18 -1 -1 -1 -1 -1 8 N IL False False 23.0 0.9392 0.0006 1.3045 5.0 6.0 5.0 6.0 4.0 5.0 4.000000 5.0 11.0 21.0 3.0 8.0 5.0 15.0 11.000000 52430.999721 2.523887e-08 18.0 22.0 15.000000 21.0 2.0 24.0 2.0 4.0 6.0 8.0 4.0 7.0 5.0 6.0 4.0 4.0 1.0 9.0 12.0 -7.737822e-13 10.0 10.0 2.0 3.0 14.0 14.0 7.0 6.0 17.0 19.0 13.0 21.0 15.0 19.0 13.0 20.0 23.000000 25.0 11.0 19.0 16.0 19.0 11.000000 19.0 14.0 19.0 15.0 22.0 2.0 18.0 19.0 16.0 16.0 2.0 4.0 24.0 19.0 2.0 1.0 2.0 1.0 2.0 1.0 2.000001 1.0 5.0 7.0 4.0 3.0 6.0 7.0 8.0 12.0 7.0 11.0 6.0 8.0 11.000000 12.0 8.0 14.0 6.000000 6.0 9.0 20.0 9.0 14.0 2.0 2.0 23.0 25.0 17.0 15.0 20.0 24.0 11.0 17.0 8.0 3.0 6.0 6.0 13.000000 15.0 4.0 2.0 21.0 21.0 20.0 20.0 15.0 12.0 23.0 24.0 23.0 24.0 20.0 18.0 16.0 16.0 2.0 3.0 3.0 25.0 25.0 9.0 9.0 11.0 12.0 7.0 4.0
7 2015-01-20 B 935 N 13 22 13 23 Y D 1 5 5 P 0 0 0 0 0 0 1 1 6 1 N 1 2 0 1 2 ZA ZE XR XD 1 0 0 0 0 1 2 2 0 0 1 1 1 0 0 0 0 0 0 0 0 1 0 0 1 1 2 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 1 1 2 0 0 0 0 1 -1 N N Y 0 O 0 0 1 -1 21 4 2 C 4 1 2 0 0 2 1 10 B N O Y H Y 2 N N N -1 13 -1 25 -1 7 -1 -1 -1 15 -1 -1 -1 -1 -1 8 N CA False True 25.0 0.9153 0.0007 1.0200 6.0 9.0 6.0 9.0 5.0 7.0 5.000000 8.0 10.0 19.0 2.0 5.0 3.0 9.0 11.000000 2571.999669 2.523887e-08 7.0 10.0 21.000000 23.0 3.0 24.0 2.0 15.0 19.0 20.0 7.0 15.0 6.0 9.0 5.0 6.0 1.0 11.0 15.0 -7.737822e-13 9.0 10.0 6.0 13.0 17.0 18.0 10.0 11.0 10.0 8.0 2.0 7.0 2.0 2.0 2.0 2.0 2.000000 4.0 2.0 7.0 1.0 1.0 2.000000 2.0 3.0 3.0 2.0 3.0 5.0 20.0 18.0 3.0 6.0 4.0 11.0 11.0 5.0 23.0 24.0 15.0 13.0 14.0 17.0 15.000000 9.0 9.0 14.0 3.0 2.0 9.0 16.0 3.0 2.0 15.0 22.0 14.0 21.0 8.000000 7.0 9.0 16.0 14.000000 22.0 15.0 23.0 15.0 22.0 6.0 12.0 1.0 1.0 6.0 6.0 12.0 15.0 2.0 2.0 14.0 14.0 2.0 2.0 9.000000 3.0 1.0 1.0 18.0 18.0 20.0 19.0 14.0 10.0 23.0 24.0 22.0 24.0 15.0 10.0 22.0 24.0 7.0 14.0 16.0 15.0 16.0 2.0 1.0 15.0 19.0 17.0 15.0
8 2014-05-28 J 1,113 N 13 22 13 23 T F 0 5 5 T 0 1 1 1 1 1 0 0 7 0 N 1 2 0 1 2 ZA ZE XR XD 1 0 0 0 0 1 2 2 0 0 1 1 1 0 0 0 0 0 0 0 0 1 0 0 1 1 2 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 1 1 2 0 0 0 0 1 -1 Y Y Y 0 D 0 0 1 -1 21 4 2 A 5 1 3 1 0 2 1 4 B N K Y E N 2 N N N -1 23 -1 25 -1 16 -1 -1 -1 15 -1 -1 -1 -1 -1 8 N TX False False 23.0 0.8928 0.0004 1.2665 12.0 20.0 12.0 20.0 11.0 18.0 12.000000 19.0 2.0 3.0 15.0 24.0 10.0 22.0 11.000000 10064.999387 1.000000e+00 -1.0 -1.0 24.000000 25.0 5.0 24.0 2.0 10.0 13.0 24.0 4.0 8.0 12.0 20.0 21.0 24.0 3.0 8.0 10.0 -7.737822e-13 18.0 22.0 4.0 9.0 11.0 9.0 12.0 13.0 14.0 14.0 13.0 21.0 22.0 22.0 14.0 21.0 20.000000 23.0 14.0 22.0 21.0 22.0 15.000000 22.0 23.0 23.0 9.0 18.0 2.0 4.0 13.0 9.0 11.0 1.0 1.0 8.0 24.0 19.0 20.0 13.0 10.0 7.0 10.0 16.000000 14.0 9.0 15.0 9.0 13.0 11.0 20.0 14.0 22.0 15.0 22.0 9.0 14.0 12.000000 14.0 11.0 19.0 14.000000 21.0 4.0 10.0 9.0 15.0 11.0 21.0 8.0 13.0 13.0 9.0 11.0 13.0 25.0 25.0 8.0 5.0 12.0 21.0 11.000000 13.0 8.0 15.0 11.0 8.0 17.0 12.0 19.0 19.0 13.0 12.0 13.0 12.0 17.0 12.0 8.0 5.0 6.0 11.0 15.0 12.0 10.0 4.0 2.0 7.0 7.0 12.0 5.0
9 2013-07-11 J 1,165 N 13 22 13 23 Y F 1 3 4 Q 0 0 0 0 0 0 1 1 6 1 N 1 3 0 5 2 XD XS YP XC 1 0 0 0 0 0 1 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 -1 N N Y 0 O 1 0 1 -1 21 4 2 C 4 0 1 0 0 2 1 10 B N O Y H N 2 N Y N -1 24 -1 25 -1 18 -1 -1 -1 15 -1 -1 -1 -1 -1 13 N TX True False 23.0 0.9691 0.0004 1.2665 3.0 3.0 3.0 3.0 3.0 3.0 3.000000 3.0 14.0 23.0 9.0 21.0 15.0 24.0 0.999999 8320.999063 2.523887e-08 6.0 7.0 -1.000000 -1.0 1.0 20.0 2.0 16.0 20.0 4.0 2.0 3.0 3.0 3.0 5.0 6.0 1.0 10.0 14.0 -7.737822e-13 17.0 21.0 10.0 20.0 10.0 7.0 1.0 1.0 16.0 18.0 13.0 22.0 22.0 22.0 14.0 22.0 23.000000 24.0 14.0 21.0 21.0 22.0 15.000000 21.0 23.0 22.0 10.0 20.0 2.0 5.0 14.0 9.0 11.0 3.0 8.0 7.0 22.0 19.0 20.0 13.0 10.0 7.0 10.0 16.000000 14.0 12.0 20.0 8.0 11.0 10.0 19.0 7.0 10.0 4.0 4.0 5.0 5.0 10.000000 12.0 4.0 5.0 24.999999 25.0 25.0 25.0 9.0 14.0 4.0 5.0 11.0 17.0 13.0 9.0 17.0 22.0 19.0 23.0 10.0 9.0 11.0 18.0 12.000000 14.0 8.0 16.0 2.0 1.0 22.0 22.0 23.0 24.0 1.0 1.0 1.0 1.0 14.0 8.0 2.0 1.0 9.0 17.0 13.0 15.0 17.0 19.0 23.0 7.0 6.0 1.0 8.0
preds, _ = learn.get_preds(dl=dl_test)
type(preds)
torch.Tensor
preds.shape
torch.Size([173836, 2])
preds[:,:1]
tensor([[0.9999],
        [0.9836],
        [0.9839],
        ...,
        [0.0022],
        [0.9999],
        [0.8141]])
(preds[:,:1] >= 0.5).sum(), (preds[:,:1] < 0.5).sum()
(tensor(147304), tensor(26532))
learn.save('qad_fastai_nn3')
Path('models/qad_fastai_nn3.pth')

Submission To Kaggle

path.ls()
(#9) [Path('homesite-quote-conversion.zip'),Path('models'),Path('sample_submission.csv.zip'),Path('test.csv.zip'),Path('train.csv.zip'),Path('train.csv'),Path('test.csv'),Path('sample_submission.csv'),Path('submission.csv')]
file_extract(path/"sample_submission.csv.zip")
path.ls()
(#9) [Path('homesite-quote-conversion.zip'),Path('models'),Path('sample_submission.csv.zip'),Path('test.csv.zip'),Path('train.csv.zip'),Path('train.csv'),Path('test.csv'),Path('sample_submission.csv'),Path('submission.csv')]
df_submission = pd.read_csv(path/"sample_submission.csv") #I could add `low_memory=false` but it makes things slower
df_submission.head()
QuoteNumber QuoteConversion_Flag
0 3 0
1 5 0
2 7 0
3 9 0
4 10 0
df_submission.tail()
QuoteNumber QuoteConversion_Flag
173831 434570 0
173832 434573 0
173833 434574 0
173834 434575 0
173835 434589 0
len(df_test.index), len(preds)
(173836, 173836)
type(preds)
torch.Tensor
preds.dtype
torch.float32
preds[0,0]
tensor(0.9999)
preds_for_submission = preds[:,:1].tolist()
preds_for_submission[0:2]
fpfs = [float(pfs[0]) for pfs in preds_for_submission]
fpfs[0:2]
[0.9999121427536011, 0.9835898280143738]
integers = [[1], [2], [3]]

strings = [int(integer[0]) for integer in integers]
strings
[1, 2, 3]
submission = pd.DataFrame({'QuoteNumber': df_test.index, 'QuoteConversion_Flag': preds[:,:1].tolist()}, columns=['QuoteNumber', 'QuoteConversion_Flag'])

Needed to figure out how to extract the floating point value alone from the list to properly compose the csv output dataframe

type(submission.QuoteConversion_Flag)
pandas.core.series.Series
type(submission.QuoteConversion_Flag[0])
list
type(submission.QuoteConversion_Flag[0][0])
float
submission.QuoteConversion_Flag[0][0]
0.9999121427536011

Played around with the example on list comprehension here to get it to work with what I had to work with

submission.QuoteConversion_Flag = [float(qcf[0]) for qcf in submission.QuoteConversion_Flag]
submission.head()
QuoteNumber QuoteConversion_Flag
0 3 0.999912
1 5 0.983590
2 7 0.983852
3 9 0.999770
4 10 0.628180
submission.QuoteConversion_Flag = round(submission.QuoteConversion_Flag).astype('Int64')
submission.head()
QuoteNumber QuoteConversion_Flag
0 3 1
1 5 1
2 7 1
3 9 1
4 10 1
len(submission[submission.QuoteConversion_Flag==1])
147304
len(submission[submission.QuoteConversion_Flag==0])
26532
submission.to_csv(path/'submission2.csv', index=False)
api.competition_submit(path/'submission.csv',message="First pass", competition='homesite-quote-conversion')
100%|██████████| 1.45M/1.45M [00:03<00:00, 428kB/s]
Successfully submitted to Homesite Quote Conversion