Skip to content

Instantly share code, notes, and snippets.

View durka's full-sized avatar

Alex Burka durka

View GitHub Profile
\DeclareRobustCommand{\tblcap}[2]{%
\caption[\ifthenelse{\equal{#2}{cv}}{Cross-validation}{Final} learning results (without feature selection)]{Results of regression and classification \ifthenelse{\equal{#1}{fs}}{after}{without} feature selection, \ifthenelse{\equal{#2}{cv}}{in cross validation}{on the entire training set and held-out test set}, with summary statistics. \ifthenelse{\equal{#2}{cv}}{All metrics shown are averaged over cross-validation splits. }For the regression tasks, we calculate the correlation between desired and actual output, slope of the trend-line, $p$-value, $R^2$, and \ac{RMSE}, while classification accuracy, $p$-value with respect to a dummy classifier, precision, recall, and \ac{MAE} are shown for the the classification tasks. Bolded rows show the best-performing models. This table corresponds to \cref{fig:properties_#1_#2train,fig:properties_#1_#2test,fig:ratings_#1_#2train,fig:ratings_#1_#2test}.}%
}
$ wc -l data/kth-tips-2b/*.txt
3564 data/kth-tips-2b/test1.txt
3564 data/kth-tips-2b/test2.txt 3564 data/kth-tips-2b/test3.txt
3564 data/kth-tips-2b/test4.txt
1188 data/kth-tips-2b/train1.txt 1188 data/kth-tips-2b/train2.txt
1188 data/kth-tips-2b/train3.txt
1188 data/kth-tips-2b/train4.txt
category 0 1 2 3 test
------------- --- --- --- --- ------
wood 8 8 7 7 7
stone 3 3 2 2 1
fabric 11 10 9 10 9
polishedstone 3 3 2 4 2
leather 3 3 1 1 1
ceramic 1 0 0 0 0
metal 3 3 2 3 1
plastic 8 6 5 5 3
N = sum(map(len, cats.values()))
splits = map(lambda (tr,te): te, StratifiedKFold(n_splits=5, shuffle=True).split(np.zeros(N), reduce(lambda a,b: a+b, map(lambda (c,s): [c]*len(s), cats.items()))))
stats = {'train': dict(), 'test': dict()}
for cat, surfs in cats.items():
print cat
for i, (row, props, rates) in enumerate(surfs):
for s in range(4):
if i in splits[s]:
mode = 0 # train
fold = s
[package]
name = "a"
version = "0.1.0"
authors = ["Alex Burka <[email protected]>"]
[dependencies]
static-cond = "*"
\documentclass[11pt]{report}
\usepackage[withpage, printonlyused]{acronym}
\usepackage{subcaption}
\begin{document}
\ac{FYI}.
\begin{figure}
\caption{\ac{TLA}}
\newcommand*\@verridelabel[1]{%
\@bsphack
\protected@write\@auxout{}{\string\AC@undonewlabel{#1}}%
\protect\label{#1}%
\AC@overriddenmessage rs{#1}%
\@esphack
}%
\relax
\AC@reset@newl@bel
\providecommand\hyper@newdestlabel[2]{}
\providecommand\HyperFirstAtBeginDocument{\AtBeginDocument}
\HyperFirstAtBeginDocument{\ifx\hyper@anchor\@undefined
\global\let\oldcontentsline\contentsline
\gdef\contentsline#1#2#3#4{\oldcontentsline{#1}{#2}{#3}}
\global\let\oldnewlabel\newlabel
\gdef\newlabel#1#2{\newlabelxx{#1}#2}
\gdef\newlabelxx#1#2#3#4#5#6{\oldnewlabel{#1}{{#2}{#3}}}
This file has been truncated, but you can view the full file.
This is pdfTeX, Version 3.14159265-2.6-1.40.18 (TeX Live 2017) (preloaded format=pdflatex 2017.5.23) 26 APR 2018 18:01
entering extended mode
\write18 enabled.
file:line:error style messages enabled.
%&-line parsing enabled.
**hardware.tex
(./hardware.tex
LaTeX2e <2017-04-15>
Babel <3.10> and hyphenation patterns for 84 language(s) loaded.
(/usr/local/texlive/2017/texmf-dist/tex/latex/subfiles/subfiles.cls
\traceon
\begin{figure}[p]
\centering
\includecropped[width=.5\figscale]{img/stb_pcb}
\caption[Two-layer PCB layout]{Two-layer \ac{PCB} layout. This \ac{PCB} includes the circuits diagrammed in \cref{fig:stb_power,fig:stb_teensy,fig:stb_mini40,fig:stb_analog}. The \miniforty{} plugs into the parallel connector at the top, while the other sensors are connected to the ports arrayed around the lower right of the board. Power is supplied through a jack in the upper left. The Teensy, which controls everything, plugs into the pins in the middle left, just above the status \acp{LED}.}
\label{fig:stb_pcb}
\end{figure}
\traceoff