Categories
Algorithms

Binary Tree Traversal

A binary tree is one where each of its nodes has maximum two children nodes. These children are mostly known as Left and Right child. 1. In-order Traversal It goes from left child then current node then right childSo for the given tree above it will be: [2,17,7,19,3,100,25,36,1] 2. Pre-order Traversal It first deals with […]

Categories
Algorithms

LeetCode#94: Binary Tree Inorder Traversal

First check out the problem description here on LeetCode. The Solution This is marked as a medium difficult problem. However if you know what in-order traversal does, it is a very simple problem. Here I just added a helper traverse() method. All the trick is done in the few lines inside the function. It checks […]

Categories
Algorithms

Queue Data Structure

Discussion on the implementation of queue data structure

Categories
Algorithms Data Science

Freelance Machine Learning Project Proposal Template

This is the recommended template for a Project Proposal for a freelance Machine Learning project. This is my personal choice, and definitely depending on project requirements, you might need to explicitly modify change/modify/add to this list. One size does not always fit all for Machine Learning projects. But anyway this could be a good starting point.

Categories
Algorithms Data Science

Policy Iteration, Value Iteration, and Q-Learning

Quick introduction to basic Reinforcement Learning algorithms including Bellman Equation, Policy Iteration, Value Iteration, and Q-Learning

Categories
Data Science System

Tips: Reading Hive Tables from Spark

Collection of useful tips when working with Big Data tools including Hadoop, Hive, Spark

Categories
Data Science System

Big Data Handy References

Integrating Apache Hive with Kafka, Spark, and BI: https://docs.cloudera.com/HDPDocuments/HDP3/HDP-3.1.5/integrating-hive/content/hive_hivewarehousesession_api_operations.html

Categories
Algorithms OMSCS

How To Compute Reconstruction Error for Random Projection

Random Projection is an interesting Dimensionality Reduction technique. You may choose to create a random projection for 1,2,3,..,n dimensional projections. Now how to tell which one is best? So you would need to calculate loss of data due to this reduction in data size. # data has this shape: row, col = 4898, 11 random_projection […]

Categories
Algorithms OMSCS

Artificial Neural Network: Perceptron Training

There could be two types of training algorithms for the weights for a neuron. First is to minimize the error between predicted y_hat and y. Here y_hat = boolean(activation >= threshold). This type of perceptron-based learning works best for linearly separable data and guarantees finite iterations. Second type is Gradient Descent algorithm which minimizes the […]

Categories
Algorithms

Properties of Tree

Quoting from Dasgupta, Papadimitrou, and Vazirani textbook: “Trees A tree is an undirected graph that is connected and acyclic.” p.135 Trees have these properties, quoting from DPV again: A tree on n nodes has n − 1 edges Any connected, undirected graph G = (V, E) with |E| = |V| − 1 is a tree. […]