## LaTeX – minimum working example

Sometimes you just want a simple latex document without all the other frills and whistles.

# Here’s the most basic, simplest latex document

A `Hello World` example for latex if you will:
Continue reading “LaTeX – minimum working example”

## LaTeX – how to programmatically change the path of your figures

Scenario: You want to programmatically define where your figures are in your latex document without going through and manually editing all your paths. You have a folder called `"figs"` that contains all your figures, but this folder might move.

# Here’s how to programmatically change the path of where your images are located

Or more specifically programmatically change where the `"figs"` folder is located

The basic idea: You can define a variable in latex that stores the path to your images and then include this variable when you set your image path.
Continue reading “LaTeX – how to programmatically change the path of your figures”

# Here’s how to calculate the mean-absolute-error by hand in MATLAB

Basic idea: You have a set of numbers,

`Actual = [1 2 3 4];`

Then you have some method that tries to predict these numbers and returns some predicted values,

`Predicted = [1 3 1 4];`

You might now ask, “How do I evaluate how close the Predicted values are to the Actual values?”

Well one way is to take the mean absolute error (MAE) and report that.
Continue reading “Mean absolute error tutorial MATLAB”

## Talk on spinal cord segmentation

Well, I did my first ever video-recorded talk on my research on spinal cord segmentation.

You can view it here: # Here’s how to calculate the root mean square error.

Assume you have one set of numbers that represent the Actual values you want to predict.

`Actual = [1 2 3 4];`

Then assume you have another set of numbers that Predicted the actual values.

`Predicted = [1 3 1 4];`

How do you evaluate how close Predicted values are to the Actual values?

Well you could use the root mean square error (RMSE) to give a sense of the Predicted values error.

Here’s some MATLAB code that does exactly that.
Continue reading “Root Mean Square Error tutorial – MATLAB”

## How to add a BibTeX entry to LaTeX

This assumes,

2. you are using Texmaker (if you’re not, you probably should be)

It seems to me you must go through a series of arcane steps to be able to add a reference to your BibTeX bibliography and get it to work in your $\LaTeX$ file.

Here’s the steps and their order that have worked for me. I have included my a few comments that hopefully help to give you a sense what is going on.

## MATLAB – how to calculate the Jaccard similarity coefficient/index and distance between images

Here’s how to calculate the Jaccard similarity coefficient and Jaccard distance between two or more images.

But first, some quick definitions

The Jaccard index is the same thing as the Jaccard similarity coefficient. We call it a similarity coefficient since we want to measure how similar two things are.

The Jaccard distance is a measure of how dis-similar two things are. We can calculate the Jaccard distance as 1 – the Jaccard index.

For this to make sense, let’s first set up our scenario.

We have Alice, RobotBob and Carol. Alice draws a white line. RobotBob and Carol try to copy Alice. We want to measure how similar RobotBob’s and Carol’s lines are to Alice’s line.
Continue reading “MATLAB – how to calculate the Jaccard similarity coefficient/index and distance between images”

## Cluster commands

Often I find myself running jobs on the cluster and I can never remember the basic commands. So here’s some useful commands that you can use to run jobs on the cluster.

*** note that I’m running jobs on Simon Fraser University’s (SFU) cluster and I have no idea if these will work on your specific configuration ***