- Use the command below after modifying
.gitignore and to remove tracking files already committed before
git rm -r --cached .
- List all the files currently being tracked under the branch master
git ls-tree -r master --name-only
- Print a decorated log of branches on command line
git log --all --decorate --oneline --graph
Continue reading “GIT hacks”
When creating training data for RNN, the target label for a given input label is the input label itself but shifted by one position. Please refer to the diagram below.
Continue reading “Creating input (x) and target (y) for RNNs”
enumerate() is a useful function to make an iterator when used with a
for loop. Here we explain different ways of using
enumerate() using a python list.
enumerate() acts as an iterator yielding a tuple
(index,element)when applied on a list.
Continue reading “Usage of enumerate() with python list”
Extend() when acting on a list
Continue reading “Append and Extend python list”
get() method is useful when accessing key-value pair from a dictionary. It returns a pre-defined value (
-1 in the example below) if key is not present in dictionary, else it returns the value associated with key.
Continue reading “get() method for python dictionary”
With a command-line interface to the server, it is often hard to quickly scan through the contents on a server. This can be circumvented using jupyter-lab (or jupyter notebook) running on the server and accessing it using a client machine. I presume you have already installed jupyter-lab (or jupyter-notebook) on server. Jupyter-lab is a better option as it comes with a file-navigator, spread-sheet viewer (faster than excell, reminds me of sublime text) and an image-viewer. Check out this video for the latest feature updates in jupyter-lab.
Continue reading “Running Jupyter Notebook on a remote server”
This is a post which will get updated periodically with interesting tips and tricks in ipython notebook
Continue reading “Hacks for IPython Notebook”
How to impute missing values in a dataset before feeding to a classifier is often a difficult decision. Imputing with a wrong value can significantly skew the data and result in wrong classifier. The ideal solution is to get a clean data set without any NULL values but then, we might have to throw out most data. There are no perfect workarounds as most classifiers are built based on the information from data and lack thereof results in the wrong classifier. Continue reading “Handling missing values in a Dataset before training”
Although there are multiple packages which plots ROC curve, this one seems to be the most convenient.
# Predict on test: p
p <- predict(model, test, type = "response")
# create ROC Curve
colAUC(p,test[["Class"]],plotROC = T)