Kaggle competition: APTOS 2019 Blindness Detection
<SOS> metric: QuadraticWeightedKappa Kaggle data source: aptos-2019-blindness-detection<drop_column>
%reload_ext autoreload
%autoreload 2
%matplotlib inline
train = train.drop(train[train['passenger_count']==208].index, axis = 0 )<filter>
from fastai import *
from fastai.vision import *
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
import os
import scipy as sp
from functools import partial
from sklearn import metrics
from collections import Counter
from fastai.callbacks import *
import PIL
import cv2
train[train['pickup_latitude']<-90]<filter>
def seed_everything(seed=1358):
random.seed(seed)
 os.environ['PYTHONHASHSEED'] = str(seed)
 np.random.seed(seed)
 torch.manual_seed(seed)
 torch.cuda.manual_seed(seed)
 torch.backends.cudnn.deterministic = True
seed_everything()
train[train['pickup_latitude']>90]<drop_column>
PATH = '/kaggle/input/aptos2019-blindness-detection/'
train_img_path = PATH +'train_images/'
test_img_path = PATH +'test_images/'
train_file_name = PATH +'train.csv'
test_file_name = PATH +'test.csv'
bs=24
sz=224
train = train.drop(((train[train['pickup_latitude']<-90])|(train[train['pickup_latitude']>90])).index, axis=0 )<filter>
df = pd.read_csv(PATH +'train.csv')
 df.head()
train[train['pickup_longitude']<-180]<filter>
tfms = get_transforms(do_flip=True, flip_vert=True, max_rotate=0.10, max_zoom=1.3, max_warp=0.0, max_lighting=0.2 )
train[train['pickup_longitude']>180]<drop_column>
data =(
 src.transform(get_transforms() ,size=224)
.databunch() 
.normalize(imagenet_stats)
)
 data
train = train.drop(((train[train['pickup_longitude']<-180])|(train[train['pickup_longitude']>180])).index, axis=0 )<filter>
learn = cnn_learner(data, base_arch=models.resnet34 ,metrics=[error_rate],model_dir='/kaggle/working',pretrained=True )
train[train['dropoff_latitude']<-90]<filter>
lr = 1e-2
learn.fit_one_cycle(2, lr )
train[train['dropoff_latitude']>90]<drop_column>
learn.save('stage-1' )
train = train.drop(((train[train['dropoff_latitude']<-90])|(train[train['dropoff_latitude']>90])).index, axis=0 )<filter>
learn.fit_one_cycle(5, slice(1e-4,lr/5))
<data_type_conversions><EOS> 
learn.export('/kaggle/working/blindness-detection.pkl' )