lendle / RegERMs.jl

Regularised Empirical Risk Minimisation Framework (SVMs, LogReg, Linear Regression) in Julia

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

RegERMs Logo

RegERMs.jl

Build Status Coverage Status

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 SVM as learning algorithm
svm = SVM(X, y; kernel=:rbf)

# get solution (regularization parameter is 0.1)
regParam = 0.1
model = optimize(svm, regParam)

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

Documentation

Full documentation available at Read the Docs.

About

Regularised Empirical Risk Minimisation Framework (SVMs, LogReg, Linear Regression) in Julia

License:Other