Have you encountered The PUSH of UNDEFINED


Why this.props.history is undefined and why we cannot call method push of undefined?

Let us understand how this problem arises and what are the ways to solve it.

The Problem

We want to navigate to a different page, we are using react-router but we don’t find history object in props.
The component hierarchy usually looks like this.

Let's say we have a Footer component inside NotHome and on the link click
we want to navigate to AnotherComponent.

Image by Photo Mix from Pixabay [I did not get a free-use Pickle Rick Image :( ]

What is Pickle

Pickle is a python module used to serialize a python object into a binary format and deserialize it back to the python object.

Two important use cases of using pickle

First Case:

You are working on a machine learning problem, using the favorite: jupyter notebook. You analyzed the data and identified principal features that will help your model. You perform feature engineering and you know that this will be the final data you will pass to the machine learning model. But feature engineering requires a lot of time and you do not want to lose the feature engineered data after you shut down the notebook.

Here’s where…

Photo by Álvaro Serrano on Unsplash

Competition Description:

In this competition, the fifth iteration, you will use hierarchical sales data from Walmart, the world’s largest company by revenue, to forecast daily sales for the next 28 days. The data covers stores in three US States
(California, Texas, and Wisconsin) and includes item level, department, product categories, and store details.

Also, it has explanatory variables such as price, promotions, day of the week, and special events. Together, this robust dataset can be used to improve forecasting accuracy.


We have been provided with 4 CSV files

  1. calendar. csv: Contains information about the dates on which the products are sold.
  2. sales_train_validation.csv…

Photo by Patrick Tomasso on Unsplash

We are generating data more than ever. A very good percentage of it is text. Tweets, comments, reviews, searches, queries, everything is in text because that’s the way we communicate, that’s our language.

Computers just know 0 and 1, let’s teach it more


  1. Python Basics
  2. NLP Concepts such as Tokenization, Stopwords, Stemming and Vectorization
  3. Word2Vec Basics

Note: This story does not dive into the theory of NLP, rather it shows how to get started with python(Practical Approach)

Consider the dataset: News Category

Step 0: Imports

Image by Gordon Johnson from Pixabay

Voice assistants listens to us too much, let us talk what happens if we deploy ML to do more.

We have a lot of smart objects. Automation has been around a long time now. Turn off the TV, turn on the TV, you just need a voice command.
Turn on the lights by just walking into space and turn them off when walked out.

Sensors sense things and actuators drive actions accordingly.

Now it’s turn to add Machine Learning to these objects.

Consider an oven which can tell you the optimal temperature to bake cookies. …

Learnt K Means Clustering and now you want to apply in real life applications?
Applied clustering algorithm but not satisfied with the results?
Get started with the easiest dataset you’ll ever see and know how Scaling affects Clustering and how a small change in data results in totally different Clusters!

Image by arielrobin from Pixabay


  1. You should know what clustering is.
  2. You should know the KMeans algorithm.
  3. Basics of Python

Let’s get into Coding

Step 1: Import the required libraries

Step 2: Read the dataset

Step 3: Understand the dataset

My favorite movies are: The Dark Knight, Joker, Bridge Of Spies and
Forrest Gump.

I asked my friends can you group these movies!, one of them grouped into Comic Book Movies and Non Comic Book Movies and another of them grouped these into Tom Hanks Movies and Non Tom Hanks Movies.
Hmm Interesting!, both of them are right.

Let’s see a technique, using which Machine can group these movies.

Know what Machine Learning is? If Yes, go ahead, If No, checkout my other story.

Unsupervised Learning

Unsupervised Learning is a Machine Learning technique that deals with unlabeled data i.e data here do…

Should I watch a movie today? Well let me check my schedule, let me check the weather. Are my friends available today? These are the questions I ask myself before watching a movie.

Can a machine mimic my decisions? If given a data of these questions and answers to a machine, can it reach the same conclusion as I do?

Go to movie: Training Data Example
Go to movie: Training Data Example
Sample of Data for Supervised Learning

Well the answer is YES and this technique is called Supervised Learning.

Know what Machine Learning is? If Yes, go ahead, If No, checkout my other story.

Supervised Learning

Supervised Learning is a Machine Learning technique which deals with labelled data.

Are you having a hard time deciding what you want to watch, but then Netflix helps you out with their suggestions?

Do you get personalized ads when you are interested in a certain product?

Well, this is all done using Machine Learning.

What is Machine Learning?

Machine Learning or ML is a technique that teaches machine to do some task.
To perform this task, Machine Learning takes the help of Data and Algorithms.

Let's consider a simple problem where a machine has to recognize cats and dogs.
The task is to recognize cats and dogs.
The data can be either photos of or the different characteristics…

Ajay n Jain

Developing expertise in Machine Learning! I share my thoughts here! LinkedIn: https://www.linkedin.com/in/njain9104/

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store