原创 .py to .exe (by py2exe)

http://blog.sina.com.cn/s/blog_8811d2380101azrr.html 三、py2exe的用法如果你有一個名爲helloworld.py的python腳本,你想把它轉換爲運行在windows上的可執行程序

原创 主題模型是什麼、工作原理【基礎概念】※※※※※

轉自:http://blog.sina.com.cn/s/blog_9d7bca9f01015580.html 摘要: 兩篇文檔是否相關往往不只決定於字面上的詞語重複,還取決於文字背後的語義關聯。對語義關聯的挖掘,可以讓我們的搜索更

原创 Pearson+Cosine Similarity+K-Nearest Neighbor 代碼

這本書比較簡單,適合做推薦系統入門級讀物。作者寫的很仔細,一些複雜的公式都拆開講。 這是他的網站:http://guidetodatamining.com/ 一、通過用戶的相似度(最相似用戶)進行推薦。 主要有三種方式:1.距離 2.p

原创 LDA 【介紹】※※※

    轉自http://blog.csdn.net/huagong_adu/article/details/7937616    主題模型有兩種:pLSA(ProbabilisticLatent Semantic Analysis)

原创 Weighted Slope One (python實現)

chapter 3 (collabative filtering ) of 《guide to db》 slope one 算法比較簡單:1.先構造 collection of deviation(average deviation)  

原创 fp_growth

import collections min_support = 3 def sp(s): return [a for a in s] #==============================================

原创 Python中的easy_install

http://hi.baidu.com/thinkinginlamp/item/69cab949518d9aea1e19bcc1 如果想使用easy_install工具,可能需要先安裝setuptools,不過更酷的方法是使用ez_set

原创 generate prompt

level = 1 num = 70 if level==1: a = ' '*(level-1)*4+'#'+'-'*(num-1) else: a = ' '*(level-1)*4+'#'+'-'*(num-1) c

原创 pyTree(tree structure in python )

https://github.com/caesar0301/pyTree 例子(decision tree): class innerNode(Node): def __init__(self,attribute,parent_n

原创 python 優化

【總結】 優化python程序的流程(自頂向下): 1.先用cProfile找出最耗時的函數, 2.然後在這個函數前面加@profile 用line_profiler(+kernprof)找出最耗時的行, 3.最後用timeit測試下這個

原创 feature selection (互信息 去掉和類標籤無關特徵 + PCA)

http://www.cnblogs.com/jerrylead/archive/2011/04/18/2020209.html  真實的訓練數據總是存在各種各樣的問題: 1、[冗餘] 比如拿到一個汽車的樣本,裏面既有以“千米/每小時”

原创 推薦系統入門(協同過濾 基於內容 基於用戶 基於項目 )

http://blog.163.com/lnhenrylee@126/blog/static/2414832520123269713813/

原创 decison tree

__author__ = 'HM' from treelib import * import math import uuid #------------------------------------------------------

原创 naive bayesian classifier

__author__ = 'HM' f = open('data.txt','r') first_line = f.readline().split() attributes = first_line[:-1] attr_len = l

原创 basic apriori method

#===================================================================== # data and parameters