From the course: SQL Server Machine Learning Services: R

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Sample a data set

Sample a data set

From the course: SQL Server Machine Learning Services: R

Start my 1-month free trial

Sample a data set

- [Instructor] One common statistical analysis technique involves sampling a certain number of records from a large datasets. These records should be selected at random so that they can be used in an analysis and give an unbiased result that will represent the full dataset. We can use a few lines of our code to return random records out of a dataset. In the Warehouse colors table is a column called ColorName. I've got a simple SELECT statement written right here on line number two, I'll highlight it and EXECUTE it so we can see what that table contains. This returns a list of 36 unique color names so we can play with. Now I want to write a script that'll return a random selection of these colors. With line number two still highlighted, I'll cut that to my clipboard, and then we'll turn to the our script template that we have down below. I'll paste the SELECT statement into the input data one parameter. While we're…

Contents