Chapter 10. How Ray Powers Machine Learning

You now have a solid grasp of everything in Ray needed to get your data ready to train ML models. In this chapter, you will learn how to use the popular Ray libraries scikit-learn, XGBoost, and PyTorch. This chapter is not intended to introduce these libraries, so if you aren’t familiar with any of them, you should pick one (and we suggest scikit-learn) to read up on first. Even for those familiar with these libraries, refreshing your memory by consulting your favorite tools’ documentation will be beneficial. This chapter is about how Ray is used to power ML, rather than a tutorial on ML.

Note

If you are interested in going deeper into ML with Ray, Learning Ray by Max Pumperla et al. (O’Reilly) is a full-length book focused on ML with Ray that can expand your ML skillset.

Ray has two built-in libraries for ML. You will learn how to use Ray’s reinforcement learning library, RLlib, with TensorFlow and use generic hyperparameter tuning via Tune, which can be used with any ML library.

Using scikit-learn with Ray

scikit-learn is one of the most widely used tools in the ML community, offering dozens of easy-to-use ML algorithms. It was initially developed by David Cournapeau as a Google Summer of Code project in 2007. It provides a wide range of supervised and unsupervised learning algorithms via a consistent interface.

The scikit-learn ML algorithms include the following:

Clustering

For grouping unlabeled data such as k-means

Supervised ...

Get Scaling Python with Ray now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.