Getting started with Julia in Galileo
The downloaded file consists of a .jl file, a .csv file, and a Dockerfile. We’ll try running this folder in Galileo, first, and then take a look at what’s happening behind the scenes.
Let’s have a look at our files
The julia_example.jl script conducts a simple linear regression using the supplied mtcars.csv dataset. It also demonstrates how to use a dataset loaded from a library.
Next, our julia_example.jl file conducts a Monte Carlo experiment that simulates 50,000 throws of two six-sided dice to calculate the probability that the sum of one throw of two dice is greater than or equal to seven. It then repeats the same experiment 10 million times. Finally, it compares the means of the two samples and the amount of time it took to calculate them.
Understanding the user interface
When you log into Galileo, the first thing you’ll see is your Dashboard:
To run the julia_example.jl file, drag and drop the entire julia_example folder you downloaded from our GitHub to the station Galilei at the top of the Dashboard:
After you drag and drop the julia_example folder to Galileo, you’ll be able to see the job running in the Your Recent Jobs panel. The job runs quickly in Galileo – try running it locally and comparing:
When the example job completes, hit the Download button under Action to download the results:
The results folder will be downloaded as a .zip that contains an output.log file returning the results of the analysis and a folder called filesys where plots and other files that were created by the analysis are stored.
Let’s take a look at the output.log file first, which returns the results of the regression and Monte Carlo analysis we ran: