Skip to content

Instantly share code, notes, and snippets.

View Nithanaroy's full-sized avatar
🎯
Focusing

Nitin Pasumarthy Nithanaroy

🎯
Focusing
View GitHub Profile
@Nithanaroy
Nithanaroy / hierarchy-classes.ipynb
Last active December 27, 2019 12:30
Desktop/blog/hierarchy/hierarchy-classes.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Nithanaroy
Nithanaroy / merged-percentile-buckets-acc-tf-custom-metrics.py
Last active July 4, 2019 17:13
Calculate the accuracy of merged percentile buckets
# Credits: https://stackoverflow.com/a/52127761/1585523
import tensorflow as tf
from tensorflow.keras import backend as K
# Define the custom accuracy tensorflow metric
def three_class_acc(y_true, y_pred):
tr = tf.floor(tf.to_float(K.argmax(y_true, axis=-1) / 3))
pr = tf.floor(tf.to_float(K.argmax(y_pred, axis=-1) / 3))
return K.cast(K.equal(tr, pr), K.floatx())
@Nithanaroy
Nithanaroy / long-tail-distribution.ipynb
Last active December 27, 2019 12:36
blog_percentile-buckets_long-tail-distribution.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Nithanaroy
Nithanaroy / using-screen-command.csv
Last active September 11, 2018 22:54
Useful options with screen command
Operation Keycodes
Start a screen session `screen -a`
Detach from current screen session `Ctrl + Shift + D A`
Reattach to a recent detached session `screen -r`
List of screens `screen -ls`
Attach to screen with name `screen -xS name`
Name a screen `Ctrl+a :sessionname name Enter`
@Nithanaroy
Nithanaroy / char-encoding-versus-others.csv
Last active September 9, 2018 20:52
Comparison of Character One-Hot Encoding with Embedding + Hashing encoding schemes
Character one-hot encoding Embedding or Bucketing
fixed length inputs variable and long inputs
low character cardinality chracter cardinality is not an issue
new values are frequent best to have visibility of entire population of inputs at design phase
@Nithanaroy
Nithanaroy / data-after-encoding.csv
Created June 6, 2018 22:13
Encoding-Medium-Post-data-after-encoding
ID IP Address: String ChromeBrowser: Number FirefoxBrowser: Number EdgeBrowser: Number SafariBrowser: Number Duration: Number
0 86.98.19.228 1 0 0 0 40
1 95.255.60.157 0 1 0 0 50
2 213.194.42.105 1 0 0 0 207
3 51.52.146.6 0 0 1 0 7
4 42.111.129.57 0 0 0 1 141
@Nithanaroy
Nithanaroy / running-example-data.csv
Last active June 6, 2018 22:09
Encoding-Medium-Post-running-example-data
ID IP Address: String Browser: String Duration: Number
0 86.98.19.228 Chrome 40
1 95.255.60.157 Firefox 50
2 213.194.42.105 Chrome 207
3 51.52.146.6 Edge 7
4 42.111.129.57 Safari 141
@Nithanaroy
Nithanaroy / costly_functional.js
Last active November 24, 2017 21:55
Performant chaining ops in JavaScript
/** Double all the even numbers in the given array **/
const isEven = (n) => n % 2 === 0;
const doubleIt = (n) => n * 2;
const finalAnswer = [1, 2, 3, 4]
.filter(isEven)
.map(doubleIt)
@Nithanaroy
Nithanaroy / .gitconfig
Created November 21, 2017 22:35
Git Global Config
[alias]
co = checkout
c = commit
s = status
b = branch
hist = log --pretty=format:'%h %ad | %s%d [%an]' --graph --date=short
type = cat-file -t
dump = cat-file -p
d = diff
a = add
@Nithanaroy
Nithanaroy / bash_profile
Last active February 23, 2021 04:45
A good bash profile for a full stack developer
# source ~/.bash_folder/colors
alias gg="git gui"
alias gka="gitk --all &"
alias gk="gitk &"
alias gcm="git checkout master"
alias gp="git pull --rebase"
alias grm="git rebase master"
alias grom="git fetch origin;git rebase origin/master"
alias gb="git branch"