Skip to content

Instantly share code, notes, and snippets.

A Few Useful Things to Know about Machine Learning

The paper presents some key lessons and "folk wisdom" that machine learning researchers and practitioners have learnt from experience and which are hard to find in textbooks.

1. Learning = Representation + Evaluation + Optimization

All machine learning algorithms have three components:

  • Representation for a learner is the set if classifiers/functions that can be possibly learnt. This set is called hypothesis space. If a function is not in hypothesis space, it can not be learnt.
  • Evaluation function tells how good the machine learning model is.
  • Optimisation is the method to search for the most optimal learning model.
@Horusiath
Horusiath / gist:484f37f9ae92a220fb7b
Last active December 2, 2015 22:07
Get list of project contributors by added/removed lines and display summary
# output line format: <added+removed> <added> <removed> <author>
git log <past_last_release_tag_here>..HEAD --oneline --numstat --pretty=format:%an --no-merges --abbrev-commit | gawk 'author == "" { author = $0; next } /^$/ { author = ""; next} {added[author] += $1; removed[author] +=$2 } END { for(author in added) { printf "%s\t%s\t%s\t%s\n", added[author]+removed[author], added[author], removed[author], author } }' | sort -n -k1 -r
@ohanhi
ohanhi / frp.md
Last active December 23, 2022 13:06
Learning FP the hard way: Experiences on the Elm language

Learning FP the hard way: Experiences on the Elm language

by Ossi Hanhinen, @ohanhi

with the support of Futurice 💚.

Licensed under CC BY 4.0.

Editorial note

@swlaschin
swlaschin / ConstrainedTypesExamples.fsx
Last active March 1, 2024 18:19
Examples of creating constrained types in F#
// General hints on defining types with constraints or invariants
//
// Just as in C#, use a private constructor
// and expose "factory" methods that enforce the constraints
//
// In F#, only classes can have private constructors with public members.
//
// If you want to use the record and DU types, the whole type becomes
// private, which means that you also need to provide:
// * a constructor function ("create").

The introduction to Reactive Programming you've been missing

(by @andrestaltz)

So you're curious in learning this new thing called (Functional) Reactive Programming (FRP).

Learning it is hard, even harder by the lack of good material. When I started, I tried looking for tutorials. I found only a handful of practical guides, but they just scratched the surface and never tackled the challenge of building the whole architecture around it. Library documentations often don't help when you're trying to understand some function. I mean, honestly, look at this:

Rx.Observable.prototype.flatMapLatest(selector, [thisArg])

Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.

@dieseltravis
dieseltravis / code.js
Last active June 25, 2021 12:22
javascript sort function factory, creates functions that sort upon a particular attribute, alpha or numeric, and ascending or descending
var getSortAttrFn = function(attrName, isNumeric, direction) {
var isAsc = ((direction + "").toUpperCase() !== "DESC");
return (isNumeric) ? function(a, b) {
return (isAsc) ? a[attrName] - b[attrName] : b[attrName] - a[attrName];
} : function (a, b) {
var aAttrVal = a[attrName].toLowerCase(),
bAttrVal = b[attrName].toLowerCase();
if (aAttrVal < bAttrVal) return (isAsc) ? -1 : 1;
if (aAttrVal > bAttrVal) return (isAsc) ? 1 : -1;
return 0;