Machine Learning Reading Diary

Interesting articles and page links on Machine Learning and Data Science. This might be helpful to aspiring programmers and analysts.

May 13,2020

A Simple Explanation of Information Gain and Entropy

Fastest way to compute entropy in Python

Decision Tree Classification in Python

Simple Line Plots

Annotate matplotlib chart


Information Gain in Decision Tree Split

What is “entropy and information gain”

Controlling figure aesthetics

Adding a legend to PyPlot in Matplotlib in the simplest manner possible

Matplotlib scatter plot with legend

Plotting decision boundary of logistic regression

NumPy: Count the frequency of unique values in numpy array

Make blobs

Scatter plot of 1-D bimodal data from sklearn make_blobs()

Python sklearn.datasets.make_blobs() Examples

How to set the range of y-axis for a seaborn boxplot

How to insert an inline image in Google Colaboratory from Google Drive

May 10,2020

PyTorch Discussion Tips and Tricks

May 06,2020

Pandas: filling missing values by mean in each group

df['value'] = df['value'].fillna(df.groupby('name')['value'].transform('mean'))

Counting non zero values in each column of a dataframe in python


Handling division by zero in Pandas calculations

(a / b).replace(np.inf, 0)

Pandas error when using if-else to create new column: The truth value of a Series is ambiguous

Python : How to use if, else & elif in Lambda Functions

lambda <arguments> : <Return Value if condition is True> if <condition> else <Return Value if condition is False>

Pandas DataFrame apply

df.apply(lambda x: [1, 2], axis=1)

Pandas DataFrame iteritems

for label, content in df.items():

Pandas DataFrame fillna



from sklearn.impute import SimpleImputer
imp_mean = SimpleImputer(missing_values=np.nan, strategy='mean')

May 02,2020

Working with Missing Data in Pandas

Plot multiple columns of pandas data frame on the bar chart
df.plot(x="X", y=["A", "B", "C"], kind="bar")

Selecting multiple columns in a pandas dataframe
df1 = df[['a','b']]

Select rows containing certain values from Pandas DataFrame
df[df.values == 'banana']

Python Pandas : How to Drop rows in DataFrame by conditions on column values
df.drop(labels=None, axis=0, index=None, columns=None, level=None, inplace=False, errors='raise')

May 01,2020

Delete rows from a pandas DataFrame based on a conditional expression
df.drop(df[df.score < 50].index, inplace=True)

How to Get Frequency Counts of a Column in Pandas Dataframe: Pandas Tutorial

Subset of the DataFrame’s columns based on the column dtypes
df.select_dtypes(include=['category']) // Pandas categorical dtypes

Handle missing values in pandas

Python pandas Q&A video series

April 24, 2020

Deep Learning with PyTorch: A 60 Minute Blitz

The Invisible Man | Machine Learning Engineer, Programmer, Tech Enthusiast

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