Kaggle competition: Aerial Cactus Identification
<SOS> metric: AUC Kaggle data source: aerial-cactus-identification<create_dataframe>
import numpy as np
import pandas as pd
sns.countplot(dataframe['Survived'], hue = dataframe['Sex'])
 Dead, lives = dataframe.Survived.value_counts()
male, female = dataframe.Sex.value_counts()
print("Percentage of Male on ship:", round(male/(male+female)*100))
print("Percentage of Female on ship:", round(female/(male+female)*100))<count_values>
from fastai import *
from fastai.vision import *
import torch
from pathlib import *
dataframe.Pclass.unique()
dataframe.Pclass.value_counts() 
<create_dataframe>
train=pd.read_csv('.. /input/train.csv')
 train.head()
sns.countplot(dataframe['Embarked'], hue = dataframe['Survived'] )<count_missing_values>
test=pd.read_csv('.. /input/sample_submission.csv' )
dataframe.isnull().values.any()
dataframe.isnull().sum() 
<count_missing_values>
test_img=ImageList.from_df(test, path=path/"test", folder="test")
 tfms=get_transforms(flip_vert=True )
test.isnull().sum()<count_missing_values>
train_img=(ImageList.from_df(train, path=path/'train', folder="train")
.split_by_rand_pct(0.01)
.label_from_df() 
.add_test(test_img)
.transform(tfms, size=256)
.databunch(path='.. /input', bs=64)
.normalize(imagenet_stats)
 )
dataframe.isnull().sum() 
<count_missing_values>
train_img.show_batch(rows=3 )
test.isnull().sum()<count_missing_values>
learn=cnn_learner(train_img, models.resnet50, metrics=[error_rate, accuracy], path="." )
test.isnull().sum()<drop_column>
lr = 3e-3
learn.fit_one_cycle(3, lr )
train_set = dataframe.drop(['Name','Cabin', 'Ticket','PassengerId', ], axis = 1)
 test_set = test.drop(['Name','Cabin', 'Ticket', 'PassengerId', ], axis = 1)
<count_missing_values>
probability, classification = learn.get_preds(ds_type=DatasetType.Test)
 test.has_cactus = probability.numpy() [:, 0]
test.head()
<data_type_conversions><EOS> 
test.to_csv("submission_2.csv", index=False )