sp_execute_external_script to run script that analyzing unstructured data RRS feed

  • Question

  • I saw many example from sp_execute_external_script, that the script (python script) input to these sp are dealing with some structure data, like in the following example , like in the following 

    EXEC sp_execute_external_script @language = N'Python', @script = N' import pandas as pd from sklearn.cluster import KMeans # Get data from input query customer_data = my_input_data # Define the model n_clusters = 4 est = KMeans(n_clusters=n_clusters, random_state=111).fit(customer_data[["orders","items","cost"]]) clusters = est.labels_ customer_data["cluster"] = clusters OutputDataSet = customer_data ' , @input_data_1 = @input_query , @input_data_1_name = N'my_input_data' WITH RESULT SETS (("CustomerID" int, "Orders" float,"Items" float,"Cost" float,"ClusterResult" float)); END; GO

    are there example that the script can deal with some unstructured data (like image/doc).... ??

    Friday, July 10, 2020 6:35 AM


All replies