def make_submission(network, params, u): print('Prepare submission') test = Dataset.from_test() if params.pca: X2 = test.get_pca_features(u) else: X2 = test.get_features() predictions = network.predict(X2) save_predictions(predictions, test.df)
def prepare_solution(): train = Dataset.from_train() X = train.get_features() Y = train.get_labels() rf = RandomForestRegressor(n_jobs=-1) model = rf.fit(X, Y) print('Train dataset score: %f' % loss(Y, model.predict(X))) test = Dataset.from_test() X2 = test.get_features() Y2 = model.predict(X2) save_predictions(Y2, test.df)
def prepare_solution(): train = Dataset.from_train() X = train.get_features() Y = train.get_labels() rf = RandomForestRegressor(n_jobs=-1) model = rf.fit(X, Y) print('Train score: %f' % loss(Y, model.predict(X))) test = Dataset.from_test() X2 = test.get_features() Y2 = model.predict(X2) save_predictions(Y2, test)