Hands-On Explainable AI (XAI) with Python


Book Description

Resolve the black box models in your AI applications to make them fair, trustworthy, and secure. Familiarize yourself with the basic principles and tools to deploy Explainable AI (XAI) into your apps and reporting interfaces. Key FeaturesLearn explainable AI tools and techniques to process trustworthy AI resultsUnderstand how to detect, handle, and avoid common issues with AI ethics and biasIntegrate fair AI into popular apps and reporting tools to deliver business value using Python and associated toolsBook Description Effectively translating AI insights to business stakeholders requires careful planning, design, and visualization choices. Describing the problem, the model, and the relationships among variables and their findings are often subtle, surprising, and technically complex. Hands-On Explainable AI (XAI) with Python will see you work with specific hands-on machine learning Python projects that are strategically arranged to enhance your grasp on AI results analysis. You will be building models, interpreting results with visualizations, and integrating XAI reporting tools and different applications. You will build XAI solutions in Python, TensorFlow 2, Google Cloud’s XAI platform, Google Colaboratory, and other frameworks to open up the black box of machine learning models. The book will introduce you to several open-source XAI tools for Python that can be used throughout the machine learning project life cycle. You will learn how to explore machine learning model results, review key influencing variables and variable relationships, detect and handle bias and ethics issues, and integrate predictions using Python along with supporting the visualization of machine learning models into user explainable interfaces. By the end of this AI book, you will possess an in-depth understanding of the core concepts of XAI. What you will learnPlan for XAI through the different stages of the machine learning life cycleEstimate the strengths and weaknesses of popular open-source XAI applicationsExamine how to detect and handle bias issues in machine learning dataReview ethics considerations and tools to address common problems in machine learning dataShare XAI design and visualization best practicesIntegrate explainable AI results using Python modelsUse XAI toolkits for Python in machine learning life cycles to solve business problemsWho this book is for This book is not an introduction to Python programming or machine learning concepts. You must have some foundational knowledge and/or experience with machine learning libraries such as scikit-learn to make the most out of this book. Some of the potential readers of this book include: Professionals who already use Python for as data science, machine learning, research, and analysisData analysts and data scientists who want an introduction into explainable AI tools and techniquesAI Project managers who must face the contractual and legal obligations of AI Explainability for the acceptance phase of their applications




Explainable AI with Python


Book Description

This book provides a full presentation of the current concepts and available techniques to make “machine learning” systems more explainable. The approaches presented can be applied to almost all the current “machine learning” models: linear and logistic regression, deep learning neural networks, natural language processing and image recognition, among the others. Progress in Machine Learning is increasing the use of artificial agents to perform critical tasks previously handled by humans (healthcare, legal and finance, among others). While the principles that guide the design of these agents are understood, most of the current deep-learning models are "opaque" to human understanding. Explainable AI with Python fills the current gap in literature on this emerging topic by taking both a theoretical and a practical perspective, making the reader quickly capable of working with tools and code for Explainable AI. Beginning with examples of what Explainable AI (XAI) is and why it is needed in the field, the book details different approaches to XAI depending on specific context and need. Hands-on work on interpretable models with specific examples leveraging Python are then presented, showing how intrinsic interpretable models can be interpreted and how to produce “human understandable” explanations. Model-agnostic methods for XAI are shown to produce explanations without relying on ML models internals that are “opaque.” Using examples from Computer Vision, the authors then look at explainable models for Deep Learning and prospective methods for the future. Taking a practical perspective, the authors demonstrate how to effectively use ML and XAI in science. The final chapter explains Adversarial Machine Learning and how to do XAI with adversarial examples.




Interpretable Machine Learning with Python


Book Description

A deep and detailed dive into the key aspects and challenges of machine learning interpretability, complete with the know-how on how to overcome and leverage them to build fairer, safer, and more reliable models Key Features Learn how to extract easy-to-understand insights from any machine learning model Become well-versed with interpretability techniques to build fairer, safer, and more reliable models Mitigate risks in AI systems before they have broader implications by learning how to debug black-box models Book DescriptionDo you want to gain a deeper understanding of your models and better mitigate poor prediction risks associated with machine learning interpretation? If so, then Interpretable Machine Learning with Python deserves a place on your bookshelf. We’ll be starting off with the fundamentals of interpretability, its relevance in business, and exploring its key aspects and challenges. As you progress through the chapters, you'll then focus on how white-box models work, compare them to black-box and glass-box models, and examine their trade-off. You’ll also get you up to speed with a vast array of interpretation methods, also known as Explainable AI (XAI) methods, and how to apply them to different use cases, be it for classification or regression, for tabular, time-series, image or text. In addition to the step-by-step code, this book will also help you interpret model outcomes using examples. You’ll get hands-on with tuning models and training data for interpretability by reducing complexity, mitigating bias, placing guardrails, and enhancing reliability. The methods you’ll explore here range from state-of-the-art feature selection and dataset debiasing methods to monotonic constraints and adversarial retraining. By the end of this book, you'll be able to understand ML models better and enhance them through interpretability tuning. What you will learn Recognize the importance of interpretability in business Study models that are intrinsically interpretable such as linear models, decision trees, and Naïve Bayes Become well-versed in interpreting models with model-agnostic methods Visualize how an image classifier works and what it learns Understand how to mitigate the influence of bias in datasets Discover how to make models more reliable with adversarial robustness Use monotonic constraints to make fairer and safer models Who this book is for This book is primarily written for data scientists, machine learning developers, and data stewards who find themselves under increasing pressures to explain the workings of AI systems, their impacts on decision making, and how they identify and manage bias. It’s also a useful resource for self-taught ML enthusiasts and beginners who want to go deeper into the subject matter, though a solid grasp on the Python programming language and ML fundamentals is needed to follow along.




Interpretable Machine Learning


Book Description

This book is about making machine learning models and their decisions interpretable. After exploring the concepts of interpretability, you will learn about simple, interpretable models such as decision trees, decision rules and linear regression. Later chapters focus on general model-agnostic methods for interpreting black box models like feature importance and accumulated local effects and explaining individual predictions with Shapley values and LIME. All interpretation methods are explained in depth and discussed critically. How do they work under the hood? What are their strengths and weaknesses? How can their outputs be interpreted? This book will enable you to select and correctly apply the interpretation method that is most suitable for your machine learning project.







Hands-On Mathematics for Deep Learning


Book Description

A comprehensive guide to getting well-versed with the mathematical techniques for building modern deep learning architectures Key FeaturesUnderstand linear algebra, calculus, gradient algorithms, and other concepts essential for training deep neural networksLearn the mathematical concepts needed to understand how deep learning models functionUse deep learning for solving problems related to vision, image, text, and sequence applicationsBook Description Most programmers and data scientists struggle with mathematics, having either overlooked or forgotten core mathematical concepts. This book uses Python libraries to help you understand the math required to build deep learning (DL) models. You'll begin by learning about core mathematical and modern computational techniques used to design and implement DL algorithms. This book will cover essential topics, such as linear algebra, eigenvalues and eigenvectors, the singular value decomposition concept, and gradient algorithms, to help you understand how to train deep neural networks. Later chapters focus on important neural networks, such as the linear neural network and multilayer perceptrons, with a primary focus on helping you learn how each model works. As you advance, you will delve into the math used for regularization, multi-layered DL, forward propagation, optimization, and backpropagation techniques to understand what it takes to build full-fledged DL models. Finally, you’ll explore CNN, recurrent neural network (RNN), and GAN models and their application. By the end of this book, you'll have built a strong foundation in neural networks and DL mathematical concepts, which will help you to confidently research and build custom models in DL. What you will learnUnderstand the key mathematical concepts for building neural network modelsDiscover core multivariable calculus conceptsImprove the performance of deep learning models using optimization techniquesCover optimization algorithms, from basic stochastic gradient descent (SGD) to the advanced Adam optimizerUnderstand computational graphs and their importance in DLExplore the backpropagation algorithm to reduce output errorCover DL algorithms such as convolutional neural networks (CNNs), sequence models, and generative adversarial networks (GANs)Who this book is for This book is for data scientists, machine learning developers, aspiring deep learning developers, or anyone who wants to understand the foundation of deep learning by learning the math behind it. Working knowledge of the Python programming language and machine learning basics is required.




Practical Explainable AI Using Python


Book Description

Learn the ins and outs of decisions, biases, and reliability of AI algorithms and how to make sense of these predictions. This book explores the so-called black-box models to boost the adaptability, interpretability, and explainability of the decisions made by AI algorithms using frameworks such as Python XAI libraries, TensorFlow 2.0+, Keras, and custom frameworks using Python wrappers. You'll begin with an introduction to model explainability and interpretability basics, ethical consideration, and biases in predictions generated by AI models. Next, you'll look at methods and systems to interpret linear, non-linear, and time-series models used in AI. The book will also cover topics ranging from interpreting to understanding how an AI algorithm makes a decision Further, you will learn the most complex ensemble models, explainability, and interpretability using frameworks such as Lime, SHAP, Skater, ELI5, etc. Moving forward, you will be introduced to model explainability for unstructured data, classification problems, and natural language processing–related tasks. Additionally, the book looks at counterfactual explanations for AI models. Practical Explainable AI Using Python shines the light on deep learning models, rule-based expert systems, and computer vision tasks using various XAI frameworks. What You'll Learn Review the different ways of making an AI model interpretable and explainable Examine the biasness and good ethical practices of AI models Quantify, visualize, and estimate reliability of AI models Design frameworks to unbox the black-box models Assess the fairness of AI models Understand the building blocks of trust in AI models Increase the level of AI adoption Who This Book Is For AI engineers, data scientists, and software developers involved in driving AI projects/ AI products.




Practical Natural Language Processing


Book Description

Many books and courses tackle natural language processing (NLP) problems with toy use cases and well-defined datasets. But if you want to build, iterate, and scale NLP systems in a business setting and tailor them for particular industry verticals, this is your guide. Software engineers and data scientists will learn how to navigate the maze of options available at each step of the journey. Through the course of the book, authors Sowmya Vajjala, Bodhisattwa Majumder, Anuj Gupta, and Harshit Surana will guide you through the process of building real-world NLP solutions embedded in larger product setups. You’ll learn how to adapt your solutions for different industry verticals such as healthcare, social media, and retail. With this book, you’ll: Understand the wide spectrum of problem statements, tasks, and solution approaches within NLP Implement and evaluate different NLP applications using machine learning and deep learning methods Fine-tune your NLP solution based on your business problem and industry vertical Evaluate various algorithms and approaches for NLP product tasks, datasets, and stages Produce software solutions following best practices around release, deployment, and DevOps for NLP systems Understand best practices, opportunities, and the roadmap for NLP from a business and product leader’s perspective




Transformers for Natural Language Processing


Book Description

Publisher's Note: A new edition of this book is out now that includes working with GPT-3 and comparing the results with other models. It includes even more use cases, such as casual language analysis and computer vision tasks, as well as an introduction to OpenAI's Codex. Key FeaturesBuild and implement state-of-the-art language models, such as the original Transformer, BERT, T5, and GPT-2, using concepts that outperform classical deep learning modelsGo through hands-on applications in Python using Google Colaboratory Notebooks with nothing to install on a local machineTest transformer models on advanced use casesBook Description The transformer architecture has proved to be revolutionary in outperforming the classical RNN and CNN models in use today. With an apply-as-you-learn approach, Transformers for Natural Language Processing investigates in vast detail the deep learning for machine translations, speech-to-text, text-to-speech, language modeling, question answering, and many more NLP domains with transformers. The book takes you through NLP with Python and examines various eminent models and datasets within the transformer architecture created by pioneers such as Google, Facebook, Microsoft, OpenAI, and Hugging Face. The book trains you in three stages. The first stage introduces you to transformer architectures, starting with the original transformer, before moving on to RoBERTa, BERT, and DistilBERT models. You will discover training methods for smaller transformers that can outperform GPT-3 in some cases. In the second stage, you will apply transformers for Natural Language Understanding (NLU) and Natural Language Generation (NLG). Finally, the third stage will help you grasp advanced language understanding techniques such as optimizing social network datasets and fake news identification. By the end of this NLP book, you will understand transformers from a cognitive science perspective and be proficient in applying pretrained transformer models by tech giants to various datasets. What you will learnUse the latest pretrained transformer modelsGrasp the workings of the original Transformer, GPT-2, BERT, T5, and other transformer modelsCreate language understanding Python programs using concepts that outperform classical deep learning modelsUse a variety of NLP platforms, including Hugging Face, Trax, and AllenNLPApply Python, TensorFlow, and Keras programs to sentiment analysis, text summarization, speech recognition, machine translations, and moreMeasure the productivity of key transformers to define their scope, potential, and limits in productionWho this book is for Since the book does not teach basic programming, you must be familiar with neural networks, Python, PyTorch, and TensorFlow in order to learn their implementation with Transformers. Readers who can benefit the most from this book include experienced deep learning & NLP practitioners and data analysts & data scientists who want to process the increasing amounts of language-driven data.




Mastering Machine Learning Algorithms


Book Description

Explore and master the most important algorithms for solving complex machine learning problems. Key Features Discover high-performing machine learning algorithms and understand how they work in depth. One-stop solution to mastering supervised, unsupervised, and semi-supervised machine learning algorithms and their implementation. Master concepts related to algorithm tuning, parameter optimization, and more Book Description Machine learning is a subset of AI that aims to make modern-day computer systems smarter and more intelligent. The real power of machine learning resides in its algorithms, which make even the most difficult things capable of being handled by machines. However, with the advancement in the technology and requirements of data, machines will have to be smarter than they are today to meet the overwhelming data needs; mastering these algorithms and using them optimally is the need of the hour. Mastering Machine Learning Algorithms is your complete guide to quickly getting to grips with popular machine learning algorithms. You will be introduced to the most widely used algorithms in supervised, unsupervised, and semi-supervised machine learning, and will learn how to use them in the best possible manner. Ranging from Bayesian models to the MCMC algorithm to Hidden Markov models, this book will teach you how to extract features from your dataset and perform dimensionality reduction by making use of Python-based libraries such as scikit-learn. You will also learn how to use Keras and TensorFlow to train effective neural networks. If you are looking for a single resource to study, implement, and solve end-to-end machine learning problems and use-cases, this is the book you need. What you will learn Explore how a ML model can be trained, optimized, and evaluated Understand how to create and learn static and dynamic probabilistic models Successfully cluster high-dimensional data and evaluate model accuracy Discover how artificial neural networks work and how to train, optimize, and validate them Work with Autoencoders and Generative Adversarial Networks Apply label spreading and propagation to large datasets Explore the most important Reinforcement Learning techniques Who this book is for This book is an ideal and relevant source of content for data science professionals who want to delve into complex machine learning algorithms, calibrate models, and improve the predictions of the trained model. A basic knowledge of machine learning is preferred to get the best out of this guide.