August 29,2020
Combating High Cardinality Features in Supervised Machine Learning
https://pkghosh.wordpress.com/2017/10/09/combating-high-cardinality-features-in-supervised-machine-learning/
Using LSTMs to forecast time-series
https://towardsdatascience.com/using-lstms-to-forecast-time-series-4ab688386b1f
Transforming Categorical Data
https://developers.google.com/machine-learning/data-prep/transform/transform-categorical
How to Handle Imbalanced Classes in Machine Learning
https://elitedatascience.com/imbalanced-classes
May 31,2020
Calculating accuracy of the current minibatch
https://discuss.pytorch.org/t/calculating-accuracy-of-the-current-minibatch/4308/4
PyTorch — Multiclass Classification
https://towardsdatascience.com/pytorch-tabular-multiclass-classification-9f8211a123ab
Sklearn KFold
https://scikit-learn.org/stable/modules/generated/sklearn.model_selection.KFold.html#sklearn.model_selection.KFold
Calling a function of a module by using its name (a string)
https://stackoverflow.com/questions/3061/calling-a-function-of-a-module-by-using-its-name-a-string
How to use one class of number in MNIST
https://discuss.pytorch.org/t/how-to-use-one-class-of-number-in-mnist/26276
How to fix RuntimeError “Expected object of scalar type Float but got scalar type Double for argument”y_pred = model(X_trainTensor.float())
https://stackoverflow.com/questions/56741087/how-to-fix-runtimeerror-expected-object-of-scalar-type-float-but-got-scalar-typ
Cross validation for MNIST dataset with pytorch and sklearn
https://stackoverflow.com/questions/58996242/cross-validation-for-mnist-dataset-with-pytorch-and-sklearn
PyTorch — Variables, functionals and Autograd.
https://jhui.github.io/2018/02/09/PyTorch-Variables-functionals-and-Autograd/
May 27,2020
Numpy random shuffle and seed
np.random.seed(seed)
np.random.shuffle(idx)
https://stackoverflow.com/questions/53830056/strange-numpy-random-shuffle-and-seed
Inverse of a matrix
https://numpy.org/doc/stable/reference/generated/numpy.linalg.inv.html
Machine Learning Glossary
https://ml-cheatsheet.readthedocs.io/en/latest/index.html
May 19,2020
Pandas Melt
https://pandas.pydata.org/docs/reference/api/pandas.melt.html
Pandas Pivot_table
https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.pivot_table.html
Pandas DataFrame.fillna() to replace Null values in dataframe
https://www.geeksforgeeks.org/python-pandas-dataframe-fillna-to-replace-null-values-in-dataframe/
Numpy loadtxt() in Python
https://www.geeksforgeeks.org/numpy-loadtxt-in-python/
Pandas read_excel
https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.read_excel.html
What is the difference between json.load() and json.loads() functions
https://stackoverflow.com/questions/39719689/what-is-the-difference-between-json-load-and-json-loads-functions
Pandas : skip rows while reading csv file to a Dataframe using read_csv() in Python
https://thispointer.com/pandas-skip-rows-while-reading-csv-file-to-a-dataframe-using-read_csv-in-python/
May 13,2020
A Simple Explanation of Information Gain and Entropy
https://victorzhou.com/blog/information-gain/
Fastest way to compute entropy in Python
https://stackoverflow.com/questions/15450192/fastest-way-to-compute-entropy-in-python
Decision Tree Classification in Python
https://www.datacamp.com/community/tutorials/decision-tree-classification-python
Simple Line Plots
https://jakevdp.github.io/PythonDataScienceHandbook/04.01-simple-line-plots.html
Annotate matplotlib chart
https://python-graph-gallery.com/193-annotate-matplotlib-chart/
DecisionTreeClassifier
https://scikit-learn.org/stable/modules/generated/sklearn.tree.DecisionTreeClassifier.html#sklearn.tree.DecisionTreeClassifier
Information Gain in Decision Tree Split
https://statinfer.com/204-3-5-information-gain-in-decision-tree-split/
What is “entropy and information gain”
https://stackoverflow.com/questions/1859554/what-is-entropy-and-information-gain
Controlling figure aesthetics
https://seaborn.pydata.org/tutorial/aesthetics.html
Adding a legend to PyPlot in Matplotlib in the simplest manner possible
https://stackoverflow.com/questions/19125722/adding-a-legend-to-pyplot-in-matplotlib-in-the-simplest-manner-possible
Matplotlib scatter plot with legend
https://stackoverflow.com/questions/26558816/matplotlib-scatter-plot-with-legend
Plotting decision boundary of logistic regression
https://stackoverflow.com/questions/28256058/plotting-decision-boundary-of-logistic-regression
NumPy: Count the frequency of unique values in numpy array
https://www.w3resource.com/python-exercises/numpy/python-numpy-exercise-94.php
Make blobs
https://scikit-learn.org/stable/modules/generated/sklearn.datasets.make_blobs.html
Scatter plot of 1-D bimodal data from sklearn make_blobs()
https://stackoverflow.com/questions/55321496/scatter-plot-of-1-d-bimodal-data-from-sklearn-make-blobs
Python sklearn.datasets.make_blobs() Examples
https://www.programcreek.com/python/example/82898/sklearn.datasets.make_blobs
How to set the range of y-axis for a seaborn boxplot
https://stackoverflow.com/questions/33227473/how-to-set-the-range-of-y-axis-for-a-seaborn-boxplot/33227833
How to insert an inline image in Google Colaboratory from Google Drive
https://stackoverflow.com/questions/50670920/how-to-insert-an-inline-image-in-google-colaboratory-from-google-drive
May 10,2020
PyTorch Discussion Tips and Tricks
https://anmoljoshi.com/Pytorch-Dicussions/
May 06,2020
Pandas: filling missing values by mean in each group
https://stackoverflow.com/questions/19966018/pandas-filling-missing-values-by-mean-in-each-group/45373095
df['value'] = df['value'].fillna(df.groupby('name')['value'].transform('mean'))
Counting non zero values in each column of a dataframe in python
https://stackoverflow.com/questions/26053849/counting-non-zero-values-in-each-column-of-a-dataframe-in-python
df.astype(bool).sum(axis=0)
Handling division by zero in Pandas calculations
https://stackoverflow.com/questions/45540015/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
https://stackoverflow.com/questions/48123368/pandas-error-when-using-if-else-to-create-new-column-the-truth-value-of-a-serie/48123413
Python : How to use if, else & elif in Lambda Functions
https://thispointer.com/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
https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.apply.html
df.apply(lambda x: [1, 2], axis=1)
Pandas DataFrame iteritems
https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.iteritems.html
for label, content in df.items():
Pandas DataFrame fillna
https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.fillna.html
df.fillna(value=values)
SimpleImputer
https://scikit-learn.org/stable/modules/generated/sklearn.impute.SimpleImputer.html
from sklearn.impute import SimpleImputer
imp_mean = SimpleImputer(missing_values=np.nan, strategy='mean')
May 05,2020
Pandas — Compute z-score for all columns
https://stackoverflow.com/questions/24761998/pandas-compute-z-score-for-all-columns
Different ways to create Pandas Dataframe
https://www.geeksforgeeks.org/different-ways-to-create-pandas-dataframe/
Pandas : Loop or Iterate over all or certain columns of a dataframe
https://thispointer.com/pandas-loop-or-iterate-over-all-or-certain-columns-of-a-dataframe/
PyTorch 101, Part 1: Understanding Graphs, Automatic Differentiation and Autograd
https://blog.paperspace.com/pytorch-101-understanding-graphs-and-automatic-differentiation/
Animated math on neural network
https://www.3blue1brown.com/neural-networks
Norm
https://en.wikipedia.org/wiki/Norm_(mathematics)
Gentle Introduction to Vector Norms in Machine Learning
https://machinelearningmastery.com/vector-norms-machine-learning/
Logistic Regression with Python
https://github.com/krishnaik06/EDA1/blob/master/EDA.ipynb
May 04,2020
Group and Aggregate by One or More Columns in Pandas
https://jamesrledoux.com/code/group-by-aggregate-pandas
pandas.apply(): Apply a function to each row/column in Dataframe
https://thispointer.com/pandas-apply-apply-a-function-to-each-row-column-in-dataframe/
How To Iterate Over Pandas Rows
https://cmdlinetips.com/2018/12/how-to-loop-through-pandas-rows-or-how-to-iterate-over-pandas-rows/
May 03,2020
PyTorch — Basic operations
https://jhui.github.io/2018/02/09/PyTorch-Basic-operations/
Why second order optimization method impractical for training neural network?
https://www.quora.com/Why-second-order-optimization-method-impractical-for-training-neural-network
Bayesian Network
https://cs-cheatsheet.readthedocs.io/en/latest/subjects/bayesian/bayesian_network.html
May 02,2020
Working with Missing Data in Pandas
https://www.geeksforgeeks.org/working-with-missing-data-in-pandas/
Plot multiple columns of pandas data frame on the bar chartdf.plot(x="X", y=["A", "B", "C"], kind="bar")
https://stackoverflow.com/questions/42128467/matplotlib-plot-multiple-columns-of-pandas-data-frame-on-the-bar-chart
Selecting multiple columns in a pandas dataframedf1 = df[['a','b']]
https://stackoverflow.com/questions/11285613/selecting-multiple-columns-in-a-pandas-dataframe
Select rows containing certain values from Pandas DataFramedf[df.values == 'banana']
df[df.isin(values).any(1)]
https://stackoverflow.com/questions/38185688/select-rows-containing-certain-values-from-pandas-dataframe
Python Pandas : How to Drop rows in DataFrame by conditions on column valuesdf.drop(labels=None, axis=0, index=None, columns=None, level=None, inplace=False, errors='raise')
https://thispointer.com/python-pandas-how-to-drop-rows-in-dataframe-by-conditions-on-column-values/
May 01,2020
Delete rows from a pandas DataFrame based on a conditional expressiondf.drop(df[df.score < 50].index, inplace=True)
https://stackoverflow.com/questions/13851535/delete-rows-from-a-pandas-dataframe-based-on-a-conditional-expression-involving
How to Get Frequency Counts of a Column in Pandas Dataframe: Pandas Tutorialdf['continent'].value_counts()
https://cmdlinetips.com/2018/02/how-to-get-frequency-counts-of-a-column-in-pandas-dataframe/
Subset of the DataFrame’s columns based on the column dtypesdf.select_dtypes(include=['category']) // Pandas categorical dtypes
https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.select_dtypes.html
df.select_dtypes(exclude=['int'])
Handle missing values in pandas
https://www.youtube.com/watch?v=fCMrO_VzeL8
Python pandas Q&A video series
https://github.com/justmarkham/pandas-videos
April 30, 2020
Quick start guide on Google Colab
https://colab.research.google.com/notebooks/intro.ipynb#scrollTo=GJBs_flRovLc
PyTorch 101, Part 1: Understanding Graphs, Automatic Differentiation and Autograd
https://blog.paperspace.com/pytorch-101-understanding-graphs-and-automatic-differentiation/
Probabilistic Graphical Models
https://frnsys.com/ai_notes/foundations/probabilistic_graphical_models.html
April 24, 2020
Deep Learning with PyTorch: A 60 Minute Blitz
https://pytorch.org/tutorials/beginner/deep_learning_60min_blitz.html