Skip to content

Instantly share code, notes, and snippets.

@yosimox
yosimox / random_walk.rb
Created February 6, 2014 07:13
ランダムウォークによる広告アトリビューション予測モデル
# -*- coding: utf-8 -*-
require 'pp'
class RandomWalk
def initialize(header, data, input)
@header = header
@data = data
@input = input
@yosimox
yosimox / chi_sq_test.py
Created July 26, 2013 06:27
pandasとscipyでクロス集計表のカイ2乗検定+残差分析。調整済み標準化残差まで出せるように。
# -*- coding: utf-8 -*-
import numpy as np
import pandas as pd
import scipy as sp
import scipy.stats
from pandas import DataFrame, Series
def chi_sq_test(df):
@yosimox
yosimox / evTrack.js
Created March 22, 2012 06:33
サーバーログでイベントトラッキングする用のJSライブラリ(JS版)
(function() {
var EvTrack, url;
EvTrack = (function() {
function EvTrack(url) {
this.url = url;
this.opt = {
category: "",
action: "",
@yosimox
yosimox / evTrack.coffee
Created March 22, 2012 06:32
サーバーログでイベントトラッキングする用のJSライブラリ
class EvTrack
constructor: (url)->
@url = url
@opt = {
category : ""
action : ""
label : ""
value : ""
}
@optName = {
@yosimox
yosimox / loadingMachine.js
Last active September 30, 2015 11:18
JavaScript Loading Tool. Async loading and Syncloading with jquery and google analytics
/*
JavaScript Loading Tool
Async loading and Syncloading with jquery and google analytics
*/
(function() {
/* THE WAY OF FILE SETTING
CASE : javascript file
{
'type':'js', // put 'js
'src':'hidouki.js', // put the path of the js file
@yosimox
yosimox / event.coffee
Created December 13, 2011 04:01
カフェスクリプトで外部リンクトラッキング用のテスト
gaConf = {
linkFilter : {
#外部サイトへのリンクトラック true or false
offsite : true,
#除外サイト
excludeLink : [
/google/,
/livedoor/
],
internalTrack : {