Skip to content

Latest commit

 

History

History
38 lines (26 loc) · 1.37 KB

README.md

File metadata and controls

38 lines (26 loc) · 1.37 KB

RegERMs Logo

RegERMs.jl

Build Status Coverage Status RegERMs

This package implements several machine learning algorithms in a regularised empirical risk minimisation framework (SVMs, LogReg, Linear Regression) in Julia.

Quick start

Some examples:

# define some toy data (XOR - example)
np = 100
nn = 100
X = [randn(int(np/2),1)+1 randn(int(np/2),1)+1; randn(int(np/2-0.5),1)-1 randn(int(np/2-0.5),1)-1;
     randn(int(nn/2),1)+1 randn(int(nn/2),1)-1; randn(int(nn/2-0.5),1)-1 randn(int(nn/2-0.5),1)+1] # examples with 2 features
y = vec([ones(np,1); -ones(nn,1)])       # binary class values

# choose linear SVM as learning algorithm with regularization parameter 0.1
svm = SVM(X, y; λ=0.1)

# get a solution 
model = optimize(svm)

# make predictions and compute accuracy
ybar = predict(model, X)
acc = mean(ybar .== y)

Documentation

Full documentation available at Read the Docs.