Skip to content

Instantly share code, notes, and snippets.

View jkapila's full-sized avatar

Jitin Kapila jkapila

View GitHub Profile
library(twitteR)
library(ggplot2)
tweets <- list()
dates <- paste("2012-07-",11:18,sep="") # need to go to 18th to catch tweets from 17th
for (i in 2:length(dates)) {
print(paste(dates[i-1], dates[i]))
tweets <- c(tweets, searchTwitter("#ISMB", since=dates[i-1], until=dates[i], n=1500))
}
@jkapila
jkapila / a2dp.py
Created May 28, 2017 12:43 — forked from pylover/a2dp.py
Fixing bluetooth stereo headphone/headset problem in ubuntu 16.04, 16.10 and also debian jessie, with bluez5.
#! /usr/bin/env python3.5
"""
Fixing bluetooth stereo headphone/headset problem in ubuntu 16.04 and also debian jessie, with bluez5.
Workaround for bug: https://bugs.launchpad.net/ubuntu/+source/indicator-sound/+bug/1577197
Run it with python3.5 or higher after pairing/connecting the bluetooth stereo headphone.
This will be only fixes the bluez5 problem mentioned above .
@jkapila
jkapila / DAR.R
Created April 21, 2018 19:59
Implementationof DAR in R!
#########################################################################
#
# Implementation of Distribution Assertive Regression
#
#########################################################################
# Definign Mean Average Percentage Error
mape <- function(actual,predicted,asmean=FALSE){
ape <- (abs(actual-predicted) * 100)/ actual
@jkapila
jkapila / dist_assert_regression.R
Created May 14, 2020 18:11
Code For Distributed Assertive Regression
#########################################################################
#
# Implementation of Distribution Assertive Regression
#
#########################################################################
# Definign Mean Average Percentage Error
mape <- function(actual,predicted,asmean=FALSE){
ape <- (abs(actual-predicted) * 100)/ actual
@jkapila
jkapila / test_dar.R
Created May 14, 2020 18:16
Testing DAR on Bostone Housing Data
## Testing Distribution Assertive Regression with Boston Housing Data
library(dplyr)
library(mlbench)
data("BostonHousing")
df <- BostonHousing[order(BostonHousing[,'medv']),]
# Using DAR with lm Model
# importing required libraries
import matplotlib.pyplot as plt
import matplotlib as mpl
import networkx as nx
# function to plot bayesian network
def plot_bn_graph(G,title='',label_fontsize = 14,node_color='b',node_size=10,figsize=(12,10),position=False,layout='circular',cmap='YlOrRd'):
"""
Plotting Network diagram using Networkx and Matplotlib only.
@jkapila
jkapila / bayesian-network-with-pomegranate.ipynb
Last active September 22, 2021 17:10
Bayesian Network with Pomegranate.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.