Skip to content

Instantly share code, notes, and snippets.

View dalpozz's full-sized avatar

Andrea Dal Pozzolo dalpozz

View GitHub Profile
@khuangaf
khuangaf / CategoricalEncoder.py
Last active March 31, 2019 19:19
This class is intended for faster and simpler categorical/ label encoding on large data, in which sklearn's LabelEncoder might be too slow.
'''
Author: Kung-hsiang, Huang (Steeve)
Date: 2019/Mar/15
'''
class CategoricalEncoder():
'''
This class is for those operating on large data, in which sklearn's LabelEncoder class may take too much time.
This encoder is only suitable for 1-d array/ list. You may modify it to become n-d compatible.
'''
@simecek
simecek / facebook_mining.r
Created January 18, 2012 18:26
Facebook Mining
# go to 'https://developers.facebook.com/tools/explorer' to get your access token
access_token <- "******************* INPUT YOUR ACCESS TOKEN ******************************"
require(RCurl)
require(rjson)
# Facebook json function copied from original (Romain Francois) post
facebook <- function( path = "me", access_token, options){
if( !missing(options) ){
options <- sprintf( "?%s", paste( names(options), "=", unlist(options), collapse = "&", sep = "" ) )