Kaggle competition: Aerial Cactus Identification
<SOS> metric: AUC Kaggle data source: aerial-cactus-identification<count_missing_values>
%reload_ext autoreload
%autoreload 2
%matplotlib inline
train['PoolArea'].isna().sum() ,test['PoolArea'].isna().sum()<count_missing_values>
from fastai import *
from fastai.vision import *
train['MoSold'].isna().sum() ,test['MoSold'].isna().sum()<groupby>
path = Path('.. /input/aerial-cactus-identification/')
train.groupby('MoSold')['SalePrice'].agg(['count','min','max','mean'] ).sort_index()<data_type_conversions>
train = pd.read_csv('.. /input/aerial-cactus-identification/train.csv')
 test = pd.read_csv('.. /input/aerial-cactus-identification/sample_submission.csv' )
train['MoSold'] = train['MoSold'].astype(str)
 test['MoSold'] = test['MoSold'].astype(str )<count_missing_values>
np.random.seed(50)
train['YrSold'].isna().sum() ,test['YrSold'].isna().sum()<count_values>
tfms = get_transforms(do_flip = True, )
train['YrSold'].value_counts().sort_values(ascending=False ).head(10 )<sort_values>
data.show_batch(rows = 3,figsize=(7,8))
train.groupby(['MoSold','YrSold'])['SalePrice'].count().sort_values(ascending=False )<data_type_conversions>
learn = cnn_learner(data , models.resnet50 , metrics = error_rate )
train['YrSold'] = train['YrSold'].astype(str)
 test['YrSold'] = test['YrSold'].astype(str )<count_missing_values>
learn.fit_one_cycle(4)
train['SaleType'].isna().sum() ,test['SaleType'].isna().sum()<count_values>
test_data = ImageList.from_df(test, path=path/'test', folder='test')
 data.add_test(test_data )
test['SaleType'].fillna(test['SaleType'].value_counts().index[0],inplace=True )<count_missing_values>
preds, _ = learn.get_preds(ds_type=DatasetType.Test)
 test.has_cactus = preds.numpy() [:, 0]
train['SaleCondition'].isna().sum() ,test['SaleCondition'].isna().sum()<feature_engineering>
test.to_csv("submit.csv", index=False )