Skip to Main Content
SQL Server 2017 Machine Learning Services with R
book

SQL Server 2017 Machine Learning Services with R

by Toma≈æ Ka≈°trun Kaštrun, Julie Koesmarno
February 2018
Intermediate to advanced content levelIntermediate to advanced
338 pages
7h 5m
English
Packt Publishing
Content preview from SQL Server 2017 Machine Learning Services with R

Variable creation and recoding

Using rxGetVarInfo will expose the information about the data.frame to the sp_execute_external_script output. It is obvious that some of these functions were never designed for presenting the output to data.frame, but were designed only for exploring the dataset. Some of these functions-for example, rxGetVarInfo-will give a nice output in the R environment, but will be hard to manipulate in data frames for outputting in the SQL Server database:

EXEC sp_execute_external_script
      @language = N'R'
      ,@script = N'
                  library(RevoScaleR)
                  df_sql <- InputDataSet        
                  var_info <- rxGetVarInfo(df_sql)
                  OutputDataSet <- data.frame(unlist(var_info))'
      ,@input_data_1 = N'
                  SELECT 
                   BusinessEntityID
                  ,[Name]
                  ,SalesPersonID
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

SQL Server Big Data Clusters: Data Virtualization, Data Lake, and AI Platform

SQL Server Big Data Clusters: Data Virtualization, Data Lake, and AI Platform

Benjamin Weissman, Enrico van de Laar
Mastering SQL Server 2017

Mastering SQL Server 2017

Milos Radivojevic, Dejan Sarka, William Durkin, Christian Cote, Matija Lah

Publisher Resources

ISBN: 9781787283572Supplemental Content