def modif_submission(path_sub="best_sub.csv"): """ """ arr = np.loadtxt(path_sub, skiprows=1, delimiter=",", usecols=range(1, 10)) pdb.set_trace() sub = np.where(arr > 0.5, arr + 0.0001, arr - 0.0001) sub = np.where(sub < 0, 0, sub) sub = np.where(sub > 1, 1, sub) make_submission(sub)
def main(data_folder="./data", path_submission="sub.csv"): """ """ # pdb.set_trace() # Load train, test and sample submission # print 'Loading data...' # X_train, y_train, X_valid, y_valid, X_test = load_train_valid_test(folder=data_folder) # y_train = y_train.astype(np.int32) # y_valid = y_valid.astype(np.int32) # # #Data normalization # print 'Normalizing data...' # X_train, X_valid, X_test = normalize(X_train, X_valid, X_test, # normalizer='StandardScaler') # #Feature engineering # print 'Feature engineering...' ## X_train, X_test = feat_eng(X_train, X_test) ## ## #Applying classifiers... # print 'Classifying...' # num_features = X_train.shape[1] # num_classes = len(np.unique(y_train)) # clf = Clf_nolearn_simple(num_features, num_classes) # clf = Clf_nolearn_2_levels(num_features, num_classes) # clf = Clf_nolearn_simple_play(num_features, num_classes) # clf = Clf_xgboost_simple(num_classes) # clf = Clf_xgboost_2_levels(num_classes) # clf = Clf_xgboost_split(num_classes) # clf = Clf_rf_simple() # clf = Clf_clust_simple() ### # clf.process(X_train, y_train, X_valid, y_valid, X_test, # validating=True, testing=True, file_name=None, verbose=1) #### # print 'Ensembling...' ens = Ens_log_reg() #### ens = Ens_opt_cal() y_pred = ens.process() ###### make_submission(y_pred)