SambaSafety automates customized R workload, bettering driver security with Amazon SageMaker and AWS Step Features

At SambaSafety, their mission is to advertise safer communities by decreasing danger by way of knowledge insights. Since 1998, SambaSafety has been the main North American supplier of cloud–primarily based mobility danger administration software program for organizations with business and non–business drivers. SambaSafety serves greater than 15,000 world employers and insurance coverage carriers with driver danger and compliance monitoring, on-line coaching and deep danger analytics, in addition to danger pricing options. By the gathering, correlation and evaluation of driver file, telematics, company and different sensor knowledge, SambaSafety not solely helps employers higher implement security insurance policies and scale back claims, but in addition helps insurers make knowledgeable underwriting choices and background screeners carry out correct, environment friendly pre–rent checks.

Not all drivers current the identical danger profile. The extra time spent behind the wheel, the upper your danger profile. SambaSafety’s crew of information scientists has developed advanced and propriety modeling options designed to precisely quantify this danger profile. Nonetheless, they sought help to deploy this resolution for batch and real-time inference in a constant and dependable method.

On this publish, we focus on how SambaSafety used AWS machine studying (ML) and steady integration and steady supply (CI/CD) instruments to deploy their present knowledge science software for batch inference. SambaSafety labored with AWS Superior Consulting Accomplice Firemind to ship an answer that used AWS CodeStar, AWS Step Functions, and Amazon SageMaker for this workload. With AWS CI/CD and AI/ML merchandise, SambaSafety’s knowledge science crew didn’t have to alter their present growth workflow to benefit from steady mannequin coaching and inference.

Buyer use case

SambaSafety’s knowledge science crew had lengthy been utilizing the facility of information to tell their enterprise. They’d a number of expert engineers and scientists constructing insightful fashions that improved the standard of danger evaluation on their platform. The challenges confronted by this crew weren’t associated to knowledge science. SambaSafety’s knowledge science crew wanted assist connecting their present knowledge science workflow to a steady supply resolution.

SambaSafety’s knowledge science crew maintained a number of script-like artifacts as a part of their growth workflow. These scripts carried out a number of duties, together with knowledge preprocessing, function engineering, mannequin creation, mannequin tuning, and mannequin comparability and validation. These scripts have been all run manually when new knowledge arrived into their surroundings for coaching. Moreover, these scripts didn’t carry out any mannequin versioning or internet hosting for inference. SambaSafety’s knowledge science crew had developed handbook workarounds to advertise new fashions to manufacturing, however this course of grew to become time-consuming and labor-intensive.

To unlock SambaSafety’s extremely expert knowledge science crew to innovate on new ML workloads, SambaSafety wanted to automate the handbook duties related to sustaining present fashions. Moreover, the answer wanted to copy the handbook workflow utilized by SambaSafety’s knowledge science crew, and make choices about continuing primarily based on the outcomes of those scripts. Lastly, the answer needed to combine with their present code base. The SambaSafety knowledge science crew used a code repository resolution exterior to AWS; the ultimate pipeline needed to be clever sufficient to set off primarily based on updates to their code base, which was written primarily in R.

Answer overview

The next diagram illustrates the answer structure, which was knowledgeable by one of many many open-source architectures maintained by SambaSafety’s supply accomplice Firemind.

Architecture Diagram

The answer delivered by Firemind for SambaSafety’s knowledge science crew was constructed round two ML pipelines. The primary ML pipeline trains a mannequin utilizing SambaSafety’s customized knowledge preprocessing, coaching, and testing scripts. The ensuing mannequin artifact is deployed for batch and real-time inference to mannequin endpoints managed by SageMaker. The second ML pipeline facilitates the inference request to the hosted mannequin. On this approach, the pipeline for coaching is decoupled from the pipeline for inference.

One of many complexities on this mission is replicating the handbook steps taken by the SambaSafety knowledge scientists. The crew at Firemind used Step Features and SageMaker Processing to finish this activity. Step Features permits you to run discrete duties in AWS utilizing AWS Lambda capabilities, Amazon Elastic Kubernetes Service (Amazon EKS) employees, or on this case SageMaker. SageMaker Processing permits you to outline jobs that run on managed ML situations inside the SageMaker ecosystem. Every run of a Step Operate job maintains its personal logs, run historical past, and particulars on the success or failure of the job.

The crew used Step Features and SageMaker, along with Lambda, to deal with the automation of coaching, tuning, deployment, and inference workloads. The one remaining piece was the continual integration of code modifications to this deployment pipeline. Firemind applied a CodeStar mission that maintained a connection to SambaSafety’s present code repository. When the industrious knowledge science crew at SambaSafety posts an replace to a particular department of their code base, CodeStar picks up the modifications and triggers the automation.


SambaSafety’s new serverless MLOps pipeline had a major affect on their functionality to ship. The combination of information science and software program growth permits their groups to work collectively seamlessly. Their automated mannequin deployment resolution diminished time to supply by as much as 70%.

SambaSafety additionally had the next to say:

“By automating our knowledge science fashions and integrating them into their software program growth lifecycle, we now have been capable of obtain a brand new degree of effectivity and accuracy in our companies. This has enabled us to remain forward of the competitors and ship revolutionary options to purchasers. Our purchasers will vastly profit from this with the sooner turnaround instances and improved accuracy of our options.”

SambaSafety linked with AWS account groups with their downside. AWS account and options structure groups labored to determine this resolution by sourcing from our strong accomplice community. Join together with your AWS account crew to determine related transformative alternatives for your corporation.

Concerning the Authors

frgudDan Ferguson is an AI/ML Specialist Options Architect (SA) on the Personal Fairness Options Structure at Amazon Internet Companies. Dan helps Personal Fairness backed portfolio corporations leverage AI/ML applied sciences to attain their enterprise targets.

KhalilAdibKhalil Adib is a Knowledge Scientist at Firemind, driving the innovation Firemind can present to their clients across the magical worlds of AI and ML. Khalil tinkers with the newest and best tech and fashions, making certain that Firemind are at all times on the bleeding edge.

JasonMathewJason Mathew is a Cloud Engineer at Firemind, main the supply of tasks for purchasers end-to-end from writing pipelines with IaC, constructing out knowledge engineering with Python, and pushing the boundaries of ML. Jason can be the important thing contributor to Firemind’s open supply tasks.

Geospatial Information Evaluation with OSMnx | by Eugenia Anello | Jun, 2023

The 5 Environment friendly Methods to Discover and Resolve Knowledge Points | by Hanzala Qureshi | Jun, 2023