Artificial Intelligence with Python Cookbook
eBook - ePub

Artificial Intelligence with Python Cookbook

Proven recipes for applying AI algorithms and deep learning techniques using TensorFlow 2.x and PyTorch 1.6

Ben Auffarth

  1. 468 páginas
  2. English
  3. ePUB (apto para móviles)
  4. Disponible en iOS y Android
eBook - ePub

Artificial Intelligence with Python Cookbook

Proven recipes for applying AI algorithms and deep learning techniques using TensorFlow 2.x and PyTorch 1.6

Ben Auffarth

Detalles del libro
Vista previa del libro
Índice
Citas

Información del libro

Work through practical recipes to learn how to solve complex machine learning and deep learning problems using Python

Key Features

  • Get up and running with artificial intelligence in no time using hands-on problem-solving recipes
  • Explore popular Python libraries and tools to build AI solutions for images, text, sounds, and images
  • Implement NLP, reinforcement learning, deep learning, GANs, Monte-Carlo tree search, and much more

Book Description

Artificial intelligence (AI) plays an integral role in automating problem-solving. This involves predicting and classifying data and training agents to execute tasks successfully. This book will teach you how to solve complex problems with the help of independent and insightful recipes ranging from the essentials to advanced methods that have just come out of research.

Artificial Intelligence with Python Cookbook starts by showing you how to set up your Python environment and taking you through the fundamentals of data exploration. Moving ahead, you'll be able to implement heuristic search techniques and genetic algorithms. In addition to this, you'll apply probabilistic models, constraint optimization, and reinforcement learning. As you advance through the book, you'll build deep learning models for text, images, video, and audio, and then delve into algorithmic bias, style transfer, music generation, and AI use cases in the healthcare and insurance industries. Throughout the book, you'll learn about a variety of tools for problem-solving and gain the knowledge needed to effectively approach complex problems.

By the end of this book on AI, you will have the skills you need to write AI and machine learning algorithms, test them, and deploy them for production.

What you will learn

  • Implement data preprocessing steps and optimize model hyperparameters
  • Delve into representational learning with adversarial autoencoders
  • Use active learning, recommenders, knowledge embedding, and SAT solvers
  • Get to grips with probabilistic modeling with TensorFlow probability
  • Run object detection, text-to-speech conversion, and text and music generation
  • Apply swarm algorithms, multi-agent systems, and graph networks
  • Go from proof of concept to production by deploying models as microservices
  • Understand how to use modern AI in practice

Who this book is for

This AI machine learning book is for Python developers, data scientists, machine learning engineers, and deep learning practitioners who want to learn how to build artificial intelligence solutions with easy-to-follow recipes. You'll also find this book useful if you're looking for state-of-the-art solutions to perform different machine learning tasks in various use cases. Basic working knowledge of the Python programming language and machine learning concepts will help you to work with code effectively in this book.

Preguntas frecuentes

¿Cómo cancelo mi suscripción?
Simplemente, dirígete a la sección ajustes de la cuenta y haz clic en «Cancelar suscripción». Así de sencillo. Después de cancelar tu suscripción, esta permanecerá activa el tiempo restante que hayas pagado. Obtén más información aquí.
¿Cómo descargo los libros?
Por el momento, todos nuestros libros ePub adaptables a dispositivos móviles se pueden descargar a través de la aplicación. La mayor parte de nuestros PDF también se puede descargar y ya estamos trabajando para que el resto también sea descargable. Obtén más información aquí.
¿En qué se diferencian los planes de precios?
Ambos planes te permiten acceder por completo a la biblioteca y a todas las funciones de Perlego. Las únicas diferencias son el precio y el período de suscripción: con el plan anual ahorrarás en torno a un 30 % en comparación con 12 meses de un plan mensual.
¿Qué es Perlego?
Somos un servicio de suscripción de libros de texto en línea que te permite acceder a toda una biblioteca en línea por menos de lo que cuesta un libro al mes. Con más de un millón de libros sobre más de 1000 categorías, ¡tenemos todo lo que necesitas! Obtén más información aquí.
¿Perlego ofrece la función de texto a voz?
Busca el símbolo de lectura en voz alta en tu próximo libro para ver si puedes escucharlo. La herramienta de lectura en voz alta lee el texto en voz alta por ti, resaltando el texto a medida que se lee. Puedes pausarla, acelerarla y ralentizarla. Obtén más información aquí.
¿Es Artificial Intelligence with Python Cookbook un PDF/ePUB en línea?
Sí, puedes acceder a Artificial Intelligence with Python Cookbook de Ben Auffarth en formato PDF o ePUB, así como a otros libros populares de Computer Science y Data Processing. Tenemos más de un millón de libros disponibles en nuestro catálogo para que explores.

Información

Año
2020
ISBN
9781789137965
Edición
1
Categoría
Data Processing
Advanced Topics in Supervised Machine Learning
Following the tasters with scikit-learn, Keras, and PyTorch in the previous chapter, in this chapter, we will move on to more end-to-end examples. These examples are more advanced in the sense that they include more complex transformations and model types.
We'll be predicting partner choices with sklearn, where we'll implement a lot of custom transformer steps and more complicated machine learning pipelines. We'll then predict house prices in PyTorch and visualize feature and neuron importance. After that, we will perform active learning to decide customer values together with online learning in sklearn. In the well-known case of repeat offender prediction, we'll build a model without racial bias. Last, but not least, we'll forecast time series of CO2 levels.
Online learning in this context (as opposed to internet-based learning) refers to a model update strategy that incorporates training data that comes in sequentially. This can be useful in cases where the dataset is very big (often the case with images, videos, and texts) or where it's important to keep the model up to date given the changing nature of the data.
In many of these recipes, we've shortened the description to the most salient details in order to highlight particular concepts. For the full details, please refer to the notebooks on GitHub.
In this chapter, we'll be covering the following recipes:
  • Transforming data in scikit-learn
  • Predicting house prices in PyTorch
  • Live decisioning customer values
  • Battling algorithmic bias
  • Forecasting CO2 time series

Technical requirements

The code and notebooks for this chapter are available on GitHub at https://github.com/PackPublishing/Artificial-Intelligence-with-Python-Cookbook/tree/master/chapter02.

Transforming data in scikit-learn

In this recipe, we will be building more complex pipelines using mixed-type columnar data. We'll use a speed dating dataset that was published in 2006 by Fisman et al.: https://doi.org/10.1162/qjec.2006.121.2.673
Perhaps this recipe will be informative in more ways than one, and we'll learn something useful about the mechanics of human mating choices.
The dataset description on the OpenML website reads as follows:
This data was gathered from participants in experimental speed dating events from 2002-2004. During the events, the attendees would have a four-minute first date with every other participant of the opposite sex. At the end of their 4 minutes, participants were asked whether they would like to see their date again. They were also asked to rate their date on six attributes: attractiveness, sincerity, intelligence, fun, ambition, and shared interests. The dataset also includes questionnaire data gathered from participants at different points in the process. These fields include demographics, dating habits, self-perception across key attributes, beliefs in terms of what others find valuable in a mate, and lifestyle information.
The problem is to predict mate choices from what we know about participants and their matches. This dataset presents some challenges that can serve an illustrative purpose:
  • It contains 123 different features, of different types:
    • Categorical
    • Numerical
    • Range features
It also contains the following:
  • Some missing values
  • Target imbalance
On the way to solving this problem of predicting mate choices, we will build custom encoders in scikit-learn and a pipeline comprising all features and their preprocessing steps.
The primary focus in this recipe will be on pipelines and transformers. In particular, we will build a custom transformer for working with range features and another one for numerical features.

Getting ready

We'll need the following libraries for this recipe. They are as follows:
  • OpenML to download the dataset
  • openml_speed_dating_pipeline_steps to use our custom transformer
  • imbalanced-learn to work with imbalanced classes
  • shap to show us the importance of features
In order to install them, we can use pip again:
pip install -q openml openml_speed_dating_pipeline_steps==0.5.5 imbalanced_learn category_encoders shap
OpenML is an organi...

Índice

  1. Title Page
  2. Copyright and Credits
  3. About Packt
  4. Contributors
  5. Preface
  6. Getting Started with Artificial Intelligence in Python
  7. Advanced Topics in Supervised Machine Learning
  8. Patterns, Outliers, and Recommendations
  9. Probabilistic Modeling
  10. Heuristic Search Techniques and Logical Inference
  11. Deep Reinforcement Learning
  12. Advanced Image Applications
  13. Working with Moving Images
  14. Deep Learning in Audio and Speech
  15. Natural Language Processing
  16. Artificial Intelligence in Production
  17. Other Books You May Enjoy
Estilos de citas para Artificial Intelligence with Python Cookbook

APA 6 Citation

Auffarth, B. (2020). Artificial Intelligence with Python Cookbook (1st ed.). Packt Publishing. Retrieved from https://www.perlego.com/book/2035190/artificial-intelligence-with-python-cookbook-proven-recipes-for-applying-ai-algorithms-and-deep-learning-techniques-using-tensorflow-2x-and-pytorch-16-pdf (Original work published 2020)

Chicago Citation

Auffarth, Ben. (2020) 2020. Artificial Intelligence with Python Cookbook. 1st ed. Packt Publishing. https://www.perlego.com/book/2035190/artificial-intelligence-with-python-cookbook-proven-recipes-for-applying-ai-algorithms-and-deep-learning-techniques-using-tensorflow-2x-and-pytorch-16-pdf.

Harvard Citation

Auffarth, B. (2020) Artificial Intelligence with Python Cookbook. 1st edn. Packt Publishing. Available at: https://www.perlego.com/book/2035190/artificial-intelligence-with-python-cookbook-proven-recipes-for-applying-ai-algorithms-and-deep-learning-techniques-using-tensorflow-2x-and-pytorch-16-pdf (Accessed: 15 October 2022).

MLA 7 Citation

Auffarth, Ben. Artificial Intelligence with Python Cookbook. 1st ed. Packt Publishing, 2020. Web. 15 Oct. 2022.