Data Science on a Chromebook¶
I've brought up the idea of doing data science on a chromebook many times. Conceptually it seemed like it was possible, but to be honest I'd never really actually tried it. Whenever I bring this up as a potential option for cash-strapped students or people asking about easily portable computer options for doing data science work I immediately get laughed at or downvoted on reddit :)
Well, I finally decided to give it a try and I bought a gently used Google Pixelbook for \$395. So, here I am all in at under \\$400. Let's give it a try.
Google Pixelbook¶
I wanted a Chromebook that could also function as a tablet if needed. I also wanted it to have 8GBs of RAM and at least 128GB of storage space. I quickly realized that most cheaper chromebooks had 4GB of RAM and 32-64GBs of storage. I found what looked to be perfect in the Google Pixelbook. It's original price was a bit expensive for a chromebook, but you could find gently used one's online for well under \$500. It's compact, light, and looks extremely sleak. Reminds me a bit of the Macbook Air at a fraction of the price :)
Setting it up to practice Data Science. A lot of this has been done by others, so I won't re-hash it. I'll just walk through the main process and provide links.
1. Setup Linux¶
Many current chromebooks come with a beta version of Linux. The first thing you will want to do is enable that. Google walks you through how to do it specifically for a Pixelbook and I'd imagine it's similar for other chromebooks.
2. Download Miniconda or Anaconda and move it from the downloads folder to the Linux files folder.¶
3. Follow these instructions to install Miniconda.¶
I took a slightly different route and noticed that the sudo chown command wasn't allowing me access to miniconda. So instead what I did was saved it in my home directory. Then when I want to use anaconda what I need to do is navigate to the miniconda directory and type the following.
- source bin/activate
Then this gives me access to a base miniconda environment that I then used to create my virtual environment. Which I did like this.
4. Install Jupyter Lab¶
Install jupyterlab by following these instructions
5. Setup an instance of your virtual environment in Jupyter Lab¶
Create your virtual environment in jupyterlab by following these instructions.
6. Install Numpy and Pandas¶
- pip install numpy
- pip install pandas
7. Launch Jupyter Lab¶
Launch jupyter lab by typing jupyter lab into the terminal and you should see something like this.
8. Get to work¶
Now we can use numpy and pandas to do data science. Obviously we'll need more packages than that, but this will get us started.
GPU Access¶
Inevitably whenever I mention using a chromebook for data science people bring up their need for GPU runtimes. I'm honestly surprised Macs are so popular in data science with as many people as I hear make this comment. AMD GPUs, which is what Mac's use don't support GPU acceleration, so you'd need to be using a Windows or Linux OS to take advantage of NVIDIA's CUDA library. But even if we ignore that fact GPUs are readily available for free or next to free.
Here are 3 options.
- Take advantage of Google Colab or Kaggle's free kernels with GPU acceleration. I quickly spun up a free instance on Colab in my chromebook. You can tell this by looking at my torch device name.
- Google Colab Pro. If you really feel like a free GPU that can be downgraded and may be shut off after a long time or a short amount of idle time will be a hindrance Google just announced a professional tier of colab for the amazing price of \$9.99/month. This gives you preferred access to the Tesla V100 GPUs and more memory, longer runtimes, etc.
- ssh into an AWS, Azure or, Google server with a GPU. The instructions to do this are a bit beyond the purpose of this article, but they are readily available and not very difficult at ll.
Moral of the story, GPUs and compute power aren't an issue given the abundance of cheap cloud resources available.
Recap¶
It is possible to practice data science on an inexpensive chromebook. You don't need a \$1.5k machine although I will admit all that horsepower is enticing :)