Kaggle competition: Aerial Cactus Identification
pd.set_option('max_columns',100)
 pd.set_option('max_rows',100 )<sort_values>
from fastai import *
from pathlib import Path
from fastai.vision import *
train_x_all[train_x_all['Survived'] != train_x_all['Pred']].sort_values(by=['Survived'] )<filter>
data_folder = Path(".. /input/" )
diff_nrow = len(train_x_all[train_x_all['Survived'] != train_x_all['Pred']])
 diff_nrow 
<set_options>
train_df = pd.read_csv(f"{data_folder}/train.csv")
 test_df = pd.read_csv(f"{data_folder}/sample_submission.csv" )
%matplotlib inline
sns.set_style('whitegrid' )<import_modules>
learn = cnn_learner(data, models.resnet18, metrics=[error_rate, accuracy],model_dir="/tmp/model/" )
import scipy.stats as stats
from scipy import stats
from scipy.stats import pointbiserialr, spearmanr, skew, pearsonr<import_modules>
learn.fit_one_cycle(2 )
from sklearn.ensemble import RandomForestRegressor
from sklearn.feature_selection import SelectFromModel
from sklearn.model_selection import cross_val_score, train_test_split, GridSearchCV
from sklearn.linear_model import Ridge, RidgeCV, LassoCV
from sklearn import linear_model<load_from_csv>
learn.fit_one_cycle(2 )
house_train = pd.read_csv(".. /input/train.csv")
 house_test = pd.read_csv(".. /input/test.csv" )<sort_values>
data.add_test(ImageList.from_df(test_df,data_folder/'test',folder='test'))
house_train[['OverallQual','SalePrice']].groupby(['OverallQual'],
as_index=False ).mean().sort_values(by='OverallQual', ascending=False )<sort_values>
preds,_ = learn.get_preds(ds_type=DatasetType.Test )
house_train[['GarageCars','SalePrice']].groupby(['GarageCars'],
as_index=False ).mean().sort_values(by='GarageCars', ascending=False )<sort_values>
test_df.has_cactus = preds.numpy() [:, 0]
house_train[['Fireplaces','SalePrice']].groupby(['Fireplaces'],
as_index=False ).mean().sort_values(by='Fireplaces', ascending=False )<sort_values>
test_df.to_csv('submission.csv', index=False )