From 39ba7f2ee15b66cbc4a5fffb73c47ea22380deec Mon Sep 17 00:00:00 2001 From: o9o9 Date: Fri, 13 Oct 2017 22:39:18 +0900 Subject: [PATCH] Update PredictTipRxPy.sql Fixed to API specification change of RevoScalePy due to version upgrade from SQL Server 2017 CTP to SQL Server 2017 RC This file is used by In-database Python Analytics tutorial(https://docs.microsoft.com/en-us/sql/advanced-analytics/tutorials/sqldev-in-database-python-for-sql-developers). --- Misc/PythonSQL/PredictTipRxPy.sql | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Misc/PythonSQL/PredictTipRxPy.sql b/Misc/PythonSQL/PredictTipRxPy.sql index ee658f01..4db77471 100644 --- a/Misc/PythonSQL/PredictTipRxPy.sql +++ b/Misc/PythonSQL/PredictTipRxPy.sql @@ -22,16 +22,15 @@ BEGIN @script = N' import pickle import numpy -import pandas from sklearn import metrics -from revoscalepy.functions.RxPredict import rx_predict_ex +from revoscalepy.functions.RxPredict import rx_predict mod = pickle.loads(lmodel2) X = InputDataSet[["passenger_count", "trip_distance", "trip_time_in_secs", "direct_distance"]] y = numpy.ravel(InputDataSet[["tipped"]]) -prob_array = rx_predict_ex(mod, X) -prob_list = list(prob_rrray._results["tipped_Pred"]) +prob_array = rx_predict(mod, X) +prob_list = prob_array["tipped_Pred"].values prob_array = numpy.asarray(prob_list) fpr, tpr, thresholds = metrics.roc_curve(y, prob_array)