Book Image

SQL Server 2017 Machine Learning Services with R

By : Julie Koesmarno, Tomaž Kaštrun
Book Image

SQL Server 2017 Machine Learning Services with R

By: Julie Koesmarno, Tomaž Kaštrun

Overview of this book

R Services was one of the most anticipated features in SQL Server 2016, improved significantly and rebranded as SQL Server 2017 Machine Learning Services. Prior to SQL Server 2016, many developers and data scientists were already using R to connect to SQL Server in siloed environments that left a lot to be desired, in order to do additional data analysis, superseding SSAS Data Mining or additional CLR programming functions. With R integrated within SQL Server 2017, these developers and data scientists can now benefit from its integrated, effective, efficient, and more streamlined analytics environment. This book gives you foundational knowledge and insights to help you understand SQL Server 2017 Machine Learning Services with R. First and foremost, the book provides practical examples on how to implement, use, and understand SQL Server and R integration in corporate environments, and also provides explanations and underlying motivations. It covers installing Machine Learning Services;maintaining, deploying, and managing code;and monitoring your services. Delving more deeply into predictive modeling and the RevoScaleR package, this book also provides insights into operationalizing code and exploring and visualizing data. To complete the journey, this book covers the new features in SQL Server 2017 and how they are compatible with R, amplifying their combined power.
Table of Contents (12 chapters)

Built-in JSON capabilities

In this scenario, we will use the EMS incidents by month from the official city of Austin open data portal (https://data.austintexas.gov/Public-Safety/EMS-Incidents-by-Month/gjtj-jt2d). The data essentially contains incident counts, broken down by location and priorities for the city of Austin and Travis County incidents, and the percentage of on-time compliance.

The following are the prerequisites to get started:

  1. Download the data from https://data.austintexas.gov/resource/bpws-iwvb.json to a local path, such as C:\Temp\bpws-iwvb.json.
  2. Grant read access to the directory; for example:
Figure 10.1 Granting access to C:\Temp for MS SQL Server
  1. For ease of R visualization, we will use SQL Operations Studio. You can download SQL Ops Studio from: https://docs.microsoft.com/en-us/sql/sql-operations-studio/download.

The following is an excerpt of a JSON...