ilusm.dev

ml

Machine learning: regression, classification, clustering, preprocessing.

Load with: use ml

Quick example

use ml

result = mllbl("value", "value")
prn(result)

Functions

Dataset

mlne()

Creates a new instance.

mllbl(d, cols)

Performs the operation. Takes d, cols.

mladd(d, row)

Performs the operation. Takes d, row.

mlcol(d, c)

Performs the operation. Takes d, c.

mlnrm(d, c, mth)

Removes an item. Takes d, c, mth.

Train/test split

mlspl(d, ratio)

Performs the operation. Takes d, ratio.

Linear Regression

mlnlr()

Performs the operation.

mlft1(m, x, y)

Performs the operation. Takes m, x, y.

mlpr4(m, x)

Performs the operation. Takes m, x.

mlscr(m, x, y)

Creates a new instance. Takes m, x, y.

Logistic Regression

mlnlg()

Performs the operation.

mlftl(m, x, y, opts)

Performs the operation. Takes m, x, y, opts.

mlsgm(z)

Performs the operation. Takes z.

mlpr1(m, x)

Performs the operation. Takes m, x.

Decision Tree

mlndt(maxd, mins)

Performs the operation. Takes maxd, mins.

mlftd(m, x, y)

Performs the operation. Takes m, x, y.

mlpr2(m, x)

Performs the operation. Takes m, x.

Random Forest

mlnrf(nt, maxd)

Performs the operation. Takes nt, maxd.

mlftr(m, x, y)

Performs the operation. Takes m, x, y.

mlpr6(m, x)

Performs the operation. Takes m, x.

K-Means Clustering

mlnkm(k)

Performs the operation. Takes k.

mlft0(m, x, iters)

Performs the operation. Takes m, x, iters.

mlpr3(m, x)

Performs the operation. Takes m, x.

K-Nearest Neighbors

mlnkn(k)

Performs the operation. Takes k.

mlftk(m, x, y)

Performs the operation. Takes m, x, y.

mlpr0(m, xi)

Performs the operation. Takes m, xi.

Naive Bayes

mlnnb()

Performs the operation.

mlftn(m, x, y)

Performs the operation. Takes m, x, y.

mlpr5(m, xi)

Performs the operation. Takes m, xi.

SVM (Simplified)

mlnsv(c)

Performs the operation. Takes c.

PCA

mlpca(x, ncomp)

Performs the operation. Takes x, ncomp.

Metrics

mlac(y, pr)

Performs the operation. Takes y, pr.

mlpr(y, pr, cls)

Processes or prints. Takes y, pr, cls.

mlmse(y, pr)

Sets a value. Takes y, pr.

mlrms(y, pr)

Performs the operation. Takes y, pr.

mlmae(y, pr)

Performs the operation. Takes y, pr.

mlr2(y, pr)

Performs the operation. Takes y, pr.

Cross validation

mlcv(m, x, y, folds, fn)

Performs the operation. Takes m, x, y, folds, fn.

Grid search

mlgrd(m, x, y, grid)

Reads data. Takes m, x, y, grid.

Feature importance

mlimp(m, names)

Performs the operation. Takes m, names.

Save/Load

mlsve(m, path)

Performs the operation. Takes m, path.

mllod(path)

Performs the operation. Takes path.

Pipeline

mlppe(steps)

Performs the operation. Takes steps.

Ensemble

mlens(mds, wts)

Performs the operation. Takes mds, wts.

mlprd(m, x)

Reads data. Takes m, x.

Notes

  • Machine learning primitives - linear regression, k-means, decision trees.