Sunday 4 January 2015

Julia (julialang) : Kaggle Competition and Julia Tutorial (First Steps with Julia)

So I want to try to do something real with Julia and see how easy it is to use, rather than working through tutorials.

Fortunately Kaggle (a site that is concerned with machine learning competitions) has a nice compromise: a set of test data combined with a Julia tutorial. The challenge is to recognise characters culled from Google Street View (roadsigns and such)

It's called First Steps with Julia, and I'm going to try it here.

If you'd like to follow along sign up with kaggle (you can just log straight in via google and openid), and download the data files.

I've made a directory, ~/julia/kaggle, and then unzipped the file trainResized.zip (which results in a directory called trainResized with lots of .Bmp files in it).

I also need the file trainLabels.csv, which goes in the ~/julia/kaggle directory.

Kaggle tell us:
http://www.kaggle.com/c/street-view-getting-started-with-julia/details/julia-tutorial

that we need the Julia packages Images and DataFrames, so fire up julia and say

julia> Pkg.add("Images")
julia> Pkg.add("DataFrames")

and now

julia> using Images

This produces a huge list of angry looking messages and a Segmentation fault! So Julia dies. However, if you start it again, and try

julia> using Images

then it seems to be fine.

With some trepidation:

julia> using DataFrames

produces a lot of warning messages, but returns to the prompt.

After that we seem to have the relevant libraries loaded, as you can verify :

First check that we're in the right directory:

julia> pwd()
"/home/john/julia/kaggle"

And then, if your files are as suggested above
julia> img=imread("./trainResized/1.Bmp")
julia> labels=readtable("./trainLabels.csv")






No comments:

Post a Comment