Python

SSH connection to Google Colaboratory and Transfering files from Google Drive

Do like to access the Google Colaboratory directly from your machine? Running your script via terminal and having shell access? Then there is a good news, just do the followings: SSH to Google Colaboratory 1. Install colab_ssh on Google Colaboratory

Add cloudflared and password for root user:

2. Install cloudflared on your machine […]

SSH connection to Google Colaboratory and Transfering files from Google Drive Read More »

Metrics for Evaluating Machine Learning Models – Classification

Confusion Matrix Let’s say we have a binary classifier cats and non- cats, we have 1100 test images, 1000 non cats, 100 cats. The output of the classifier is either Positive  which means “cat” or Negative which  means non-cat. The following is called confusion matrix: How to interpret these term is as follows: Correctness of

Metrics for Evaluating Machine Learning Models – Classification Read More »

Extended Kalman Filter Explained with Python Code

In the following code, I have implemented an Extended Kalman Filter for modeling the movement of a car with constant turn rate and velocity. The code is mainly based on this work (I did some bug fixing and some adaptation such that the code runs similar to the Kalman filter that I have earlier implemented).

Extended Kalman Filter Explained with Python Code Read More »

Parcticle Filter Explained With Python Code From Scratch

In the following code I have implemented a localization algorithm based on particle filter. I have used conda to run my code, you can run the following for installation of dependencies:

and the code:

 

Parcticle Filter Explained With Python Code From Scratch Read More »

Kalman Filter Explained With Python Code From Scratch

This snippet shows tracking mouse cursor with Python code from scratch and comparing the result with OpenCV. The CSV file that has been used are being created with below c++ code. A sample could be downloaded from here 1, 2, 3. Python Kalman Filter

C++ and OpenCV Kalman Filter Rapidcsv has been downloaded from

Kalman Filter Explained With Python Code From Scratch Read More »

How to develop GUI Application with PyQt (python Qt)

There are two main methods for developing GUI application with qt: 1) Adding all widgets in your code (your cpp or python code) 2) Creating qt UI files, adding widgets there and load everything into your application. 1)Adding all widgets in your code Here is the snippet for adding all widgets and their slots in code:

2)

How to develop GUI Application with PyQt (python Qt) Read More »

Breadth-first search (BFS) and Depth-first search (DSF) Algorithm with Python and C++

Python Implementation BFS traverse:

DFS traverse:

C++ Implementation

 

Breadth-first search (BFS) and Depth-first search (DSF) Algorithm with Python and C++ Read More »

Populating directed graph in networkx from CSV adjacency matrix

Populating directed graph in networkx from CSV adjacency matrix Read More »

Drawing graphs in Python with networkx

Drawing graphs in Python with networkx Read More »

Hierarchical Clustring in python

Hierarchical Clustering is a method of clustering which build a hierarchy of clusters. It could be Agglomerative or Divisive. Agglomerative: At the first step, every item is a cluster, then clusters based on their distances are merged and form bigger clusters till all data is in one cluster (Bottom Up). The complexity is \( O (n^2log(n) ) \). Divisive: At the beginning,

Hierarchical Clustring in python Read More »