Causal Inference and Discovery in Python                                                                                                                                                                                                         [Open in app]( or [online]()
[QLoRa, Reprompting, Retrieval Augmented Generation, Triton PyTorch Backend, Google Dialogflow ES in Twilio, PointNet Data Preparation]( Causal Inference and Discovery in Python Jun 2
Â
[Share](
 👋 Hey, "Causal inference is the key to unlocking the true value of data in making informed decisions." - [Judea Pearl, Computer Scientist]( Inferences of causality allow us to understand cause-and-effect relationships, uncover hidden connections, predict outcomes, and design effective interventions, thereby guiding us in informed decision-making. Without it, we would be confined to surface-level observations, unable to discern true influences. Embracing this power is crucial in today's data-driven world, where precision and impact matter. With each causal relationship, we open up and propel ourselves towards transformative insights and informed decisions that shape our future. Having the importance of causal inference in mind, we have carefully curated this week's resources for [DataPro #46](. Our goal is to equip you with the knowledge and tools needed to make evidence-based decisions when building and selecting ML models for your data practices. [Causal Inference and Discovery in Python]( by [Aleksander Molak]( will be the central piece of this edition. Added to that, we will explore exciting research topics such as [QLoRa]( improving mathematical reasoning with [Process Supervision]( and using the [Reprompting]( technique for automated problem-solving optimization for LLMs.  Furthermore, we will cover practical topics like integrating a virtual agent using [Google Dialogflow ES into Twilio]( hosting ML models using [Triton PyTorch backend]( and building industry specific LLMs using [Retrieval Augmented Generation](.  But there is more! We will also analyze the [Data-centric AI]( concepts in segment anything, [Fast Spatial Joins]( on a single GPU, and a [3D Deep Learning Python]( tutorial. Get ready for an informed and impactful data-driven learning experience! If you’re interested in sharing ideas to foster the growth of the data community, then this survey is for you. Consider sharing your thoughts and get a FREE bestselling Packt ebook, [The Applied Artificial Intelligence Workshop]( PDF. Jump on in! [TELL US WHAT YOU THINK]( Cheers,
[Merlyn Shelley](
Editor in Chief, Packt This Week’s Key Highlights: - [Four LLM trends since ChatGPT and their implications for AI builders]( - [How to Make Your Python Packages Really Fast with Rust]( - [Scale your machine learning workloads on Amazon ECS]( - [Cloud Bigtable under the hood]( - [Modern AI is Domestification]( Latest Research on GitHub - [slundberg]( SHAP is a game theoretic method that explains machine learning model outputs by allocating credits using Shapley values. - [tensorflow]( Lucid is a collection of infrastructure and tools for research in neural network interpretability. - [pytorch]( Captum is an interpretability library for PyTorch models, offering implementations of integrated gradients, saliency maps, and more.  - [stellargraph]( StellarGraph library provides powerful [graph machine learning algorithms]( for analyzing and understanding graph-structured data. - [ModelOriented]( The DALEX package enables model exploration and explanation, aiding in understanding the behavior of complex models. - [artidoro]( QLoRA utilizes [bitsandbytes]( for quantization and integrates with Hugging Face's [PEFT]( and [transformers]( libraries. [Pledge your support]( Industry Insights AWS ML - [Scale your machine learning workloads on Amazon ECS powered by AWS Trainium instances:]( Running ML workloads with containers is common for encapsulating code and dependencies. [Amazon ECS]( simplifies deployment, management, and scaling of containerized apps. It integrates with AWS services and offers flexibility. The post demonstrates running ML training jobs on ECS using a Trn1 cluster, custom Docker image, ECR, and Trainium instance. - [Host ML models on Amazon SageMaker using Triton: CV model with PyTorch backend:]( This post explores how [Amazon SageMaker]( utilizes [NVIDIA Triton Inference Server]( to serve PyTorch models. SageMaker offers [real-time inference endpoints]( with support for single-model and multi-model endpoints. Understanding [Triton's PyTorch backend]( and its configuration parameters is crucial for efficient deployment. Google AI & ML - [Cloud Bigtable under the hood: How we improved single-row read throughput by 20-50%]( This article highlights recent projects that aimed to optimize the performance of [Bigtable]( a scalable NoSQL database. The improvements resulted in 20-50% higher single-row read throughput, reduced CPU utilization by 3%, and improved efficiency in read-heavy workloads. The performance gains demonstrate ongoing efforts to enhance [Bigtable's performance]( - [How to integrate a Virtual Agent using Google Dialogflow ES into a Twilio Conversation:]( This post discusses integrating Flex with Dialogflow for customer inquiries. Using Flex's Conversations API and SDKs, you can connect customers to virtual agents and utilize [Agent Assist]( and [Dialogflow]( CX. This integration offers a natural language understanding platform for asynchronous channels, enabling rich conversations over Twilio digital channels. Google has provided an open-source middleware solution to integrate text-based conversations from Twilio with Google Virtual Agents. The middleware can be deployed on a fully managed platform like Cloud Run. Expert Insights from Packt Community Causal Inference and Discovery in Python - By [Aleksander Molak]( Causality has a long history and has been addressed by most, if not all, advanced cultures that we know about. Aristotle – one of the most prolific philosophers of ancient Greece – claimed that understanding the causal structure of a process is a necessary ingredient of knowledge about this process. Moreover, he argued that being able to answer why-type questions is the essence of scientific explanation. Hume’s theory of causality This theory is very interesting from at least two points of view. First, elements of this theory have a high resemblance to a very powerful idea in psychology called conditioning. Conditioning is a form of learning. There are multiple types of conditioning, but they all rely on a common foundation – namely, association (hence the name for this type of learning – associative learning). In any type of conditioning, we take some event or object (usually called stimulus) and associate it with some behavior or reaction. Associative learning works across species. You can find it in humans, apes, dogs, and cats, but also in much simpler organisms such as snails (Alexander, Audesirk & Audesirk, 1985). Conditioning If you want to learn more about different types of conditioning, check this [( search for phrases such as classical conditioning versus operant conditioning and names such as Ivan Pavlov and Burrhus Skinner, respectively. Second, most classic machine learning algorithms also work on the basis of association. When we’re training a neural network in a supervised fashion, we’re trying to find a function that maps input to the output. To do it efficiently, we need to figure out which elements of the input are useful for predicting the output. And, in most cases, association is just good enough for this purpose. This excerpt is taken from the recently published book titled "[Causal Inference and Discovery in Python]( written by [Aleksander Molak]( published in May 2023. To get a preview of the book's content, be sure to read the [whole chapter available here]( or sign up for a [7-day free trial]( to access the complete Packt digital library. To explore more, click on the button below. [DISCOVER FRESH CONCEPTS & KEEP READING!]( Latest Developments in LLMs & GPTs - [Build Industry-Specific LLMs Using Retrieval Augmented Generation:]( Familiarize yourself with the importance of building industry-specific Large Language Models (LLMs) through techniques like RAG (Retrieval-Augmented Generation). Companies like [Microsoft]( Google, and Amazon are competing to create plug-and-play apps. Engineering the synchronization between LLMs and vector search is crucial for leveraging custom documents and gaining a competitive edge. Augmenting LLMs through document retrieval enhances their capabilities for tasks like ChatGPT, known as RAG. - [The Data-centric AI Concepts in Segment Anything:]( Here you will get to know the game-changing potential of Meta's Segment Anything in Computer Vision. With its large labeled dataset and simple, lightweight model architecture, [Segment Anything]( has garnered attention. The article also delves into the concept of [data-centric AI]( which prioritizes data quality and quantity over model development, distinguishing it from data-driven approaches. - [Four LLM trends since ChatGPT and their implications for AI builders:]( This article reviews recent trends and their implications for AI builders. Topics covered include task selection for autoregressive models, trade-offs between commercial and open-source LLMs, LLM integration, and mitigating failures in production. It emphasizes the need for careful evaluation, differentiation, and hands-on experimentation when working with LLMs. - [QLoRa: Fine-Tune a Large Language Model on Your GPU:]( This blog post introduces QLoRa, a method that enables fine-tuning of large language models (LLMs) on consumer hardware. [QLoRa]( utilizes adapters and freezes the original parameters, reducing memory requirements. It also incorporates 4-bit quantization, double quantization, and NVIDIA unified memory for improved performance. Find Out What’s New - [Improving mathematical reasoning with process supervision:]( The OpenAI team presents a model trained using process supervision, rewarding each step of reasoning in mathematical problem solving. Process supervision improves performance and aligns the model's thinking with humans, reducing logical mistakes called hallucinations. Comparing outcome supervision and process supervision, the latter shows significantly better performance. The dataset of process supervision is also released for further research. - [Modern AI is Domestification:]( As internet-scale AI models advance, the focus has shifted from proof-of-concept capabilities to improving the quality and reliability of fine-tuned models. Merely scaling up compute and parameters are no longer sufficient. The challenge lies in taming vast and diverse internet-scale data distributions for specific downstream capabilities. The optimal fine-tuning strategy is a key research area, as training large language and vision-language models heavily relies on extensive internet-scale data. - [3D Deep Learning Python Tutorial: PointNet Data Preparation:]( This Python guide provides instructions for structuring large LiDAR point clouds to train a 3D deep learning semantic segmentation model using the PointNet architecture. The tutorial enables users to apply these techniques to their own datasets and train a PointNet Semantic Segmentation model. The difference between 3D semantic segmentation and classification is explained, and the PointNet architecture for 3D point cloud classification is outlined. While 3D deep learning poses challenges, the guide breaks down complex topics into manageable chunks. - [Data Engineering: Fast Spatial Joins Across ~2 Billion Rows on a Single Old GPU:]( This article compares the performance of ORC and Parquet formats for spatial joins on a GeForce GTX 1060 GPU. It discusses the process, duration, and dataset used in the experiment. Parquet had a longer conversion time but was more efficient afterwards, making it suitable for multiple analyses. ORC had faster conversion but lower calculation efficiency, making it preferable for ad-hoc computations with tools like TrinoDB. - [How to Make Your Python Packages Really Fast with Rust:]( Rust is a memory-efficient, fast, and reliable language with a supportive community. It can be easily embedded into Python code using tools like [PyO3]( and [maturin](. To get started, install [Rust]( and create a virtual environment for testing. Consider rewriting performance-critical parts of your Python code in Rust using maturin. Keep in mind that Rust's advantages may be limited if CPU cycles are primarily spent on syscalls or network IO. - [Reprompting: Automated Problem-solving Optimization for LLMs:]( This research introduces Reprompting, an iterative sampling algorithm that automatically discovers effective prompts for large language models (LLMs) from question-answer pairs. It improves LLM performance on complex tasks, leveraging chain-of-thought prompting and Gibbs sampling, potentially bringing us closer to human-like reasoning. See you next time! As a GDPR-compliant company, we want you to know why you’re getting this email. The _datapro team, as a part of Packt Publishing, believes that you have a legitimate interest in our newsletter and its products. Our research shows that you opted-in for email communication with Packt Publishing in the past and we think your previous interest warrants our appropriate communication. If you do not feel that you should have received this or are no longer interested in _datapro, you can opt out of our emails by clicking the link below.  [Like](
[Comment](
[Restack](  © 2023 Copyright © 2022 Packt Publishing, All rights reserved.
Our mailing address is:, Packt Publishing
Livery Place, 35 Livery Street, Birmingham, West Midlands B3 2PB
United Kingdom
[Unsubscribe]() [Start writing]()