1

I am using SQL Server 2017 in-database Machine Learning Services with python (revoscalepy,microsoftml) for creating a model with Jupyter Server notebook. I am able to set my compute_context using revoscalepy and successfully run a model and store the results into a dataframe. I am now trying to store insert(or write) these dataframe values using the same connection-string that I used while connecting to the database using rx_featurize but I get this error type object argument after * must be an iterable, not NoneType.

Below is the code I am running :

output_df = pd.DataFrame(data = predictions, index=unique_id, columns=['predictions'])

from microsoftml import rx_featurize

rx_featurize(data=output_df,output_data=RxSqlServerData(connection_string=connection_string_1, table = 'predicted', database_name='banktest'), overwrite = True)

Error is as below :

TypeError                                 Traceback (most recent call last)
<ipython-input-32-7ae26d056309> in <module>()
      4 # a_df = pd.DataFrame([[0, 1], [2, 3]], columns=[...])
      5 
----> 6 rx_featurize(data=output_df,output_data=RxSqlServerData(connection_string=connection_string_1, table = 'predicted', database_name='banktest'), overwrite = True)

C:\Program Files\Microsoft SQL Server\MSSQL14.MSSQLSERVER\PYTHON_SERVICES\lib\site-packages\microsoftml\modules\featurize.py in rx_featurize(data, output_data, overwrite, data_threads, random_seed, max_slots, ml_transforms, ml_transform_vars, row_selection, transforms, transform_objects, transform_function, transform_variables, transform_packages, transform_environment, blocks_per_read, report_progress, verbose, compute_context)
    162     transform_nodes = transform_data(
    163         ml_transforms, data=input_data,
--> 164         features=None, output_data=output_data_, model=transform_model)
    165 
    166     ## combine the transform models

C:\Program Files\Microsoft SQL Server\MSSQL14.MSSQLSERVER\PYTHON_SERVICES\lib\site-packages\microsoftml\modules\graph_composition.py in transform_data(ml_transforms, data, features, output_data, model)
     41 
     42     if features is None:
---> 43         sub_graph = Graph(*ml_transforms)
     44     else:
     45         ## combine the features

TypeError: type object argument after * must be an iterable, not NoneType

microsoftml is a library which is installed when I installed python services.

Here's the link as to why I took rx_featurize to insert data into the database. [Using revoscalepy to insert data into a database

Also I created a blank table predicted with the columns as per dataframe but still error showed

4

0 回答 0