Kaggle competition: CareerCon 2019 - Help Navigate Robots
<SOS> metric: categorizationaccuracy Kaggle data source: career-con-2019<train_model>
import tensorflow as tf
from tensorflow.keras.models import Sequential, load_model
from tensorflow.keras.layers import Dense, LSTM, Flatten, Dropout, MaxPooling2D, CuDNNLSTM
from tensorflow.keras.utils import to_categorical
import numpy as np
import pandas as pd
from sklearn.preprocessing import MinMaxScaler
from sklearn.preprocessing import LabelEncoder
from sklearn.ensemble import RandomForestClassifier
from sklearn.metrics import classification_report
from sklearn.metrics import accuracy_score
from sklearn.model_selection import train_test_split
from sklearn.feature_selection import SelectKBest, chi2, mutual_info_classif
from tsfresh import extract_features
from tsfresh.utilities.dataframe_functions import impute
import pickle
from functools import reduce
final_model = RandomForestRegressor(bootstrap=False, max_features=0.3, min_samples_leaf=10,
min_samples_split=20, n_estimators=200, n_jobs=-1, random_state=42)
 final_model.fit(X, y )<compute_train_metric>
if __name__ == '__main__':
df_train=pd.read_csv('.. /input/X_train.csv')
 df_train.drop(['row_id'],axis=1,inplace=True)
 df_train=extract_features(df_train,column_id = "series_id", chunksize=7, default_fc_parameters=None, column_sort = "measurement_number", impute_function=impute, n_jobs=7)
 df_train.to_csv('train_feature.csv',index=False)
 del df_train
df_test=pd.read_csv('.. /input/X_test.csv')
 df_test.drop(['row_id'],axis=1,inplace=True)
 df_test=extract_features(df_test,column_id = "series_id", chunksize=7, default_fc_parameters=None, column_sort = "measurement_number", impute_function=impute, n_jobs=7)
 df_test.to_csv('test_feature.csv',index=False)
 del df_test
<load_from_csv><EOS>