Kaggle competition: Aerial Cactus Identification
train.drop('Id',axis=1,inplace=True)
 Submission = test[['Id']]
test.drop('Id',axis=1,inplace=True )<feature_engineering>
from pathlib import Path
from fastai import *
from fastai.vision import *
import torch
train_missing = pd.DataFrame(train.isna().sum() [train.isna().sum() !=0].sort_values())
 train_missing.columns = ['
train_missing['Percent_Missing'] = train.isna().sum() [train.isna().sum() !=0]/len(train)
 train_missing<feature_engineering>
data_folder = Path(".. /input")
test_missing = pd.DataFrame(test.isna().sum() [test.isna().sum() !=0].sort_values())
 test_missing.columns = ['
test_missing['Percent_Missing'] = test.isna().sum() [test.isna().sum() !=0]/len(test)
 test_missing<drop_column>
train_df = pd.read_csv(".. /input/train.csv")
 test_df = pd.read_csv(".. /input/sample_submission.csv" )
train.drop(['PoolQC','MiscFeature','Alley','Fence','FireplaceQu'],axis=1,inplace=True)
 test.drop(['PoolQC','MiscFeature','Alley','Fence','FireplaceQu'],axis=1,inplace=True )<count_unique_values>
learn = cnn_learner(train_img, models.densenet161, metrics=[error_rate, accuracy] )
for col in train.columns:
if train[col].dtype == "object":
print("Cardinality of %s variable in Train Data:"%col,train[col].nunique())
 print("Cardinality of %s variable in Test Data:"%col,test[col].nunique())
 print("
" )<feature_engineering>
lr = 3e-02
learn.fit_one_cycle(5, slice(lr))
train.drop(train.index[[691,1182]],inplace=True)
 train['SalePrice'] = np.log(train['SalePrice'] )<data_type_conversions>
abc,_ = learn.get_preds(ds_type=DatasetType.Test)
train['MSSubClass'] = train['MSSubClass'].astype(str)
 test['MSSubClass'] = test['MSSubClass'].astype(str )<count_values>
test_df.has_cactus = abc.numpy() [:, 0]
test['MSZoning'].fillna(test['MSZoning'].value_counts(dropna=False ).index[0],inplace=True )<data_type_conversions>
test_df.to_csv('submission.csv', index=False )