Kaggle competition: Aerial Cactus Identification
train_test.loc[(train_test.Age.isnull())&(train_test.Title=='Mr'),'Age']=32
train_test.loc[(train_test.Age.isnull())&(train_test.Title=='Mrs'),'Age']=37
train_test.loc[(train_test.Age.isnull())&(train_test.Title=='Master'),'Age']=5
train_test.loc[(train_test.Age.isnull())&(train_test.Title=='Miss'),'Age']=22
train_test.loc[(train_test.Age.isnull())&(train_test.Title=='Rare'),'Age']=45<data_type_conversions>
path = Path('.. /input')
 tfms = get_transforms(do_flip=True , flip_vert= True , max_rotate=10.0 , max_zoom=1.1 ,
max_lighting =0.2 , max_warp = 0.2 , p_affine = 0.75 , p_lighting = 0.75)
train_test['Age'] = train_test['Age'].astype('int64' )<groupby>
train = pd.read_csv('.. /input/train.csv')
 test = pd.read_csv('.. /input/sample_submission.csv' )
train[['Survived','Sex']].groupby('Sex' ).mean()<count_missing_values>
no_cactus = train.query("has_cactus == 0")
 train = train.append([no_cactus]*2, ignore_index=True )
train_test.Fare.isnull().sum()<correct_missing_values>
learn = cnn_learner(data , models.densenet161 , metrics = error_rate )
train_test.Fare.fillna(test.Fare.median() , inplace=True )<feature_engineering>
learn.fit_one_cycle(10, max_lr=slice(1e-6))
train_test['Fare_log'] = np.log1p(train_test.Fare)
 plot_skew(train_test.Fare_log )<data_type_conversions>
test_data = ImageList.from_df(test, path=path/'test', folder='test')
 data.add_test(test_data )
train_test['Ticket_Frequency'] = train_test.groupby('Ticket')['Ticket'].transform('count')
 train_test.Ticket_Frequency.astype('int64' )<count_missing_values>
preds, _ = learn.get_preds(ds_type=DatasetType.Test)
 test.has_cactus = preds.numpy() [:, 0]
train_test.Cabin.isnull().sum()<groupby>
test.to_csv("submit.csv", index=False )