Why? Because I wanted to have some more fun. Yes, this is exclusively for fun, I have no intention of leading any one to believe that one programming language is better or worse than any other. I'm not following any particular scientific method, and I've not used that many languages. So, if you're curious and like to see how all this languages performed in my computer, read on. You can also download all of this to your own machine and try it yourself.
[Read More]
Speed testing for fun :)
Why? Because I wanted to have some fun. I know it's been a while since my last post (and I still have not completed my machine learning with common lisp), but I wanted to post something new here, I saw a random video on YouTube of something similar, got curious, and decided to do my own.
This is exclusively for fun, I have no intention of leading any one to believe that one programming language is better or worse than any other.
[Read More]
Machine Learning basics with Common Lisp
Let's learn a bit of doing machine learning with Common Lisp. I'll be using the Titanic dataset from Kaggle for this. You can find the original data and Python tutorial in here.
Dataset and goal The main goal is to use machine learning with the Titanic data to generate predictions of surviving the incident. In other words, using the data from the incident (mainly gender, age, and ticket class) to determine the probability of surviving.
[Read More]
Virtual Machines with quickemu
Quickemu quickemu is a really nice tool that allows you to quickly create and run a virtual machine from the command line.
You can get it from here.
I will not repeat quickemu install instructions here, but I'll use this post to document what you need to do to use it, especially with a custom ISO, that is, an image file you've downloaded yourself, how to set it up and run it.
[Read More]
Memory usage and pointers in R
In order to develop more efficient code, it is important to understand how R uses memory and how to take better advantage of it.
Dependencies In order to use the examples in this post, we will need the pryr and pointr packages. You can easily install/load each if the help of ezloader :) available here.
library(ezloader) ezloader("pointr") ezloader("pryr") Memory and addresses Every object you create in R will use memory.
[Read More]
Basic error handling with R
Errors in software are common and they are useful.
This is to help understanding how to make better use of errors in R.
First, it is important to understand there are different types of error "messages" in R, and the effects of each one is different.
Type of messages Error As the name implies, this message is thrown when there is an error. Most used for fatal errors. An error usually stops code execution.
[Read More]
Fine tuning a Hugging Face model
Source I've decided to write this post to make it easier to understand (and for future reference) on how to train a Hugging Face pre-trained transformer model with my own data.
The inspiration for this surfaced from the fact that I could not use the Simple Transformers package in my work environment.
Before starting The instructions here are for the question answering pipeline. Most of the instructions posted here are the same or very similar to use with different pipelines.
[Read More]
Scraping website content with R
Setup There are many ways you can do web scraping with R. I'm using this example because it worked for me in my job (and I had many enterprise restrictions regarding packages and internet connections).
The only requirement to get this working is rvest.
We will build a function that prints the value of a stock from the previous day.
How I'll explain as we go.
First, load the required package:
[Read More]
Installing CUDA support for tensorflow using Ubuntu 20.04 repository
What is CUDA? CUDA is a Nvidia parallel computing platform and API that allows you to use your GPU to do some general processing (use your GPU to do some AI stuff).
How do I use it? I have decided to post this after banging my head against the wall troubleshooting. So, if you have a Nvidia card, check if it supports CUDA in the official Nvidia page. If yours is supported, read on.
[Read More]
Creating a single Python virtual environment
Dependencies Install python3, python3-dev, and python3-pip.
Virtual environment First, install virtualenv:
sudo -H pip3 install -U virtualenv # H sets the HOME environment variable to the home directory To activate the new virtual environment, create (or navigate) a project directory, and call the virtualenv command:
mkdir MyPythonApp cd MyPythonApp virtualenv CustomPythonEnv Now, activate the virtual environment using:
# The script requires BASH source CustomPythonEnv/bin/activate The command prompt should now contain (venv)
[Read More]