Kaggle competition: PUBG Finish Placement Prediction (Kernels Only)
mean_encoder(data,['LotShape','LandContour','LotConfig','LandSlope','Fence','FireplaceQu','GarageType','GarageFinish','GarageQual','GarageCond'])
<count_missing_values>
train=pd.read_csv(".. /input/train_V2.csv")
 test=pd.read_csv(".. /input/test_V2.csv")
 sample_submission=pd.read_csv(".. /input/sample_submission_V2.csv" )
data.PoolQC.isna().sum()<feature_engineering>
train.isnull().sum()
data['Pool'] =(data.PoolQC!="NA")*1<drop_column>
train.isnull().sum()
data = data.drop(['PoolQC'],axis=1 )<count_values>
y=train['winPlacePerc']
train=train.drop(columns=['winPlacePerc','Id','groupId','matchId'],axis=1)
 test=test.drop(columns=['Id','groupId','matchId'],axis=1 )
data[data.Pool==0].PoolArea.value_counts()<feature_engineering>
train=pd.get_dummies(train)
 test=pd.get_dummies(test)
 print('train shape:',train.shape,'test shape:',test.shape )
data.loc[(data.Pool==0)&(data.PoolArea>0),'Pool']=1<filter>
from sklearn.model_selection import train_test_split
data[data.LotFrontage>300]<filter>
x_train,x_test,y_train,y_test=train_test_split(train,y,test_size=0.2 )
data = data[data.LotFrontage<300]<feature_engineering>
from xgboost import XGBRegressor
from catboost import CatBoostRegressor
from lightgbm import LGBMRegressor
from sklearn.ensemble import RandomForestRegressor
data['LotFrontage']=np.power(data.LotFrontage,0.25 )<filter>
cb.fit(x_train,y_train)
data = data[data.LotArea<100000]<feature_engineering>
y_pred=cb.predict(x_test )
data['LotArea'] = np.log1p(data.LotArea )<groupby>
from sklearn.metrics import r2_score
data.groupby('Fireplaces')['tmpPrice'].mean()<groupby>
print('r2 score is:',r2_score(y_test,y_pred))
data.groupby('GarageCars')['tmpPrice'].mean()<count_values>
y_pred_final=cb.predict(test )
data.GarageCars.value_counts()<feature_engineering>
sample_submission['winPlacePerc']=y_pred_final
<filter><EOS> 
sample_submission.to_csv('submission_pubg.csv',index=False )