O'Reilly logo

Hands-On Automated Machine Learning by Umit Mert Cakmak, Sibanjan Das

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Finding the best ML pipeline for product line prediction

Let's write a small wrapper function first to prepare a dataset by encoding categorical variables:

# Importing necessary variablesimport numpy as npimport pandas as pdfrom autosklearn.classification import AutoSklearnClassifierfrom autosklearn.regression import AutoSklearnRegressorfrom sklearn.model_selection import train_test_splitfrom sklearn.metrics import accuracy_scorefrom sklearn.preprocessing import LabelEncoderimport wgetimport pandas as pd# Machine learning algorithms work with numerical inputs and you need to transform all non-numerical inputs to numerical ones# Following snippet encode the categorical variableslink_to_data = 'https://apsportal.ibm.com/exchange-api/v1/entries/8044492073eb964f46597b4be06ff5ea/data?accessKey=9561295fa407698694b1e254d0099600' ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required