Пример #1
0
    prediction.extend(
        rapidminer_train(go_url, gouser, gopassword, input_train_data, label,
                         cost_matrix, high_value, low_value,
                         selection_criteria, max_min_crietria_selector,
                         platform))

    prediction.extend(
        rapidminer_score(go_url, gouser, gopassword, input_score_data, label,
                         depID))
    print('returning result')
    return prediction


print('Deploying Quick Model')
tabclient.deploy('Rapidminer_Quick_Training',
                 rapidminer_quick_training,
                 'Quickly Trains a model for predictions',
                 override=True)

print('Deploying Training and Score')
tabclient.deploy('RapidMiner_Train_And_Score',
                 rapidminer_train_and_score,
                 'Trains and Returns a dataset with predictions',
                 override=True)

print('Deploying Score')
tabclient.deploy('RapidMiner_Score',
                 rapidminer_score,
                 'Returns a dataset with predictions',
                 override=True)

print('Deploying Training Function ')
Пример #2
0
    for x in variables_categoricas:
        df[x] = df[x].astype(str)
    for x in variables_binarias:
        df[x] = df[x].fillna(0)
        df[x] = df[x].astype(np.int8)
    for x in variables_numericas:
        df[x] = df[x].apply(lambda c: getCleanPrice(c))
        df[x] = df[x].astype(float)
    full_pipeline.transform(df)
    tree_predictions = tree_reg.predict(listing_prepared)
    tree_mse = mean_squared_error(listing_label, tree_predictions)
    tree_rmse = np.sqrt(tree_mse)
    tree_mae = mean_absolute_error(listing_label, tree_predictions)
    print("DecisionTreeRegressor:\nRMSE = ${:.4f}\nMAE = ${:.4f}".format(
        tree_rmse, tree_mae))
    print("-" * 100)
    forest_predictions = forest_reg.predict(listing_prepared)
    forest_mse = mean_squared_error(listing_label, forest_predictions)
    forest_rmse = np.sqrt(forest_mse)
    forest_mae = mean_absolute_error(listing_label, forest_predictions)
    print("RandomForestRegressor:\nRMSE = ${:.4f}\nMAE = ${:.4f}".format(
        forest_rmse, forest_mae))

    return [price for price in forest_predictions]


cliente = Client("http://localhost:9004")
cliente.deploy("hostPricePredictor",
               hostPricePredictor,
               "Calcula el precio del hosting segun los parametros recibidos",
               override=True)