chris' sandbox http://chrisstrelioff.ws/sandbox/ python, R, Ubuntu, Bayesian methods, machine learning and more... en-us Mon, 31 Oct 2016 00:00:00 -0700 http://chrisstrelioff.ws/sandbox/2016/10/31/install_tex_live_2016_on_ubuntu_16_04.html http://chrisstrelioff.ws/sandbox/2016/10/31/install_tex_live_2016_on_ubuntu_16_04.html <![CDATA[Install TeX Live 2016 on Ubuntu 16.04]]>

Install TeX Live 2016 on Ubuntu 16.04

On Ubuntu 14.04 I went through a fairly involved procedure to get the current TeX Live (TeX Live 2013 at that time) installed because it was not in the standard repository. However, it seems that there is now a much easier way to get TeX Live 2016: J Fernyhough has put together a TeX Live 2016 PPA – kudos to him!

Read more...

]]>
Mon, 31 Oct 2016 00:00:00 -0700
http://chrisstrelioff.ws/sandbox/2016/10/10/dropbox_on_ubuntu_16_04.html http://chrisstrelioff.ws/sandbox/2016/10/10/dropbox_on_ubuntu_16_04.html <![CDATA[dropbox on Ubuntu 16.04]]> dropbox on Ubuntu 16.04

This a very brief post on installing dropbox on Ubuntu 16.04, mainly to remind myself how I got it working. In the end, it’s the most straightforward approach, but not the one I found at dropbox linux install instructions. So, be careful.

Read more...

]]>
Mon, 10 Oct 2016 00:00:00 -0700
http://chrisstrelioff.ws/sandbox/2016/09/21/vim_and_vundle_on_ubuntu_16_04.html http://chrisstrelioff.ws/sandbox/2016/09/21/vim_and_vundle_on_ubuntu_16_04.html <![CDATA[vim and vundle on Ubuntu 16.04]]>

vim and vundle on Ubuntu 16.04

I have just upgraded to Ubuntu 16.04, the new long-term-stable distribution of Ubuntu. This means I will be installing all of my trusted computing tools on this new distribution as well as reconsidering some of my approaches. In this post I’ll go over a new approach to my vim setup for Ubuntu 16.04, changing from pathogen to vundle plugin management.

Read more...

]]>
Wed, 21 Sep 2016 00:00:00 -0700
http://chrisstrelioff.ws/sandbox/2016/09/21/python_setup_on_ubuntu_16_04.html http://chrisstrelioff.ws/sandbox/2016/09/21/python_setup_on_ubuntu_16_04.html <![CDATA[python setup on Ubuntu 16.04]]>

python setup on Ubuntu 16.04

In this post I will document my approach to python on Ubuntu 16.04. To be clear, this is not the only way to do things and I make no claims that it is the best strategy. However, it is useful for me to write this information down for future reference. Who knows, it might be helpful for you too!? Let me know if it is. I also love to read about other approaches, so leave comments and/or links below.

You can also read over my thoughts on python on Ubuntu 14.04 here– see Install Python packages on Ubuntu 14.04 and virtualenv and virtualenvwrapper on Ubuntu 14.04 as well as Python 3.4 on Ubuntu 14.04 using virtual environments. I will be using elements of those ideas in my approach to python on 16.04. However, be aware that some things have changed since those posts were written– proceed with care!

Read more...

]]>
Wed, 21 Sep 2016 00:00:00 -0700
http://chrisstrelioff.ws/sandbox/2016/07/13/es2015_using_node_babel_and_webpack.html http://chrisstrelioff.ws/sandbox/2016/07/13/es2015_using_node_babel_and_webpack.html <![CDATA[ES2015 using Node, Babel and Webpack]]> ES2015 using Node, Babel and Webpack

In this post I will cover setting up a project that uses ES2015/ES6 – modern JavaScript– that will still work in current web browsers that need ES5. The trick is to use Babel to transpile ES2015/ES6 code to ES5, which can run on current browsers. Why do this? Well, ES2015/ES6 is the future of JavaScript and I’d like to start using it now.

Read more...

]]>
Wed, 13 Jul 2016 00:00:00 -0700
http://chrisstrelioff.ws/sandbox/2016/03/30/upgrading_to_meteor_1_3_on_ubuntu_14_04.html http://chrisstrelioff.ws/sandbox/2016/03/30/upgrading_to_meteor_1_3_on_ubuntu_14_04.html <![CDATA[Upgrading to Meteor 1.3 on Ubuntu 14.04]]>

Upgrading to Meteor 1.3 on Ubuntu 14.04

In a recent post, Install Meteor on Ubuntu 14.04, I documented the install process for Meteor – at that time the current version was 1.2.1. Well, the new version – 1.3 – is out and I will briefly document the upgrade process and provide some links to new guides and tutorials that the MDG (Meteor Development Group) has released.

Read more...

]]>
Wed, 30 Mar 2016 00:00:00 -0700
http://chrisstrelioff.ws/sandbox/2016/03/15/a_d3_experiment_on_my_tinkerer_blog.html http://chrisstrelioff.ws/sandbox/2016/03/15/a_d3_experiment_on_my_tinkerer_blog.html <![CDATA[A d3 experiment on my Tinkerer blog]]> A d3 experiment on my Tinkerer blog

This blog uses Tinkerer, which is based on the Sphinx documentation framework, to create static html pages from rest (rst) markup. If you are familiar with the Python world you’ve probably created documentation using Sphinx, or at the very least, you have read documenation created in Sphinx. Because the setup is Python-focused, it is not straightforward to write posts that employ javascript libraries like d3. This post describes my method for doing javascript examples in Tinkerer blog posts or Sphinx docs, as well as how to do some d3.

Read more...

]]>
Tue, 15 Mar 2016 00:00:00 -0700
http://chrisstrelioff.ws/sandbox/2016/03/14/install_meteor_on_ubuntu_14_04.html http://chrisstrelioff.ws/sandbox/2016/03/14/install_meteor_on_ubuntu_14_04.html <![CDATA[Install Meteor on Ubuntu 14.04]]>

Install Meteor on Ubuntu 14.04

[Edit] 2016, Mar 30 Verision 1.3 of Meteor is now out – this installation instructions are still pretty much the same as below. If you’d like the updated install/upgrade instructions checkout Upgrading to Meteor 1.3 on Ubuntu 14.04. [/Edit]

I’ve been spending a lot of time working with Meteor recently. This framework uses javascript and MongoDB to create a full stack solution that is pretty easy to use. The installation is simple and painless on Ubuntu 14.04, but I’ll document my process here for reference and provide some links for learning more about Meteor.

Read more...

]]>
Mon, 14 Mar 2016 00:00:00 -0700
http://chrisstrelioff.ws/sandbox/2016/03/14/installing_node_lts_version_on_ubuntu_14_04.html http://chrisstrelioff.ws/sandbox/2016/03/14/installing_node_lts_version_on_ubuntu_14_04.html <![CDATA[Installing node LTS version on Ubuntu 14.04]]>

Installing node LTS version on Ubuntu 14.04

In a previous post, Installing Node.js and npm on Ubuntu 14.04, I installed nodejs on Ubuntu 14.04 using what were current instructions at the time. Those notes are outdated at this point so I thought I’d document the current way to install the LTS version of node.

Read more...

]]>
Mon, 14 Mar 2016 00:00:00 -0700
http://chrisstrelioff.ws/sandbox/2016/02/18/installing_mongodb_community_edition_on_ubuntu_14_04.html http://chrisstrelioff.ws/sandbox/2016/02/18/installing_mongodb_community_edition_on_ubuntu_14_04.html <![CDATA[Installing MongoDB Community Edition on Ubuntu 14.04]]> Installing MongoDB Community Edition on Ubuntu 14.04

In this post I’ll cover installing the Community Edition of MongoDB on Ubuntu 14.04 in a way that lets me use more recent versions of MongoDB than are available using the standard $ sudo apt-get install. If that sounds interesting, follow along.

Read more...

]]>
Thu, 18 Feb 2016 00:00:00 -0800
http://chrisstrelioff.ws/sandbox/2015/12/08/arduino_on_ubuntu_14_04_without_the_arduino_ide.html http://chrisstrelioff.ws/sandbox/2015/12/08/arduino_on_ubuntu_14_04_without_the_arduino_ide.html <![CDATA[Arduino on Ubuntu 14.04 without the Arduino IDE]]> Arduino on Ubuntu 14.04 without the Arduino IDE

In this post I will document my setup for working with an Arduino Uno on Ubuntu 14.04. You can learn more about the Arduino at Arduino.cc if you are unfamiliar with the microcontroller. However, be warned, I am not going to use the official Arudino IDE, if you’d like the official setup checkout the official Arduino installation instructions. Instead I’m going to setup the basic requirements for writing and pushing code, including libraries and make files, and use vim as my editor. So, if you’re interested in this approach, follow along.

Read more...

]]>
Tue, 08 Dec 2015 00:00:00 -0800
http://chrisstrelioff.ws/sandbox/2015/08/20/installing_fiona_on_ubuntu_14_04.html http://chrisstrelioff.ws/sandbox/2015/08/20/installing_fiona_on_ubuntu_14_04.html <![CDATA[Installing Fiona on Ubuntu 14.04]]> Installing Fiona on Ubuntu 14.04

This post consists of some quick notes on installing Fiona, a Python interface to OGR, which is a tool that one might want if working with GIS data on a regular basis. I’m trying to do things like convert shapefiles to geojson– without much luck until now (see below)– and this is one of the tools I’m looking at as part of the solution. If you want to install Fiona on Ubuntu 14.04 follow along.

Read more...

]]>
Thu, 20 Aug 2015 00:00:00 -0700
http://chrisstrelioff.ws/sandbox/2015/06/25/decision_trees_in_python_again_cross_validation.html http://chrisstrelioff.ws/sandbox/2015/06/25/decision_trees_in_python_again_cross_validation.html <![CDATA[Decision trees in python again, cross-validation]]>

Decision trees in python again, cross-validation

This is my second post on decision trees using scikit-learn and Python. The first, Decision trees in python with scikit-learn and pandas, focused on visualizing the resulting tree. This post will concentrate on using cross-validation methods to choose the parameters used to train the tree. In particular, I’ll focus on grid and random search for decision tree parameter settings. If this sounds interesting to you, following along. As always, comments, questions and corrections are welcome below.

Read more...

]]>
Thu, 25 Jun 2015 00:00:00 -0700
http://chrisstrelioff.ws/sandbox/2015/06/16/pysoundfile_and_python_3_4_on_ubuntu_14_04.html http://chrisstrelioff.ws/sandbox/2015/06/16/pysoundfile_and_python_3_4_on_ubuntu_14_04.html <![CDATA[PySoundFile and Python 3.4 on Ubuntu 14.04]]>

PySoundFile and Python 3.4 on Ubuntu 14.04

In a previous post, Installing PySoundFile on Ubuntu 14.04, I went over installing PySoundFile on Ubuntu 14.04 using the default version of Python– that’s version 2.7.6. In this post I’ll cover the use of Python 3.4 in a virtual environment– the goal here, at least in the long run, is to write audio processing (dsp) code in Python that is version 2- and 3-compatible.

Read more...

]]>
Tue, 16 Jun 2015 00:00:00 -0700
http://chrisstrelioff.ws/sandbox/2015/06/08/decision_trees_in_python_with_scikit_learn_and_pandas.html http://chrisstrelioff.ws/sandbox/2015/06/08/decision_trees_in_python_with_scikit_learn_and_pandas.html <![CDATA[Decision trees in python with scikit-learn and pandas]]>

Decision trees in python with scikit-learn and pandas

In this post I will cover decision trees (for classification) in python, using scikit-learn and pandas. The emphasis will be on the basics and understanding the resulting decision tree. I will cover:

  • Importing a csv file using pandas,
  • Using pandas to prep the data for the scikit-leaarn decision tree code,
  • Drawing the tree, and
  • Producing pseudocode that represents the tree.

The last two parts will go over what the tree has actually found– this is one of the really nice parts of a decision tree: the findings can be inspected and we can learn something about the patterns in our data. If this sounds interesting to you, read on. Also, if you have other ideas about how to do related things please leave comments below!

Read more...

]]>
Mon, 08 Jun 2015 00:00:00 -0700
http://chrisstrelioff.ws/sandbox/2015/05/27/revisiting_the_medical_tests_example_with_python_and_lea.html http://chrisstrelioff.ws/sandbox/2015/05/27/revisiting_the_medical_tests_example_with_python_and_lea.html <![CDATA[Revisiting the medical tests example with Python and Lea]]>

Revisiting the medical tests example with Python and Lea

In this post I will use Python, and the probabilistic programming package Lea, to re-analyze an example of Bayes’ Theorem covered in an earlier post: Medical tests, a first example of Bayesian calculations. The focus will be on translating the by-hand calculations into Python code. If you are unfamiliar with the example, it would be helpful to read the previous post before continuing. Assuming you are set, let’s get started!

Read more...

]]>
Wed, 27 May 2015 00:00:00 -0700
http://chrisstrelioff.ws/sandbox/2015/05/04/probabilistic_programming_with_python_and_lea.html http://chrisstrelioff.ws/sandbox/2015/05/04/probabilistic_programming_with_python_and_lea.html <![CDATA[Probabilistic programming with Python and Lea]]>

Probabilistic programming with Python and Lea

In this post I will cover installation of a probabilistic programming package for Python called Lea and provide some simple examples of using the package to do calculations with joint, conditional and marginal distributions. These examples follow the by-hand calculations done in my previous Joint, conditional and marginal probabilities post. Lea is really interesting to me because it makes probabilistic programming very easy– think reasoning with distributions and Bayesian networks instead of MCMC calculations. In this post I’ll start with basic calculations to demonstrate usage, but I’ll move onto classic Bayesian and Bayesian network examples in future posts. Also, be sure to check out the Lea Python tutorials for other great examples.

Read more...

]]>
Mon, 04 May 2015 00:00:00 -0700
http://chrisstrelioff.ws/sandbox/2015/04/30/joins_and_some_views_in_mysql.html http://chrisstrelioff.ws/sandbox/2015/04/30/joins_and_some_views_in_mysql.html <![CDATA[JOINs, and some VIEWs, in MySQL]]> JOINs, and some VIEWs, in MySQL

This is the third in a series of posts on MySQL, starting with Installing MySQL on Ubuntu 14.04 and Employees database for MySQL, setup and simple queries. The second post also covered simple queries using SELECT, LIMIT, ORDER BY, etc. If you are starting out, you should start with these posts. In this post I will go over multi-table queries, using JOINs (with some help from VIEWs). As you might expect, I’ll use the employees sample database, setup in the previous post. If that sounds like fun, or at least useful, follow along.

Read more...

]]>
Thu, 30 Apr 2015 00:00:00 -0700
http://chrisstrelioff.ws/sandbox/2015/04/22/employees_database_for_mysql_setup_and_simple_queries.html http://chrisstrelioff.ws/sandbox/2015/04/22/employees_database_for_mysql_setup_and_simple_queries.html <![CDATA[Employees database for MySQL, setup and simple queries]]>

Employees database for MySQL, setup and simple queries

In a recent post I covered Installing MySQL on Ubuntu 14.04. In this post I will cover downloading and setting up the employees sample database that will be used for the example queries in this, and other posts, on my blog. As mentioned in the previous post, I’m using Jump Start MySQL as a guide book for these posts– you should check it out for more examples. More specifically, Jump Start MySQL uses the sakila sample database (DVD store database), providing another set of examples with a different database.

Read more...

]]>
Wed, 22 Apr 2015 00:00:00 -0700
http://chrisstrelioff.ws/sandbox/2015/04/21/installing_mysql_on_ubuntu_14_04.html http://chrisstrelioff.ws/sandbox/2015/04/21/installing_mysql_on_ubuntu_14_04.html <![CDATA[Installing MySQL on Ubuntu 14.04]]>

Installing MySQL on Ubuntu 14.04

In this post I will cover installing MySQL on Ubuntu 14.04, using the repository available at the mysql apt repo. The idea is to setup a repository that allows our MySQL to be current– in this case MySQL 5.6. The instructions I’m documenting here are derived from the above link, as well as the nice book Jump Start MySQL (April 2015). If this is of interest to you, follow along and be sure checkout the resources mentioned above.

Read more...

]]>
Tue, 21 Apr 2015 00:00:00 -0700
http://chrisstrelioff.ws/sandbox/2015/04/03/getting_started_with_responsive_websites_and_javascript.html http://chrisstrelioff.ws/sandbox/2015/04/03/getting_started_with_responsive_websites_and_javascript.html <![CDATA[Getting started with responsive websites and JavaScript]]>

Getting started with responsive websites and JavaScript

In this post I’m going to describe two basic web pages I’ve been working on:

  • a basic responsive page, and
  • a responsive page that uses JavaScript to detect the current size of the screen.

My goal here is to use basic HTML, CSS and JavaScript – no js libraries – to help myself learn JavaScript and responsive data visualization techniques. That said, I’m not an expert, and the examples should be considered with that in mind. Please comment at the end of the post if you have better, or different, ways of doing the same thing.

Read more...

]]>
Fri, 03 Apr 2015 00:00:00 -0700
http://chrisstrelioff.ws/sandbox/2015/03/03/installing_pysoundfile_on_ubuntu_14_04.html http://chrisstrelioff.ws/sandbox/2015/03/03/installing_pysoundfile_on_ubuntu_14_04.html <![CDATA[Installing PySoundFile on Ubuntu 14.04]]>

Installing PySoundFile on Ubuntu 14.04

In this post I will go over installing PySoundFile using pip and virtualenvwrapper. PySoundFile is a utility for reading and writing sound files of various types, like wav, flac and ogg using the abilities of the libsndfile library. Noticeably absent is mp3 due to the license issue– use a tool like (the wonderful) sox to convert mp3’s to a supported file type. See

for more details about PySoundFile.

2015, June 16– I have new post on installing PySoundFile for use with Python 3.4– PySoundFile and Python 3.4 on Ubuntu 14.04, check it out. There are also some updates to package, that affect the Python 2.7.6 install done in this post, so I’ll show how to upgrade below, if you need to do that. –End edit.

Read more...

]]>
Tue, 03 Mar 2015 00:00:00 -0800
http://chrisstrelioff.ws/sandbox/2015/02/17/install_qgis_on_ubuntu_14_04.html http://chrisstrelioff.ws/sandbox/2015/02/17/install_qgis_on_ubuntu_14_04.html <![CDATA[Install QGIS on Ubuntu 14.04]]> Install QGIS on Ubuntu 14.04

In this post I will cover my install process for QGIS on Ubuntu 14.04. QGIS is a tool for creating maps and working with geospatial information. The official QGIS installation instructions provide three different ways to install the software. I’ll be using the UbuntuGIS ppa to get access to more recent versions of the relevant GIS software, including QGIS.

Read more...

]]>
Tue, 17 Feb 2015 00:00:00 -0800
http://chrisstrelioff.ws/sandbox/2015/02/17/using_python_to_query_data_from_socrata.html http://chrisstrelioff.ws/sandbox/2015/02/17/using_python_to_query_data_from_socrata.html <![CDATA[Using Python to query data from Socrata]]> Using Python to query data from Socrata

I’ve started going to Open Oakland meetings on Tuesday nights. The group works on a variety of projects related to making city data more accessible and usable for Oakland citizens by creating websites, or apps. Check out Open Oakland Projects and Open Oakland Blog for more information on the types of things going on and come to a meeting if you’re interested in helping out.

Read more...

]]>
Tue, 17 Feb 2015 00:00:00 -0800
http://chrisstrelioff.ws/sandbox/2015/01/12/installing_node_js_and_npm_on_ubuntu_14_04.html http://chrisstrelioff.ws/sandbox/2015/01/12/installing_node_js_and_npm_on_ubuntu_14_04.html <![CDATA[Installing Node.js and npm on Ubuntu 14.04]]>

Installing Node.js and npm on Ubuntu 14.04

edit: 2016, Mar 14th

I’ve written a short and updated installation guide for node in a new post. You should consult Installing node LTS version on Ubuntu 14.04 if you are looking to do a new install of node on Ubuntu 14.04. This post will remain available for reference.

edit: 2016, Jan 26

The install notes below are very out of date at this point– the versions of nodejs have changed very quickly in the past year! That said, the current install instructions seem to be very similar to those described below; check out the instructions for Ubuntu at nodejs: node install via package manager. Version 4.x seems to be the more stable, long-term version but you can install the 5.x version if you like.

Some notes on removing nodejs

Obviously I would like to remove the version of modejs installed below as well as remove the associated repository– you should only follow along if you are in the same position; also be sensible and make sure you are backed up etc. So, first up is to find out what repository was used for the nodejs install:

$ apt-cache policy nodejs
nodejs:
  Installed: 0.10.41-1nodesource1~trusty1
  Candidate: 0.10.41-1nodesource1~trusty1
  Version table:
 *** 0.10.41-1nodesource1~trusty1 0
        500 https://deb.nodesource.com/node/ trusty/main amd64 Packages
        100 /var/lib/dpkg/status
     0.10.25~dfsg2-2ubuntu1 0
        500 http://us.archive.ubuntu.com/ubuntu/ trusty/universe amd64 Packages

From this output we can see that https://deb.nodesource.com/node/ trusty/main is the repository used to install version 0.10.41 of node. Let’s purge nodejs:

$ sudo apt-get purge nodejs

The repostory can be removed by deleting two file in the /etc/apt/sources.list.d/ directoy using

$sudo rm /etc/apt/sources.list.d/nodesource.list*

Okay, that’s it. Time to install new versions– use the link above.

end edit

original post follows

I’ve decided to start being systematic about learning javascript, with a focus on getting good with d3js. I’ll be installing nodejs and npm (node package manager) as a way to get access to a javascript console and, for later, a powerful javascript environment. As always, constructive comments and questions are welcome and much appreciated.

Read more...

]]>
Mon, 12 Jan 2015 00:00:00 -0800
http://chrisstrelioff.ws/sandbox/2014/12/11/inferring_probabilities_with_a_beta_prior_a_third_example_of_bayesian_calculations.html http://chrisstrelioff.ws/sandbox/2014/12/11/inferring_probabilities_with_a_beta_prior_a_third_example_of_bayesian_calculations.html <![CDATA[Inferring probabilities with a Beta prior, a third example of Bayesian calculations]]>

Inferring probabilities with a Beta prior, a third example of Bayesian calculations

In this post I will expand on a previous example of inferring probabilities from a data series: Inferring probabilities, a second example of Bayesian calculations. In particular, instead of considering a discrete set of candidate probabilities, I’ll consider all (continuous) values between \(0\) and \(1\). This means our prior (and posterior) will now be a probability density function (pdf) instead of a probability mass function (pmf). More specifically, I’ll use the Beta Distribution for this example.

Read more...

]]>
Thu, 11 Dec 2014 00:00:00 -0800
http://chrisstrelioff.ws/sandbox/2014/12/10/installing_essentia_for_audio_feature_extraction.html http://chrisstrelioff.ws/sandbox/2014/12/10/installing_essentia_for_audio_feature_extraction.html <![CDATA[Installing essentia for audio feature extraction]]> Installing essentia for audio feature extraction

Some notes on the installation of essentia, a collection of c++ code with Python wrappers for audio feature extraction, following the essentia installation guide.

Read more...

]]>
Wed, 10 Dec 2014 00:00:00 -0800
http://chrisstrelioff.ws/sandbox/2014/11/13/getting_started_with_latent_dirichlet_allocation_in_python.html http://chrisstrelioff.ws/sandbox/2014/11/13/getting_started_with_latent_dirichlet_allocation_in_python.html <![CDATA[Getting started with Latent Dirichlet Allocation in Python]]> Getting started with Latent Dirichlet Allocation in Python

In this post I will go over installation and basic usage of the lda Python package for Latent Dirichlet Allocation (LDA). I will not go through the theoretical foundations of the method in this post. However, the main reference for this model, Blei etal 2003 is freely available online and I think the main idea of assigning documents in a corpus (set of documents) to latent (hidden) topics based on a vector of words is fairly simple to understand and the example (from lda) will help to solidify our understanding of the LDA model. So, let’s get started...

Read more...

]]>
Thu, 13 Nov 2014 00:00:00 -0800
http://chrisstrelioff.ws/sandbox/2014/10/24/inferring_probabilities_a_second_example_of_bayesian_calculations.html http://chrisstrelioff.ws/sandbox/2014/10/24/inferring_probabilities_a_second_example_of_bayesian_calculations.html <![CDATA[Inferring probabilities, a second example of Bayesian calculations]]>

Inferring probabilities, a second example of Bayesian calculations

In this post I will focus on an example of inferring probabilities given a short data series. I will start by tackling the theory of how to do the desired inference in a Bayesian way and will end by implementing the theory in Python so that we can play around with the ideas. In an attempt to keep the post more accessible, I will only consider a small set of candidate probabilities. This restriction allows me to minimize the mathematical difficulty of the inference and still obtain really cool results, including nice plots of the prior, likelihood and posterior.

Read more...

]]>
Fri, 24 Oct 2014 00:00:00 -0700
http://chrisstrelioff.ws/sandbox/2014/09/16/python_3_4_on_ubuntu_14_04_using_virtual_environments.html http://chrisstrelioff.ws/sandbox/2014/09/16/python_3_4_on_ubuntu_14_04_using_virtual_environments.html <![CDATA[Python 3.4 on Ubuntu 14.04 using virtual environments]]>

Python 3.4 on Ubuntu 14.04 using virtual environments

In a previous post discussing virtualenv and virtualenvwrapper on Ubuntu 14.04 I talked about using virtual environments with the default Python version– this is Python 2.7.6 for Ubuntu 14.04. However, both Python 2.7 and 3.4 are available on Ubuntu 14.04. In this post I’ll go over setting up a virtual environment for working with Python 3 code.

Read more...

]]>
Tue, 16 Sep 2014 00:00:00 -0700
http://chrisstrelioff.ws/sandbox/2014/09/11/medical_tests_a_first_example_of_bayesian_calculations.html http://chrisstrelioff.ws/sandbox/2014/09/11/medical_tests_a_first_example_of_bayesian_calculations.html <![CDATA[Medical tests, a first example of Bayesian calculations]]>

Medical tests, a first example of Bayesian calculations

[edit: 2015, May 26] I have a post that runs through all of these calculations using Python and a package named Lea– check it out: Revisiting the medical tests example with Python and Lea!

In this post I will discuss a first example of a Bayesian calculation using a well-known example of testing for breast cancer. I choose this example for a few reasons:

  • The answer often surprises people and supposedly many doctors get this wrong.
  • The problem provides a nice example of updating a prior (information before) to a posterior (information after). This is really essential to understanding Bayesian thinking and I will emphasize this idea, making a point of connecting the concept to mathematical notation.
  • The calculations are relatively simple (at least compared with other examples). If you understood my post on Joint, conditional and marginal probabilities, you should have no problems.

Read more...

]]>
Thu, 11 Sep 2014 00:00:00 -0700
http://chrisstrelioff.ws/sandbox/2014/09/04/virtualenv_and_virtualenvwrapper_on_ubuntu_14_04.html http://chrisstrelioff.ws/sandbox/2014/09/04/virtualenv_and_virtualenvwrapper_on_ubuntu_14_04.html <![CDATA[virtualenv and virtualenvwrapper on Ubuntu 14.04]]>

virtualenv and virtualenvwrapper on Ubuntu 14.04

In this post I’ll go over my attempt to setup virtual environments for Python development. Most Python users probably don’t want to use virtual environments and should just set up a single user environment that works for their needs. However, if you are working on writing one or more Python modules or packages, these tools are geared towards creating isolated Python environments for each project. This is very useful for keeping track of such things as the minimal Python requirements for each project.

Read more...

]]>
Thu, 04 Sep 2014 00:00:00 -0700
http://chrisstrelioff.ws/sandbox/2014/09/02/installing_virtualbox_on_ubuntu_14_04.html http://chrisstrelioff.ws/sandbox/2014/09/02/installing_virtualbox_on_ubuntu_14_04.html <![CDATA[Installing virtualbox on Ubuntu 14.04]]> Installing virtualbox on Ubuntu 14.04

In this post I will cover installing Oracle’s virtualbox on Ubuntu 14.04. This will allow me to run Windows and tableau, a program for putting together interactive visualizations. If you are running Ubuntu and taking Coursera’s introduction to data science class you might find this post useful as well. However, having virtualbox installed and available is always a good thing for those situations where Win or Mac are the only options.

Read more...

]]>
Tue, 02 Sep 2014 00:00:00 -0700
http://chrisstrelioff.ws/sandbox/2014/08/26/joint_conditional_and_marginal_probabilities.html http://chrisstrelioff.ws/sandbox/2014/08/26/joint_conditional_and_marginal_probabilities.html <![CDATA[Joint, conditional and marginal probabilities]]>

Joint, conditional and marginal probabilities

In this post I will discuss a topic that seems very dry at first but turns out to have many cool applications. While I will not discuss Bayesian inference in this post, understanding the relationship between joint, conditional and marginal probabilities is essential for the application of Bayesian thinking. As a result, I’ll will often refer back to this discussion in future posts.

Read more...

]]>
Tue, 26 Aug 2014 00:00:00 -0700
http://chrisstrelioff.ws/sandbox/2014/08/16/garmin_forerunner_and_ubuntu_14_04.html http://chrisstrelioff.ws/sandbox/2014/08/16/garmin_forerunner_and_ubuntu_14_04.html <![CDATA[Garmin forerunner and Ubuntu 14.04]]> Garmin forerunner and Ubuntu 14.04

This post is about getting running data off of a Garmin Forerunner 305 and uploaded to the Garmin Connect website. This post follows my previous post on the Garmin forerunner and Ubuntu 12.04. Basically I will repeat these previous instructions, making sure that everything can still be done on Ubuntu 14.04– the good news is that everything works on 14.04, so read on if you are interested.

Read more...

]]>
Sat, 16 Aug 2014 00:00:00 -0700
http://chrisstrelioff.ws/sandbox/2014/08/15/install_r_on_ubuntu_14_04.html http://chrisstrelioff.ws/sandbox/2014/08/15/install_r_on_ubuntu_14_04.html <![CDATA[Install R on Ubuntu 14.04]]> Install R on Ubuntu 14.04

In this post I will go over installing R on Ubuntu 14.04 following the installation instructions at cran. I will also cover installing the packages required to do the Topics in machine learning assignment for Coursera’s Introduction to Data Science.

Read more...

]]>
Fri, 15 Aug 2014 00:00:00 -0700
http://chrisstrelioff.ws/sandbox/2014/07/29/install_igraph_for_python_on_ubuntu_14_04.html http://chrisstrelioff.ws/sandbox/2014/07/29/install_igraph_for_python_on_ubuntu_14_04.html <![CDATA[Install igraph for Python on Ubuntu 14.04]]> Install igraph for Python on Ubuntu 14.04

In this post I will describe installing python-igraph on Ubuntu 14.04, using the default Python 2.7. Previously I wrote a (long) post about how to Install Python packages on Ubuntu 14.04, which provides lots of detail about how I approach Python package installation. In particular, I use pip and install as a user. Of course, you can do otherwise.

Read more...

]]>
Tue, 29 Jul 2014 00:00:00 -0700
http://chrisstrelioff.ws/sandbox/2014/07/12/python_and_yaml_on_ubuntu_14_04.html http://chrisstrelioff.ws/sandbox/2014/07/12/python_and_yaml_on_ubuntu_14_04.html <![CDATA[Python and YAML on Ubuntu 14.04]]> Python and YAML on Ubuntu 14.04

In this post I will cover installing PyYAML using Python 2.7. I’ve previously covered my approach to Python package installation using pip in this post– Install Python packages on Ubuntu 14.04 so you can read there to get a sense of my approach.

Read more...

]]>
Sat, 12 Jul 2014 00:00:00 -0700
http://chrisstrelioff.ws/sandbox/2014/07/10/install_sqlite3_on_ubuntu_14_04.html http://chrisstrelioff.ws/sandbox/2014/07/10/install_sqlite3_on_ubuntu_14_04.html <![CDATA[Install sqlite3 on Ubuntu 14.04]]> Install sqlite3 on Ubuntu 14.04

The second assignment for Coursera’s Introduction to Data Science focuses on databases and relational algebra. The programming assignments are done with sqlite3, so I need to install it on my Ubuntu 14.04 machine.

Read more...

]]>
Thu, 10 Jul 2014 00:00:00 -0700
http://chrisstrelioff.ws/sandbox/2014/07/07/install_and_use_sphinx_bootstrap_theme_on_ubuntu_14_04.html http://chrisstrelioff.ws/sandbox/2014/07/07/install_and_use_sphinx_bootstrap_theme_on_ubuntu_14_04.html <![CDATA[Install and use sphinx-bootstrap-theme on Ubuntu 14.04]]> Install and use sphinx-bootstrap-theme on Ubuntu 14.04

In this post I will try out the sphinx-bootstrap-theme. As the name suggests, this project combines sphinx, a Python documentation tool that generates html/pdf/etc from rst files, and bootstrap, a modern web framework from Twitter for generating responsive websites.

Read more...

]]>
Mon, 07 Jul 2014 00:00:00 -0700
http://chrisstrelioff.ws/sandbox/2014/07/02/install_oauth2_python_package_on_ubuntu_14_04.html http://chrisstrelioff.ws/sandbox/2014/07/02/install_oauth2_python_package_on_ubuntu_14_04.html <![CDATA[Install oauth2 Python package on Ubuntu 14.04]]> Install oauth2 Python package on Ubuntu 14.04

The first assignment for Coursera’s Introduction to Data Science focuses on sentiment analysis of twitter data. To do this the oauth2 package needs to be installed. Following the style outlined in my Install Python packages on Ubuntu 14.04 post, I will use pip to install the package as a user:

$ pip install --user oauth2

Read more...

]]>
Wed, 02 Jul 2014 00:00:00 -0700
http://chrisstrelioff.ws/sandbox/2014/06/27/ubuntu_vps_setup_at_digital_ocean.html http://chrisstrelioff.ws/sandbox/2014/06/27/ubuntu_vps_setup_at_digital_ocean.html <![CDATA[Ubuntu VPS setup at digital ocean]]>

Ubuntu VPS setup at digital ocean

This blog is hosted on an Ubuntu 14.04 VPS at digital ocean. This post is mainly a reminder for me of the tutorials I used to set things up, however you might find it a helpful guide as well.

Read more...

]]>
Fri, 27 Jun 2014 00:00:00 -0700
http://chrisstrelioff.ws/sandbox/2014/06/20/installing_octave_on_ubuntu_14_04.html http://chrisstrelioff.ws/sandbox/2014/06/20/installing_octave_on_ubuntu_14_04.html <![CDATA[Installing Octave on Ubuntu 14.04]]>

Installing Octave on Ubuntu 14.04

I’m taking Andrew Ng’s machine learning class at coursera that started June 17, 2014. In the Silicon Valley tech world, this seems to be the online course that many people recommend for machine learning. The course is taught using Octave or Matlab. I’ll use Octave because I’m on Ubuntu and Octave is a gnu project.

Read more...

]]>
Fri, 20 Jun 2014 00:00:00 -0700
http://chrisstrelioff.ws/sandbox/2014/06/04/install_and_setup_python_and_packages_on_ubuntu_14_04.html http://chrisstrelioff.ws/sandbox/2014/06/04/install_and_setup_python_and_packages_on_ubuntu_14_04.html <![CDATA[Install Python packages on Ubuntu 14.04]]>

Install Python packages on Ubuntu 14.04

<note> There is an updated post for Ubuntu 16.04– python setup on Ubuntu 16.04, check it out for current information. </note>

In this post I will document my setup of Python 2.7.6 in Ubuntu 14.04. Of course, the base Python is installed by default, both Python 2.7.6 and Python 3.4. Try the following in the terminal:

$ python --version
Python 2.7.6
$ python2 --version
Python 2.7.6
$ python3 --version
Python 3.4.0

As you can see, using python points to Python 2.7.6 by default. However, python2 and python3 can be used to access the desired version. I will focus on installing packages for Python 2.7.6 here.

Read more...

]]>
Wed, 04 Jun 2014 00:00:00 -0700
http://chrisstrelioff.ws/sandbox/2014/06/02/install_vanilla_latex_on_ubuntu_14_04.html http://chrisstrelioff.ws/sandbox/2014/06/02/install_vanilla_latex_on_ubuntu_14_04.html <![CDATA[Install vanilla LaTeX on Ubuntu 14.04]]>

Install vanilla LaTeX on Ubuntu 14.04

<note> There is now a PPA to install TeX Live 2016 for both Ubuntu 14.04 and 16.04– checkout the new post: Install TeX Live 2016 on Ubuntu 16.04. </note>

In this post I will go through a vanilla installation of Tex Live– you may not want to do this. I’m choosing this installation method because of the ability to stay current with LaTeX updates and greater flexibility. However, for most people I would suggest installing the LaTeX setup in Ubuntu 14.04 repositories– search for texlive-full.

Read more...

]]>
Mon, 02 Jun 2014 00:00:00 -0700
http://chrisstrelioff.ws/sandbox/2014/05/30/migrate_ssh_keys_to_new_computer.html http://chrisstrelioff.ws/sandbox/2014/05/30/migrate_ssh_keys_to_new_computer.html <![CDATA[Migrate ssh keys to new computer]]> Migrate ssh keys to new computer

I need to use a set of ssh keys on a new machine. In general, it is best to generate new keys instead of copying old keys, but this is a temporary solution.

Read more...

]]>
Fri, 30 May 2014 00:00:00 -0700
http://chrisstrelioff.ws/sandbox/2014/05/29/install_and_setup_git_on_ubuntu_14_04.html http://chrisstrelioff.ws/sandbox/2014/05/29/install_and_setup_git_on_ubuntu_14_04.html <![CDATA[Install and setup git on Ubuntu 14.04]]> Install and setup git on Ubuntu 14.04

Here we install and do the most basic setup for git. First, install git from the Ubuntu repository:

$ sudo apt-get install git

Read more...

]]>
Thu, 29 May 2014 00:00:00 -0700
http://chrisstrelioff.ws/sandbox/2014/05/29/install_and_setup_vim_on_ubuntu_14_04.html http://chrisstrelioff.ws/sandbox/2014/05/29/install_and_setup_vim_on_ubuntu_14_04.html <![CDATA[Install and setup vim on Ubuntu 14.04]]>

Install and setup vim on Ubuntu 14.04

<note> I have upgraded to Ubuntu 16.04 and wrote another post about setting up vim, this time using vundle instead of pathogen. Checkout the new post– vim and vundle on Ubuntu 16.04 – if that sounds interesting to you. </note>

Vim is a powerful editor that can be used on your laptop/desktop and is also typically found of any Linux server you might encounter. As a result, I started using vim as my main editor. The Ubuntu install is simple:

$ sudo apt-get install vim

Read more...

]]>
Thu, 29 May 2014 00:00:00 -0700
http://chrisstrelioff.ws/sandbox/2014/05/29/install_and_setup_screen_on_ubuntu_14_04.html http://chrisstrelioff.ws/sandbox/2014/05/29/install_and_setup_screen_on_ubuntu_14_04.html <![CDATA[Install and setup screen on Ubuntu 14.04]]> Install and setup screen on Ubuntu 14.04

screen is a great tool for the terminal, allowing me to have many windows (sessions) open at the same time– say vim in one, an ssh session in another, etc. This post documents my basic setup – if you have cool/different ideas about how to do this type of thing let me know.

Read more...

]]>
Thu, 29 May 2014 00:00:00 -0700