Machine Learning with Go
334 pages
English
PDF
4.5

Machine Learning with Go

Machine Learning with Go

Author:

Year:

Summary:

Introduction

The book «Machine Learning with Go» (author — Daniel Whitenack, 2017, 334 pages) is one of the few publications dedicated to applying machine learning methods in the Go language (Golang). While Python and R dominate the field of Data Science, Go offers high performance, ease of deployment, and excellent support for concurrency. This book aims to introduce Go developers to the basics of ML and show how to build effective models using the Go ecosystem.

What the book is about

The book covers the complete data workflow: from collection and preprocessing to building, evaluating, and deploying models. The author systematically covers key topics:

  • Go Basics for ML — working with numerical libraries (gonum, mat), reading/writing CSV, JSON, working with matrices.
  • Regression — linear and multiple regression, quality assessment (MSE, R²).
  • Classification — logistic regression, k-nearest neighbors, decision trees, naive Bayes classifier.
  • Clustering — k-means, hierarchical clustering, silhouette score.
  • Neural Networks — building simple neural networks using the Gorgonia library, training via backpropagation.
  • Natural Language Processing — tokenization, stemming, TF-IDF, text classification.
  • Model Deployment — creating a REST API in Go, integration with Docker, monitoring.

Who this book is for

The book is intended for Go developers who want to learn machine learning without switching to Python. It will also be useful for data scientists who want to learn Go for production systems. The reader is expected to have a basic knowledge of Go (syntax, goroutines) and minimal familiarity with mathematical statistics.

What the reader will learn

  • How to process and visualize data using Go.
  • How to implement regression, classification, and clustering algorithms from scratch and using libraries.
  • How to build and train neural networks in Go.
  • How to evaluate model quality and select hyperparameters.
  • How to package a model into a microservice and deploy it in the cloud.

Strengths

  • Practical focus — each section is accompanied by code that can be run immediately.
  • Emphasis on the Go ecosystem — the author introduces gonum, gorgonia, golearn, and other libraries.
  • Clear structure — from simple to complex, with examples from real-world problems (price analysis, spam classification, customer clustering).
  • Performance — Go code often runs faster than Python equivalents, which is important for large data.

Recommended for

The book will be useful for Go programmers who want to expand their skills towards Data Science, as well as teams building high-load ML systems in Go. If you already know Python but want to try Go for ML, this is an excellent starting point. However, note that the book was published in 2017, and some libraries may have been updated — it is recommended to check the current documentation.

Recommendations