Posts

Showing posts with the label data science

Missing Values in Data Science Interview

If an interviewer shows you a sample dataset and asks you to tell what comes to your mind, he likely wants to ask you about MISSING VALUES in the dataset. So, check if the dataset has any missing values and answer him accordingly. The next thing the interviewer will ask you will likely be about strategies for dealing with those missing values. So, be prepared. 4 Strategies to Deal with Missing Values in a Dataset: Drop all columns with missing values (wastes a lot of valuable data, so NOT recommended) Drop all rows with missing values (if there are only a few no of rows with missing values, then you can do this) Imputation: You basically fill the missing value with some default value (like -1) or some calculated value (like mean). This is the most used strategy. Imputation with tracking: Basically, you use imputation on a column, and then you create a new column to keep track of the rows where you have applied imputation. The new column will be either TRUE or FALSE based on whether you...

Batch Gradient Descent vs Stochastic Gradient Descent (SGD) vs Mini-Batch Gradient Descent

Image
 In this article, we will explore the basic difference between Batch Gradient Descent, Stochastic Gradient Descent (SGD) and Mini-Batch Gradient Descent.  But first let us understand what an epoch means. Meaning of the word "epoch" In Deep Learning, an epoch is one iteration over the entire sample space (training set). In other words, everytime you go over each sample of the training set, it is considered one epoch. Basic Deep Learning training process Initialize model parameters: weights and biases with some random value. Go over objects of training set. Adjust your model parameters : weights and biases w.r.t some cost/loss fuction. Repeat from step 2 till desired threshold is reached. Batch Gradient Descent or simple Gradient Descent In Batch Gradient Descent, in each epoch we go throught entire training set and then adjust parameters. In every epoch, parameters are adjusted once which makes it unsuitable for large datasets. Stochastic Gradient Descent (SGD) In Stochast...