GitPedia

Funq

Source files for "Fun Q: A Functional Introduction to Machine Learning in Q"

From psaris·Updated May 17, 2026·View on GitHub·

This project contains the source files for "Fun Q: A Functional Introduction to Machine Learning in Q".[^fn1] The project is written primarily in q, distributed under the MIT License license, first published in 2016. Key topics include: clustering, collaborative-filtering, decision-trees, expectation-maximization, heirarchical-clustering.

Latest release: v1.0.0
July 17, 2020View Changelog →

Fun Q

This project contains the source files for "Fun Q: A Functional
Introduction to Machine Learning in Q".1

The Book

Fun Q can be purchased on Amazon and Amazon
UK
. A Kindle version is also available. Books may
be purchased in quantity and/or special sales by contacting the
publisher, Vector Sigma. Read a review by Daniel
Krizian
published by Vector, the Journal of the
British APL Association.

The Source

Install q from Kx System's kdb+ download page and grab a
copy of the Fun Q source.

sh
$ git clone https://github.com/psaris/funq

The Fun Q Environment

The following command starts the q interpreter with all Fun Q
libraries loaded and 4 secondary threads for parallel computing.

sh
$ q funq.q -s 4

The Errors

Any typos or errors are listed here and are
incorporated into recent printings of the book as well as the
kindle version.

The Swag

Swag can be found on the Vector Sigma Spring site.

More Fun

Start q with any of the following or read the comments and run the
examples one by one.

Plotting

sh
$ q plot.q -s 4

K-Nearest Neighbors (KNN)

sh
$ q knn.q -s 4

K-Means/Medians/Medoids Clustering

sh
$ q kmeans.q -s 4

Hierarchical Agglomerative Clustering (HAC)

sh
$ q hac.q -s 4

Expectation Maximization (EM)

sh
$ q em.q -s 4

Naive Bayes

sh
$ q nb.q -s 4

Vector Space Model (tf-idf)

sh
$ q tfidf.q -s 4

Decision Tree (ID3,C4.5,CART)

sh
$ q decisiontree.q -s 4

Discrete Adaptive Boosting (AdaBoost)

sh
$ q adaboost.q -s 4

Random Forest (and Boosted Aggregating BAG)

sh
$ q randomforest.q -s 4

Linear Regression

sh
$ q linreg.q -s 4

Logistic Regression

sh
$ q logreg.q -s 4

One vs. All

sh
$ q onevsall.q -s 4

Neural Network Classification/Regression

sh
$ q nn.q -s 4

Content-Based/Collaborative Filtering (Recommender Systems)

sh
$ q recommend.q -s 4

Google PageRank

sh
$ q pagerank.q -s 4
<!----- Footnotes ----->

Footnotes

  1. More presentations, competitions and books by Nick Psaris can
    be found at https://nick.psaris.com

Contributors

Showing top 7 contributors by commit count.

View all contributors on GitHub →

This article is auto-generated from psaris/funq via the GitHub API.Last fetched: 6/21/2026