Skip to content

Instantly share code, notes, and snippets.

View nborwankar's full-sized avatar

Nitin Borwankar nborwankar

View GitHub Profile
import dash
import dash_core_components as dcc
import dash_html_components as html
import plotly.graph_objs as go
import pandas as pd
app = dash.Dash()
df = pd.read_csv(
'https://gist.githubusercontent.com/chriddyp/'
@nborwankar
nborwankar / freebasicsInIndia.md
Last active December 30, 2015 04:46
Free Basics in India - some links (started Dec 2015)
@nborwankar
nborwankar / MLBootcampOct2015
Last active October 6, 2015 20:41
Notes and links for ML Bootcamp at UCB Oct 2015
Session 1
---------
* Intro
* Motivation
* Installation
* Overview of Material
  1. General Background and Overview
@nborwankar
nborwankar / gist:e7f8bbd030186f202fa2
Created August 8, 2014 06:04
Onename bitcoin username
Verifying myself: My Bitcoin username is +nitinb. https://onename.io/nitinb
I've had a good look at the new Data Science Certification program from Johns Hopkins on Coursera
and it looks like the first one to crack the code on what is needed for the future.
It gets many things right and they all add up to make it likely to be
a huge success compared to other such programs.
What does it get right?
a) Makes all 9 classes available at once on Cousera
b) Makes each class a uniform 4 weeks long
@nborwankar
nborwankar / gist:5208953
Created March 20, 2013 22:04
two files needed for %pg magic in IPython - pgdb.py and pgmagic.py, this is pgmagic.py
__author__ = 'nitin'
# -*- coding: utf-8 -*-
"""
===========
pgmagic
===========
Magics for interacting with Postgres database server via psycopg2.
@nborwankar
nborwankar / gist:5208931
Created March 20, 2013 22:02
two python files needed for %pg magic in IPython pgdb.py and pgmagic.py. This is pgdb.py
# pgdb.py
__author__ = 'nitin'
import psycopg2 as pspg2
import sys
# import pandas as pd, then use pandas.io.sql
db_data = {
'host':'localhost',
'dbname': 'nitin',
# compute error measures for predictive model for activity (act) as dependent variable
# note this is computed for all 6 activities and a total computed which is an aggregate value
errormeasures <- function(orig, pred, act) {
N <- length(orig)
origtrue <-as.vector(NULL)
origfalse <-as.vector(NULL)
predtrue <-as.vector(NULL)
predfalse <-as.vector(NULL)
@nborwankar
nborwankar / RSessionToMADlibPG.txt
Created July 13, 2012 00:15
RSessionToMADlibPG
===
> rs <- dbSendQuery(con, statement = paste(
+ "SELECT * FROM", +"MADlib.c45_train('infogain','public.golf_data','trained_tree_infogain',null,'temperature,humidity','outlook,temperature,humidity,windy','id','class',100,'explicit', 5,0.001,0.001,0)"));
> df <- fetch(rs, n = -1)
> df
training_set_size tree_nodes tree_depth training_time split_criterion
14 8 3 00:00:00.311362 infogain