Search icon CANCEL
Subscription
0
Cart icon
Cart
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Effective Amazon Machine Learning

You're reading from  Effective Amazon Machine Learning

Product type Book
Published in Apr 2017
Publisher Packt
ISBN-13 9781785883231
Pages 306 pages
Edition 1st Edition
Languages
Author (1):
Alexis Perrier Alexis Perrier
Profile icon Alexis Perrier
Toc

Table of Contents (17) Chapters close

Polynomial regression in Amazon ML


We will use Boto3 and Python SDK and follow the same method of generating the parameters for datasources that we used in Chapter 7, Command Line and SDK, to do the Monte Carlo validation: we will generate features corresponding to power 2 of x to power P of x and run N Monte Carlo cross-validation. The pseudo-code is as follows:

for each power from 2 to P:
    write sql that extracts power 1 to P from the nonlinear table
    do N times
        Create training and evaluation datasource
        Create model
        Evaluate model
        Get evaluation result
        Delete datasource and model
    Average results

In this exercise, we will go from 2 to 5 powers of x and do 5 trials for each model. The Python code to create a datasource from Redshift using create_data_source_from_rds() is as follows:

response = client.create_data_source_from_redshift(
    DataSourceId='string',
    DataSourceName='string',
    DataSpec={
        'DatabaseInformation': {
    ...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime