Skip to content

Releases: causalgo/lasso

v0.2.1: Organization Rename

Choose a tag to compare

@kolkov kolkov released this 25 Nov 18:58

Hotfix Release

Changed

  • Renamed organization from CausalGo to causalgo (lowercase)
  • Module path updated to github.com/causalgo/lasso

Migration

Update your imports:

// Before
import "github.com/CausalGo/lasso"

// After  
import "github.com/causalgo/lasso"

Update go.mod:

go get github.com/causalgo/lasso@v0.2.1

Full Changelog: v0.2.0...v0.2.1

v0.2.0: Elastic Net, Cross-validation, Model Persistence

Choose a tag to compare

@kolkov kolkov released this 25 Nov 17:34

What's New

Added

  • Elastic Net regularization with Alpha parameter (L1+L2 mix)
  • K-fold cross-validation for automatic lambda selection
  • Model serialization (Save/Load to JSON)
  • Input validation for NaN/Inf values
  • Comprehensive benchmarks
  • Project infrastructure (CI/CD, linting, documentation)

Changed

  • Refactored to sequential coordinate descent (better cache locality)
  • Optimized matrix access with RawMatrix() direct slice operations
  • Reduced per-iteration allocations with predictInto()
  • Lambda now scaled by nSamples for sklearn compatibility
  • Fit() returns error instead of panic
  • Updated to Go 1.25

Fixed

  • Population variance (n) instead of sample variance (n-1) for sklearn consistency

Installation

go get github.com/CausalGo/lasso@v0.2.0

Full Changelog: v0.1.0...v0.2.0

v0.1.0 - Stable Release: Parallel LASSO Regression

Choose a tag to compare

@kolkov kolkov released this 07 Jun 22:38

Release v0.1.0: Parallel LASSO Regression in Go

🎉 Stable Release v0.1.0 Now Available!
A high-performance LASSO regression implementation in Go featuring parallel coordinate descent. Perfect for feature selection and building interpretable ML models.

go get github.com/CausalGo/lasso@v0.1.0

🌟 Key Features:

✅ Parallel coordinate descent (goroutines)
✅ L1 regularization for automatic feature selection
✅ Data standardization support
✅ Early stopping and convergence tracking
✅ Full training history (MSE, R², weight deltas)
✅ Thread-safe implementation (race-free)
✅ 100% test coverage

⚡ Quick Start:

package main

import (
	"fmt"
	"github.com/CausalGo/lasso"
	"gonum.org/v1/gonum/mat"
)

func main() {
	// Data
	X := mat.NewDense(4, 2, []float64{1, 2, 3, 4, 5, 6, 7, 8})
	y := []float64{3, 7, 11, 15}

	// Configuration
	cfg := lasso.NewDefaultConfig()
	cfg.Lambda = 0.1
	cfg.Verbose = true

	// Train model
	model := lasso.Fit(X, y, cfg)

	// Prediction
	newX := mat.NewDense(1, 2, []float64{2, 3})
	fmt.Println("Prediction:", model.Predict(newX)[0])
}

📊 Sample Output:

Starting LASSO training
Params: λ=0.1000, MaxIter=1000, Tol=1e-04
Samples: 4, Features: 2

Iter    0: MSE=12.5000 R²=0.0000 |Δ|=1.25e+00 |Δb|=1.25e+00 | Active=2/2 | Time=45.2µs
Iter    5: MSE=0.5000 R²=0.9600 |Δ|=1.25e-02 | Active=2/2 | Time=12.8µs
Converged at iteration 8: |Δ| < 1e-04

Training completed in 2.1ms
Weights: [0.9999 0.0000]
Intercept: 1.0001

Prediction: 3.0001

🔧 Key Improvements:

• Optimized parallel algorithm (up to 8x speedup)
• Added safe handling of sparse data
• Improved convergence for correlated features
• Detailed training logging
• Automatic handling of degenerate cases

📦 Installation:

# Use latest version
go get github.com/CausalGo/lasso@latest

# Or pin specific version
go get github.com/CausalGo/lasso@v0.1.0

📚 Resources:

  1. Full Documentation
  2. Usage Examples
  3. LASSO Theory
  4. Tuning Guide

⚖️ License:

MIT License - free for commercial and open-source use.

Copyright (c) 2023 CausalGo Team

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

🙏 Acknowledgments:

• Gonum team for excellent math libraries
• Go community for concurrency tools
• CausalGo contributors for testing and feedback

🚀 Start using LASSO in your Go projects today!
[Bug Reports] | [Feature Requests] | [Use Cases]