Data Science Performance Infrastructure

A cohesive collection of tools and processes to evaluate, control and improve the Data Department Services.

A complex challenge

The key output of the Data Department is wrapped in what we call the *insights*, which in short are alerts to prevent failures or share important information. In the rest of this article I will refer to those *insights* in a broad sense with all its dependencies as the data product; and when we need to point specifically to the alerts as a single entity we will refer to it as insights.

Improving the data product is a task that combines many aspects of the business, the accessible resources and technical challenges; thus it's no wonder that it usually involves a number of teams. Unfortunately, at the time, the Data Department lacked a systematic process to tackle this task, so as soon as I identified the magnitude and potential of this issue I focused on creating a framework to solve it, which gave birth to this project.


An infrastructure for scale

The solution, which took three quarters to be fully implemented, required the deployment of three infrastructure linked components and affected directly four teams , the Data Science Research (DSR) team, since it's the owner of the development and maintenance of the backend machine-learning models. The Machine Learning Operations (MLOps) team as owners of the service infrastructure who handles models load and execution. The Customer Support (CS) team since it is the visible front face to the customer and first affected by the data-product results. And finally, the Products team, which oversees product quality, requirements and priorities, especially from a business point of view. It is easy to see how these teams might be involved, the customer or the CS team identify an issue or a new hot requirement, one that the Product team must fit into their plan while deliverying the most value and ensuring that both the DS and MLOps teams have the resources to achieve the goal. In this chain of communication and priorities quite often misunderstandings and omissions lead to poor choises. And that is exactly what this project aimed to fix.

The infrastructure links three distinct components: a Customer Success Ticket Mining System (CS-TMS), whose goal is to extract information from the users, the CS-engineers and their interactions, in a form that is both useful to make short-term decisions to Product team, and to aid in adjusting the machine-learning model suit. An Insight Monitoring Toolkit (IMT), whose purpose is to analyze the internal and external quality of the delivered data-product in a wide, global sense. And last but not least, a Virtual Lab (VL), for evaluating the individual predictive performance of machine-learning models in an isolated environment. The three on their own are powerful enough, however when combined is when magic happens. The CS-TMS allows to effectively identify the most crucial features to fix or develop based on the most important metric, user feedback. With those priorities set, the IMT helps to figure out and understand which and what aspect of the insights should be address. Then the VL allows the technical teams to find what model(s) in specific is responsible for issue (topic) and draft possible solutions accordingly.

For the curious minds ...

Details of the components

The CS-TMS is essentially an ETL implementation that converts Slack Messages and Intercom tickets into actionable data for an analysis pipeline. The CS engineers have different tickets templates for different issue scenarios, which they can interact with as well as the data-scientist and machine-learning-engineers. These tickets pack the most relevant information of the case, which are stored in a MongoDB database and immediately help solve user issues. An analytics pipeline then runs every week, month and quarter creating metrics and plots that the BI team and I analyze to extract valuable information.

The IMT contains a number of tools introduces to help on measuring the impact of the generated insights. Among its content we find loggers, dashboards, pipelines and libraries, that under the hood use latent knowledge of the infrastructure and business logic to evaluate the quality of the insights. It is not a BI tool because it is focus towards identifying the root cause of technical issues within our internal infrastructure.

The VL is a Python packaged library that enables the evaluation of machine-learning models, whether they are classifiers, regressors or generators, under development or production environment. On top of that it supports two evaluation pipelines one for fitting and another for predicting, with the capability of using as input multiple data-sources: organic, synthetic, controlled, internal or external. In some sense it can be seen as custom MLFlow tool, even though it doesn't use it in any way.