All Projects → sajari → Regression

sajari / Regression

Licence: mit
Multivariable regression library in Go

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to Regression

Machine Learning Octave
🤖 MatLab/Octave examples of popular machine learning algorithms with code examples and mathematics being explained
Stars: ✭ 637 (+112.33%)
Mutual labels:  linear-regression, regression
Machine Learning Concepts
Machine Learning Concepts with Concepts
Stars: ✭ 134 (-55.33%)
Mutual labels:  linear-regression, regression
Tensorflow Book
Accompanying source code for Machine Learning with TensorFlow. Refer to the book for step-by-step explanations.
Stars: ✭ 4,448 (+1382.67%)
Mutual labels:  linear-regression, regression
Mlkit
A simple machine learning framework written in Swift 🤖
Stars: ✭ 144 (-52%)
Mutual labels:  linear-regression, regression
Machine learning
Estudo e implementação dos principais algoritmos de Machine Learning em Jupyter Notebooks.
Stars: ✭ 161 (-46.33%)
Mutual labels:  linear-regression, regression
netflix-style-recommender
A simple movie recommendation engine
Stars: ✭ 65 (-78.33%)
Mutual labels:  linear-regression, regression
Tensorflow cookbook
Code for Tensorflow Machine Learning Cookbook
Stars: ✭ 5,984 (+1894.67%)
Mutual labels:  linear-regression, regression
100daysofmlcode
My journey to learn and grow in the domain of Machine Learning and Artificial Intelligence by performing the #100DaysofMLCode Challenge.
Stars: ✭ 146 (-51.33%)
Mutual labels:  linear-regression, regression
Java Deep Learning Cookbook
Code for Java Deep Learning Cookbook
Stars: ✭ 156 (-48%)
Mutual labels:  linear-regression, regression
interactive-simple-linear-regression
A PureScript, browser-based implementation of simple linear regression.
Stars: ✭ 15 (-95%)
Mutual labels:  linear-regression, regression
Fuku Ml
Simple machine learning library / 簡單易用的機器學習套件
Stars: ✭ 280 (-6.67%)
Mutual labels:  linear-regression, regression
MachineLearningSeries
Vídeos e códigos do Universo Discreto ensinando o fundamental de Machine Learning em Python. Para mais detalhes, acompanhar a playlist listada.
Stars: ✭ 20 (-93.33%)
Mutual labels:  linear-regression
Synthetic-data-gen
Various methods for generating synthetic data for data science and ML
Stars: ✭ 57 (-81%)
Mutual labels:  regression
GARD
Generalized Analog Regression Downscaling (GARD) code
Stars: ✭ 21 (-93%)
Mutual labels:  regression
Predict-housing-prices-in-Portland
Predict housing prices in Portland, Oregon for selling or buying house
Stars: ✭ 15 (-95%)
Mutual labels:  linear-regression
2018 Machinelearning Lectures Esa
Machine Learning Lectures at the European Space Agency (ESA) in 2018
Stars: ✭ 280 (-6.67%)
Mutual labels:  linear-regression
PartialLeastSquaresRegressor.jl
Implementation of a Partial Least Squares Regressor
Stars: ✭ 31 (-89.67%)
Mutual labels:  regression
Countries-GDP-prediction
Developed a supervised machine learning system that can estimate a country's GDP per capita using regression algorithms.
Stars: ✭ 15 (-95%)
Mutual labels:  regression
battery-rul-estimation
Remaining Useful Life (RUL) estimation of Lithium-ion batteries using deep LSTMs
Stars: ✭ 25 (-91.67%)
Mutual labels:  regression
pywedge
Makes Interactive Chart Widget, Cleans raw data, Runs baseline models, Interactive hyperparameter tuning & tracking
Stars: ✭ 49 (-83.67%)
Mutual labels:  regression

regression

GoDoc Go Report Card Build Status License

Multivariable Linear Regression in Go (golang)

installation

$ go get github.com/sajari/regression

Supports Go 1.8+

example usage

Import the package, create a regression and add data to it. You can use as many variables as you like, in the below example there are 3 variables for each observation.

package main

import (
	"fmt"

	"github.com/sajari/regression"
)

func main() {
	r := new(regression.Regression)
	r.SetObserved("Murders per annum per 1,000,000 inhabitants")
	r.SetVar(0, "Inhabitants")
	r.SetVar(1, "Percent with incomes below $5000")
	r.SetVar(2, "Percent unemployed")
	r.Train(
		regression.DataPoint(11.2, []float64{587000, 16.5, 6.2}),
		regression.DataPoint(13.4, []float64{643000, 20.5, 6.4}),
		regression.DataPoint(40.7, []float64{635000, 26.3, 9.3}),
		regression.DataPoint(5.3, []float64{692000, 16.5, 5.3}),
		regression.DataPoint(24.8, []float64{1248000, 19.2, 7.3}),
		regression.DataPoint(12.7, []float64{643000, 16.5, 5.9}),
		regression.DataPoint(20.9, []float64{1964000, 20.2, 6.4}),
		regression.DataPoint(35.7, []float64{1531000, 21.3, 7.6}),
		regression.DataPoint(8.7, []float64{713000, 17.2, 4.9}),
		regression.DataPoint(9.6, []float64{749000, 14.3, 6.4}),
		regression.DataPoint(14.5, []float64{7895000, 18.1, 6}),
		regression.DataPoint(26.9, []float64{762000, 23.1, 7.4}),
		regression.DataPoint(15.7, []float64{2793000, 19.1, 5.8}),
		regression.DataPoint(36.2, []float64{741000, 24.7, 8.6}),
		regression.DataPoint(18.1, []float64{625000, 18.6, 6.5}),
		regression.DataPoint(28.9, []float64{854000, 24.9, 8.3}),
		regression.DataPoint(14.9, []float64{716000, 17.9, 6.7}),
		regression.DataPoint(25.8, []float64{921000, 22.4, 8.6}),
		regression.DataPoint(21.7, []float64{595000, 20.2, 8.4}),
		regression.DataPoint(25.7, []float64{3353000, 16.9, 6.7}),
	)
	r.Run()

	fmt.Printf("Regression formula:\n%v\n", r.Formula)
	fmt.Printf("Regression:\n%s\n", r)
}

Note: You can also add data points one by one.

Once calculated you can print the data, look at the R^2, Variance, residuals, etc. You can also access the coefficients directly to use elsewhere, e.g.

// Get the coefficient for the "Inhabitants" variable 0:
c := r.Coeff(0)

You can also use the model to predict new data points

prediction, err := r.Predict([]float64{587000, 16.5, 6.2})

Feature crosses are supported so your model can capture fixed non-linear relationships


r.Train(
  regression.DataPoint(11.2, []float64{587000, 16.5, 6.2}),
)
//Add a new feature which is the first variable (index 0) to the power of 2
r.AddCross(PowCross(0, 2))
r.Run()

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].