Skip to content

Instantly share code, notes, and snippets.

View neubig's full-sized avatar

Graham Neubig neubig

View GitHub Profile
@neubig
neubig / margins.R
Created November 18, 2010 13:04
A file to compute and plot LR and SVM margins
set.seed(123141)
fcount <- 20
tcount <- 1
alpha <- 3
xf <- rnorm(fcount,mean=-1, sd=0.7)
xt <- rnorm(tcount,mean=1, sd=0.7)
yf <- mat.or.vec(fcount,1)
yt <- mat.or.vec(tcount,1)
#!/usr/bin/perl
use strict;
use utf8;
use List::Util qw(max min);
binmode STDIN, ":utf8";
binmode STDOUT, ":utf8";
if(@ARGV != 2) {
print STDERR "Usage: counterrors.pl REFERENCE SYSTEM\n";