Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
I may be slow to respond.

Rischan Mafrur rischanlab

💭
I may be slow to respond.
View GitHub Profile
@rischanlab
rischanlab / cbers.py
Created Jan 19, 2017
Ingest new cbers catalogue
View cbers.py
__author__ = 'rischan - <--rischan@kartoza.com-->'
__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 — forked from yanofsky/LICENSE
A script to download all of a user's tweets into a csv
View tweet_dumper.py
#!/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 — forked from vik-y/delete_all_tweets.py
This script will delete all of the tweets in a specified account.
View delete_all_tweets.py
# -*- 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.
View av_layer_better.py
__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 Sep 16, 2015
Second Preprocessing for Personal user behavior data
View preprocessing2.R
### 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 Sep 16, 2015
This source code is for preprocessing our research data (personal user data behavior data)
View preprocessing_data.R
### 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)
View parallel.R
#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{
View RandomForest.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
Subfigure span the two columns in IEEEtrans style
View subfigure_span.tex
\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
Twitter accounts classification using Naive Bayes in R
View NaiveBayes_MyProject.R
#author : Rischan Mafrur
#email : rischanlab@gmail.com
#website : rischanlab.github.io, ourmasjid.me
#May 15, 2014
#install requirement packages
install.packages("klaR")
install.packages("caret")
install.packages("plotrix")