Skip to content

Instantly share code, notes, and snippets.

View minesh1291's full-sized avatar
🚖
On The Journey to Neverland

Minesh A. Jethva minesh1291

🚖
On The Journey to Neverland
View GitHub Profile
@minesh1291
minesh1291 / github-graph-colours-changer.js
Created October 5, 2015 09:13 — forked from noeldelgado/github-graph-colours-changer.js
Copy and paste the code on your github profile page to change the graph colours... (DevTools » Console)
var GH = ['#EEEEEE', '#D6E685', '#8CC665', '#44A340', '#1E6823'];
var CO = ['#EF4B4D', '#F89B47', '#FAEA20', '#7DC242', '#5D94CE', '#855CA7'];
var graph = document.getElementsByClassName('js-calendar-graph-svg')[0];
var days = [].slice.call(graph.getElementsByTagName('rect'), 0);
days.forEach(function(rect) {
switch(rect.getAttribute('fill').toUpperCase()) {
case GH[0]: rect.setAttribute('fill', CO[2]); break; // yellow
case GH[1]: rect.setAttribute('fill', CO[Math.floor(Math.random() * 2)]); break; // red || orange
from sklearn.datasets import load_iris
from sklearn.ensemble import RandomForestClassifier
import pandas as pd
import numpy as np
iris = load_iris()
df = pd.DataFrame(iris.data, columns=iris.feature_names)
df['is_train'] = np.random.uniform(0, 1, len(df)) <= .75
df['species'] = pd.Factor(iris.target, iris.target_names)
df.head()
@minesh1291
minesh1291 / demo-iris-scienceops.py
Created January 4, 2016 04:06 — forked from glamp/demo-iris-scienceops.py
Demos of ScienceOps that reads from a remote MySQL server
from mysql import connector
from sklearn import linear_model
from yhat import Yhat, YhatModel, preprocess
class MySQLIrisClassifier(YhatModel):
REQUIREMENTS = ['scikit-learn']
def select_data(self, cursor):
# Returns the full dataset of features and outputs
@minesh1291
minesh1291 / disable_wifi_hotspot.bat
Created May 14, 2017 17:24 — forked from Mithrandir0x/disable_wifi_hotspot.bat
Two little batch files to create a cozy WiFi hotspot from the laptop Snatched from xda-developers, yet I don't remember the thread. Kudos to the author.
netsh wlan stop hostednetwork
pause
@minesh1291
minesh1291 / 0_reuse_code.js
Created September 15, 2017 13:59
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@minesh1291
minesh1291 / clean_install.md
Created April 18, 2018 14:54
Setting up Ubuntu 14.04 for Deep Learning, PySpark, and Climate Science

Setting up an Ubuntu 14.04 clean install for Development with PySpark and Deep Learning

  • Assumes NVIDIA GPU
  • Prefers Ubuntu native packages over Docker for simplicity
sudo apt-get update && sudo apt-get -y upgrade

0. Install Java

@minesh1291
minesh1291 / daemon.py
Created April 19, 2018 15:47 — forked from josephernest/daemon.py
Daemon for Python
# From "A simple unix/linux daemon in Python" by Sander Marechal
# See http://stackoverflow.com/a/473702/1422096
#
# Modified to add quit() that allows to run some code before closing the daemon
# See http://stackoverflow.com/a/40423758/1422096
#
# Joseph Ernest, 2016/11/12
import sys, os, time, atexit
from signal import signal, SIGTERM
'''This script goes along the blog post
"Building powerful image classification models using very little data"
from blog.keras.io.
It uses data that can be downloaded at:
https://www.kaggle.com/c/dogs-vs-cats/data
In our setup, we:
- created a data/ folder
- created train/ and validation/ subfolders inside data/
- created cats/ and dogs/ subfolders inside train/ and validation/
- put the cat pictures index 0-999 in data/train/cats
states = ('Rainy', 'Sunny')
observations = ('walk', 'shop', 'clean')
start_probability = {'Rainy': 0.6, 'Sunny': 0.4}
transition_probability = {
'Rainy' : {'Rainy': 0.7, 'Sunny': 0.3},
'Sunny' : {'Rainy': 0.4, 'Sunny': 0.6},
}
@minesh1291
minesh1291 / hmm_2.py
Created May 23, 2019 12:07 — forked from kangeugine/hmm_2.py
HMM Problem #1
import math
math.exp(model.score(np.array([[0]])))
# 0.30000000000000004
math.exp(model.score(np.array([[1]])))
# 0.36000000000000004
math.exp(model.score(np.array([[2]])))
# 0.3400000000000001
math.exp(model.score(np.array([[2,2,2]])))
# 0.04590400000000001