Book Image

Data Science with SQL Server Quick Start Guide

By : Dejan Sarka
Book Image

Data Science with SQL Server Quick Start Guide

By: Dejan Sarka

Overview of this book

SQL Server only started to fully support data science with its two most recent editions. If you are a professional from both worlds, SQL Server and data science, and interested in using SQL Server and Machine Learning (ML) Services for your projects, then this is the ideal book for you. This book is the ideal introduction to data science with Microsoft SQL Server and In-Database ML Services. It covers all stages of a data science project, from businessand data understanding,through data overview, data preparation, modeling and using algorithms, model evaluation, and deployment. You will learn to use the engines and languages that come with SQL Server, including ML Services with R and Python languages and Transact-SQL. You will also learn how to choose which algorithm to use for which task, and learn the working of each algorithm.
Table of Contents (15 chapters)
Title Page
Copyright and Credits
Packt Upsell
Contributors
Preface
Index

Using R data structures


As promised, I am now introducing the most important data structures in R. When you analyze the data, you analyze a dataset. A dataset looks like a SQL Server table: you can observe rows and columns. However, this is not a table in the relational sense, as defined in the Relational Model, which SQL Server follows. The order of rows and columns is not defined in a table that conforms to the Relational Model. However, in R, positions of cells as crossings of rows and columns are known. This is more like a matrix in mathematics.

In the R dataset, rows are also called cases or observations. You analyze the cases by using the values in their columns, also called variables or attributes of the cases. 

 

 

I will introduce the following data structures in this section:

  • Matrices and arrays
  • Factors
  • Lists
  • Data frames

A matrix is a two-dimensional array. All of the values of a matrix must have the same mode – you can have integers only, or strings only, and so on. Use the matrix() function...