Hi, I'm Andrew Ganse. I'm an applied scientist who builds and leads ML systems end-to-end — from data pipelines to deployment. In the commercial world and in the past in the academic science world, the focus of my work has been in machine learning, inverse problems, optimization, signal processing, and data analysis. (My PhD as well as much of my past work as a physicist concerned inverse problems in geophysics). Here on research.ganse.org are some of my publicly shareable research results and toy problems and tools, both in data science topics and in applied physics topics. You can contact me at andrew@ganse.org.RAG EVALUATION WITH MLFLOW + LANGCHAIN
If you've seen any of my other DS/ML content you know I'm a big fan of MLflow. The bottom line is that making a new model is typically the quick and easy part. It's figuring out how to make it consistent and how to improve it that are the hard part - and the key is being fastidious and objective about what you (and your team) know about the model and data that you're working with. This is equally true with GenAI language models and RAG as it is for classic machine learning and deep learning. MLflow 3 has an expansive feature set for GenAI development and quantifiable evaluation that provides a lot of the toolset straight out of the box (or "container" 🙂?).FLOW_MODELS 2: IMAGE GENERATION AND ANOMALY DETECTION AS TWO SIDES OF SAME COIN.
Normalizing flow models are invertible neural networks, a type of generative model that in this image context offers a nice two-for-one benefit: simultaneously enabling unsupervised learning for image anomaly detection (by mapping unlabeled images to a distribution where statistical anomaly detection techniques can apply) and also enabling image simulation (by mapping randomly generated samples from a probability distribution into the image space). Now it may not be my ultimate use case, but it turns out there are, you know, a ton of cat images and datasets on the internet, so let's experiment with INNs and cats!GETTING MLFLOW+DATABASE RUNNING QUICKLY VIA DOCKER
This provides a get-running-quickly Docker-compose setup using containers for MLflow, PostgreSQL, and NGINX. Run MLflow's database in PostgreSQL, and put an NGINX reverse proxy in front of the MLflow website to allow some level of access restriction (say for a workgroup within an already-firewalled company intranet).DBSCAN CLUSTERING IN DECRYPTING AN IMAGE CYPHER
This wonderful kids' book series is fun not only for the stories themselves, but also because each of the first several books involves a cipher puzzle with "fairy hieroglyphics" - I love code puzzles! In the electronic form of the books I discovered the hieroglyphic sequence was moved to the back of the book, all perfectly lined up in matrices over a few pages at the end. And I thought, hey that seems like it'd be easy to parse and decrypt on a computer, just like the main character did!SEMANTIC SQL EXPERIMENTATION WITH POSTGRESQL'S PGVECTOR EXTENSION
For some types of semantic analysis we don't always need to always pull big dataframes of data out of the database to do the analysis externally if we already have embedding vectors stored in the database. PostgreSQL's pgvector extension provides powerful functionality for semantic search and aggregation right there in the SQL queries. Let's experiment with some of this by grabbing an arbitrary dataset (how about Kaggle's Seattle AirBnB listings/reviews), popping that into a database, running an embedding model on that to create embedding vectors, and exploring SQL queries using this functionality.MEDICAL IMAGE CLASSIFICATION BUILT WITH "MLFLOW PROJECTS"
Let's explore a supervised learning problem in medical imaging based on a public dataset and MLFlow's "Projects" functionality. A self-contained modeling module is trained, has its performance logged in MLFlow, and is able to be checked out as a deployable model image. There's a configurable implementation of this in my aganse/py_tf2_gpu_dock_mlflow repo. Let's try the malaria detection dataset from the Tensorflow datasets, which contains a balanced, labeled dataset of about 27,000 thin blood smear slide images of cells, and let's see how well we can detect malaria parasite presence in the images. This dataset is used to train/test different variations of image classification models, including VGG-16 and various sizes of more basic convolutional networks.FLOW_MODELS 1: DISTRIBUTION MAPPING.
Normalizing flow models are invertible neural networks, a type of generative model that give us a.) a one-to-one mapping to points with probabilities in the latent space corresponding to input points, b.) a way to compute the likelihood of the data exactly, and c.) computationally efficient training and inference, because the model’s transformations have a clever construction allowing the Jacobian determinants to be computed very cheaply. Those details allow for doing things in an understood Gaussian latent space that couldn't be done (or not easily) in the original data space; let's look at that a bit visually in some 2D examples here.PREDICTING BANK LOAN BEHAVIOR WITH RANDOM FOREST MODELS
Let's implement a random forest classifier from Scikit-Learn to see how well we can predict whether a bank client will have good loan behavior (meaning they won't default or become delinquent) if they are given a new loan. We'll use a public bank transactions/loans dataset from the PKDD99 Challenge conference for the modeling. In the process we'll fit and explore the assumptions made for this model, and learn about some limitations of Scikit-Learn's tree-based models.