Development and Release of Type4Py: Machine Learning-based Type Auto-completion for Python

Over the past decade, machine learning (ML) has been applied successfully to a variety of tasks such as computer vision and natural language processing. Motivated by this, in recent years, researchers have employed ML techniques to solve code-related problems, including but not limited to, code completion, code generation, program repair, and type inference.

Dynamic programming languages like Python and TypeScript allows developers to optionally define type annotations and benefit from the advantages of static typing such as better code completion, early bug detection, and etc. However, retrofitting types is a cumbersome and error-prone process. To address this, we propose Type4Py, an ML-based type auto-completion for Python. It assists developers to gradually add type annotations to their codebases. In the following, I describe Type4Py’s pipeline, model, deployments, and the development of its VSCode extension and more.

Continue reading “Development and Release of Type4Py: Machine Learning-based Type Auto-completion for Python”

mlpack: A C++ machine learning library

Nowadays, most people use scikit-learn for machine learning projects. Because scikit-learn is a top quality ML package for Python and lets you use a machine learning algorithm in several lines of Python code, which is great!

As a machine learning researcher, I personally like to try and use other machine learning libraries. It’s good to have knowledge of other ML libraries in your arsenal. Since I used C++ for my projects, I decided to try a C++ machine learning library.

Continue reading “mlpack: A C++ machine learning library”

LightTwinSVM: A Fast, Light-weight and Simple Implementation of TwinSVM Classifier

Support Vector Machine (SVM) is a popular and state-of-the-art classification algorithm.  Hence many packages and implementations of standard SVM can be found on the internet. However, there are some interesting extensions of SVM that has a slightly better prediction accuracy. Of these extensions, Twin Support Vector Machine (TSVM) has received more attention from scholars in the field of SVM research. Even I myself have published a classifier based on TSVM and KNN.

TSVM does classification using two non-parallel hyperplanes as opposed to a single hyperplane in standard SVM (To know more about TSVM, you can read this blog post.).  Unlike SVM, TSVM had almost no fast and simple implementation on the internet prior to 2018. So I decided to develop the LightTwinSVM program and share it with others for free.

Continue reading “LightTwinSVM: A Fast, Light-weight and Simple Implementation of TwinSVM Classifier”