Machine Learning and Go (Golang): From Basics to Production
300 pages
English
PDF
4.5

Machine Learning and Go (Golang): From Basics to Production

Machine Learning and Go (Golang): From Basics to Production

Author:

Year:

Summary:

This book is the first practical guide in Russian on building machine learning systems in the Go language. If you are a Go developer looking to integrate ML into your projects, or a data scientist interested in a performant and reliable language for production, this book is for you.



What the book is about

The book covers the complete machine learning workflow in Go: from data collection and preprocessing, building models (linear regression, decision trees, neural networks) to deploying them in a microservice architecture. Special attention is given to:

  • Libraries and frameworks: golearn, Gorgonia, gonum, tfgo (TensorFlow for Go);
  • Processing large volumes of data using channels and goroutines;
  • Integration with external ML services (TensorFlow Serving, ONNX Runtime);
  • Creating REST/gRPC APIs for models;
  • Testing, monitoring, and A/B testing of ML systems.


Who this book is for

  • Go developers who want to add machine learning to their stack;
  • Data scientists looking to transition from Python to more performant Go;
  • DevOps engineers responsible for deploying ML models;
  • Students and instructors of machine learning courses.


What you will learn

  • How to choose the right tool for a specific ML task in Go;
  • How to build and train regression, classification, and clustering models;
  • How to optimize a model for high load and low latency;
  • How to integrate a model into an existing Go service (e.g., using the Gin or Echo framework);
  • How to use ONNX to transfer models between Python and Go;
  • How to write unit tests for ML components and manage model versions (DVC, Git LFS).


Why Go for ML?

Go combines the performance of C/C++ with the simplicity of Python. It is ideal for production: static typing, fast compilation, built-in concurrency support. The book shows how these advantages help build scalable and reliable ML systems.



Example from the book

In Chapter 5, you will implement a recommendation service based on collaborative filtering — from loading data from CSV to deploying in Docker with Kubernetes. The full code and tests are available in the repository.



The book is intended for readers with a basic knowledge of Go (syntax, structures, interfaces) and the fundamentals of machine learning (what features, metrics, and overfitting are).

Recommendations