This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
simple and clear algorithm description: | |
http://www.titouangalopin.com/blog/articles/2014/05/simhash-or-the-way-to-compare-quickly-two-datasets | |
a python impl | |
http://liangsun.org/posts/a-python-implementation-of-simhash-algorithm/ | |
original paper of simhash | |
http://www.cs.princeton.edu/courses/archive/spr04/cos598B/bib/CharikarEstim.pdf | |
simhash impl doc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy | |
import math | |
# LSH signature generation using random projection | |
def get_signature(user_vector, rand_proj): | |
res = 0 | |
for p in (rand_proj): | |
res = res << 1 | |
val = numpy.dot(p, user_vector) | |
if val >= 0: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
斗地主人工智能 [2007-3-7] | |
http://www.ylog.net/blog_show.asp?log_id=2148 | |
近一周在制作斗地主纸牌游戏的人工智能 | |
算法主要是用宽度优先生成一棵搜索树 | |
再根据玩牌的技巧进行剪枝与判权.... | |
节点权值判断主要由有限状态机构成 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from random import random, choice, randint | |
""" | |
+++++++++++++++++++++ | |
+ 10 + 1 + 1 + 1 + | |
+++++++++++++++++++++ | |
+ 1 + 1 + 1 + 1 + | |
+++++++++++++++++++++ | |
+ 1 + 1 + 1 + 1 + | |
+++++++++++++++++++++ | |
+ 1 + 1 + 1 + 1 + |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#The input data should be in CSV format. | |
# Each row is a campaign. The columns are (description and variable name): | |
# Campaign id (id) | |
# Conversion rate (cvr) | |
# Bid price (price) | |
# Max allocated campaign budget (max_allocation) | |
import csv | |
import sys |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
id | cvr | price | max_allocation | |
---|---|---|---|---|
1 | 0.005 | 4 | 100 | |
2 | 0.001 | 0.75 | 100 | |
3 | 0.0001 | 0.1 | 100 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"metadata": { | |
"name": "2d Convolution" | |
}, | |
"nbformat": 3, | |
"nbformat_minor": 0, | |
"worksheets": [ | |
{ | |
"cells": [ | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"metadata": { | |
"name": "" | |
}, | |
"nbformat": 3, | |
"nbformat_minor": 0, | |
"worksheets": [ | |
{ | |
"cells": [ | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"metadata": { | |
"name": "" | |
}, | |
"nbformat": 3, | |
"nbformat_minor": 0, | |
"worksheets": [ | |
{ | |
"cells": [ | |
{ |
NewerOlder