Aditya Chatterjee's Blog, page 199
July 16, 2020
Classification and Regression Trees: Advanced Methods (with C4.5 algorithm)

In a previous post on CART Algorithm, we saw what decision trees (aka Classification and Regression Trees, or CARTs) are. We explored a classification problem and solved it using the CART algorithm while also learning about information theory.
In this post, we show the popular C4.5 algorithm on the same classification problem and look into advanced techniques to improve our trees: such as random forests and pruning.
C4.5 Algorithm for Classification
The classification problem discussed in the p...
July 15, 2020
Classification and Regression Trees (CART) Algorithm

Classification and Regression Trees (CART) is only a modern term for what are otherwise known as Decision Trees. Decision Trees have been around for a very long time and are important for predictive modelling in Machine Learning.
As the name suggests, these trees are used for classification and prediction problems. This is an introductionary post about the fundamentals of such decision trees, that serve the basis for other modern classifiers such as Random Forest.
These models are obtained by p...
July 11, 2020
OrderedDict objects in Python

Reading time: 15 minutes | Coding time: 5 minutes
An ordereddict is a subclass of the dictionary object in Python.
A dictionary stores items which are values associated with a key. They are called key: value pairs where a key can be used to retrieve its paired value. Within one dictionary, keys should be unique as to differentiate each key: value pair.
ordereddicts have certain advantages when compared to regular dictionaries.
Advantages compared to normal dictionary object:
OrderedDicts are o...
July 7, 2020
Different ways to sort a counter in Python
The different ways to sort a counter in Python are:
Using the Counter.most_common([N]) method
Using .sorted() to sort just the keys
Using .sorted() to sort values on the given (key,value) pairs
The official python document defines a counter as follows:
“A Counter is a dict subclass for counting hashable objects. It is an unordered collection where elements are stored as dictionary keys and their counts are stored as dictionary values. Counts are allowed to be any integer value including zero...
July 5, 2020
Control Statements in Java
Java has three sets of control statement that might be utilized to change the progression of execution of a program. The first set of statements is called selection statements. In these statements, the different paths of execution are depending upon the result of a test condition. The second type of control statement is the loop or iteration statements, which make the computer repeatedly, evaluate a statement or a block of statements so that the final output can be obtained. The third type of c...
Idea behind Load Balancer

Reading time: 30 minutes
Modern High traffic websites take a billion of requests at one time from different users and return the response in the form of either text,videos or images .We can see that the site delivers the content without any failures.
So, may be the question arise in our mind ,how the server deals with these large no of requests
And in the traditional client-server architecture,web application are deployed on the server.User send the request to the server and server sent back th...
July 4, 2020
Overview of Graph Neural Networks

Graph neural network (GNN) is a special kind of network, which works with a graph as a data sample. The typical neural network works with arrays, while GNN works with graphs.
Now before we dive into the technicalities of GNN, let us (re)visit graphs.
Graphs are nothing but the connection of various nodes (vertices) via edges. The nodes, as well as edges, have their values depending on the data.
Mathematically graphs are represented as a function of vertices and edges like follows:
G = Ω (V,E)
T...
June 25, 2020
Header file math.h in C language
Welcome to this article on math.h header file that we can use in C language to perform various mathematical operations like square root, trigonometric functions and a lot more.
I know it can be a tedious task to go through a bunch of articles in order to find what you're searching for in particular, that's why in this article I'll try to get you familiar with this header file upto an extent where you will be able to understand its usecase and also the functions included in it.
I have divided t...
Transitive Closure Of A Graph using Floyd Warshall Algorithm

In this article, we will begin our discussion by briefly explaining about transitive closure and the Floyd Warshall Algorithm. We will also see the application of Floyd Warshall in determining the transitive closure of a given graph.
What is Transitive Closure of a graph ?
In any Directed Graph, let's consider a node i as a starting point and another node j as ending point. For all (i,j) pairs in a graph, transitive closure matrix is formed by the reachability factor, i.e if j is reachable fro...
unordered_set in C++ STL
In this article we are going to discuss about the unordered_set container class of the C++ Standard Template Library. unordered_set is one of the most useful containers offered by the STL. It provides search,insert,delete in O(1) on average. We'll talk more about the worst case complexity later.
Declaring a set
unordered_set any_name_you_want
We can even pass self defined objects in the template above.
A peek under the hood
You may be thinking how this data structure can offer search,insert,d...