Skip to content

Instantly share code, notes, and snippets.

View rischanlab's full-sized avatar
💭
I may be slow to respond.

Rischan Mafrur rischanlab

💭
I may be slow to respond.
View GitHub Profile
@rischanlab
rischanlab / cbers.py
Created January 19, 2017 05:32
Ingest new cbers catalogue
__author__ = 'rischan - <[email protected]>'
__date__ = '3/4/16'
import os
import sys
import glob
from cmath import log
from datetime import datetime
from xml.dom.minidom import parse
import traceback
@rischanlab
rischanlab / tweet_dumper.py
Created May 29, 2016 01:53 — forked from yanofsky/LICENSE
A script to download all of a user's tweets into a csv
#!/usr/bin/env python
# encoding: utf-8
import tweepy #https://github.com/tweepy/tweepy
import csv
#Twitter API credentials
consumer_key = ""
consumer_secret = ""
access_key = ""
@rischanlab
rischanlab / delete_all_tweets.py
Created May 24, 2016 17:31 — forked from vik-y/delete_all_tweets.py
This script will delete all of the tweets in a specified account.
# -*- coding: utf-8 -*-
"""
This script is forked originally from Dave Jeffery. The original implementation
was very slow and deleted around 2 tweets per second. Making it multithreaded I
am able to delete 30-50 tweets per second.
@author: vik-y
----------------------------------------------------------------------------
This script will delete all of the tweets in the specified account.
__author__ = 'rischan'
from django.core.exceptions import ObjectDoesNotExist
from django.core.management.base import BaseCommand
from agri_mapper.utilities.script import CallWMS, CallWFS, UpdateModel
import logging
logger = logging.getLogger(__name__)
@rischanlab
rischanlab / preprocessing2.R
Last active September 16, 2015 04:00
Second Preprocessing for Personal user behavior data
### Author Information #####
### Coded by Rischan Mafrur ###
### 01/01/2015 ###
### For Thesis Purpose ###
### Language : R ###
### Dataset : Private Data ###
#Function for loading data
f_load_data <- function(path){
library(shiny)
@rischanlab
rischanlab / preprocessing_data.R
Last active September 16, 2015 04:00
This source code is for preprocessing our research data (personal user data behavior data)
### Author Information #####
### Coded by Rischan Mafrur ###
### 01/01/2015 ###
### For Thesis Purpose ###
### Language : R ###
### Dataset : Private Data ###
#Function for loading data
f_load_data <- function(path){
library(shiny)
#to make the final table, I changed manually the n size every trial by: 1e3, 1e4, 1e5, 1e6, 1e7. Then I also chnaged the benchmark object 'res'
n <- 1e7
set.seed(51)
process <- data.frame(id=sample(100, n, rep=T), x=rnorm(n), y=runif(n), z=rpois(n, 1) pexp(2, rate=1/3) )
all <- multicore:::detectCores(all.tests=TRUE)
if(!require(rbenchmark)){
install.packages("rbenchmark")
} else{
@rischanlab
rischanlab / RandomForest.R
Created May 24, 2014 02:52
RandomForest in R
install.packages("randomForest",dependencies=TRUE)
library(randomForest)
fit <- randomForest(data$user ~ data$academic+data$email
+data$socnet+data$porn+data$comic+data$music
+data$shop+data$blog+data$video+data$search
+data$news, data=data)
print(fit)
importance(fit)
@rischanlab
rischanlab / subfigure_span.tex
Created May 23, 2014 19:04
Subfigure span the two columns in IEEEtrans style
\begin{figure*}%
\centering
\begin{subfigure}{.95\columnwidth}
\includegraphics[width=\columnwidth]{tolakpartaipoligami_pie3D.png}%
\caption{\#TolakPartaiPoligami hashtag}
\label{fig:sub1}
\end{subfigure}\hfill%
\begin{subfigure}{.95\columnwidth}
\includegraphics[width=\columnwidth]{sayapilihpks_pie3D.png}%
\caption{\#SayaPilihPKS hashtag}
@rischanlab
rischanlab / NaiveBayes_MyProject.R
Created May 20, 2014 06:43
Twitter accounts classification using Naive Bayes in R
#author : Rischan Mafrur
#email : [email protected]
#website : rischanlab.github.io, ourmasjid.me
#May 15, 2014
#install requirement packages
install.packages("klaR")
install.packages("caret")
install.packages("plotrix")