在矩阵分解中, 有类问题比较常见,即矩阵的元素只有0和1, 对应实际应用中的场景是:用户对新闻的点击情况,对某些物品的购买情况等。基于graphchi里面的矩阵分解结果不太理想,调研了下相关的文献,代码主要实现了基于PLSA的分解方法,详细请参考后面的参考文献
#!/usr/local/bin/python
#-*-coding:utf-8-*-
import sys
import math...
分类:
其他好文 时间:
2014-07-26 02:11:06
阅读次数:
259
最终效果图:
BeyondViewController.h
//
// BeyondViewController.h
// 8_scrollVIew分页浏览
//
// Created by beyond on 14-7-25.
// Copyright (c) 2014年 com.beyond. All rights reserved.
//
#import
...
分类:
移动开发 时间:
2014-07-26 02:11:03
阅读次数:
173
参考服务器安装的是Centos 系统。
uwsgi是使用pip安装的。
nginx是使用yum install nginx安装。
python 2.7, mysql 5.5使用 yum安装。
它们之间的逻辑关系如下:
the web client the web server the socket uwsgi Django
uswgi负责从D...
分类:
其他好文 时间:
2014-07-26 02:10:06
阅读次数:
336
用python 对Java代码做单元测试,怎么导入第三方包...
分类:
编程语言 时间:
2014-07-26 02:02:36
阅读次数:
322
最好的方法是:初始化4*3的二维数组a = [[0 for col in xrange(3)] for row in xrange(4)]而不可以用:a = [[0]*3]*4[0]*3是生成一个一维数组,再*4只是会复制出三个引用,当修改a[0][0]时,其他的三个引用的值也会发生改变,故这种方法...
分类:
编程语言 时间:
2014-07-26 01:50:56
阅读次数:
247
原文:http://baoz.me/446252 码农周刊如何让 Python 代码运行得更快?作者给出了 18 条 Python 代码性能优化小贴士,简单明了,拿来即用。http://infiniteloop.in/blog/quick-python-performance-optimizatio...
分类:
编程语言 时间:
2014-07-26 01:44:36
阅读次数:
648
Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its path.N...
分类:
其他好文 时间:
2014-07-26 01:42:16
阅读次数:
263
sys.argv[]:用于获取命令行参数,sys.argv[0]即所运行的代码自身的文件路径,因此真正的其他参数是从1开始sys.argv[1]:表示第一个参数sys.argv[1][2:]:表示第二个参数,从第三个字符开始以下为演示程序:cat.py 1 # -*-coding:gb2312-*-...
分类:
编程语言 时间:
2014-07-26 01:41:06
阅读次数:
218
Subsets IIGiven a collection of integers that might contain duplicates,S, return all possible subsets.Note:Elements in a subset must be in non-descend...
分类:
其他好文 时间:
2014-07-26 01:40:06
阅读次数:
178
Given a collection of numbers, return all possible permutations.For example, [1,2,3] have the following permutations: [1,2,3], [1,3,2], [2,1,3], [2,3,...
分类:
其他好文 时间:
2014-07-26 01:38:56
阅读次数:
214