Skip to content

Commit f6739b0

Browse files
committed
Revise readme
1 parent 4c23484 commit f6739b0

File tree

3 files changed

+68
-1
lines changed

3 files changed

+68
-1
lines changed

.project

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>Spark</name>
4+
<comment></comment>
5+
<projects>
6+
<project>DataMining</project>
7+
</projects>
8+
<buildSpec>
9+
<buildCommand>
10+
<name>org.python.pydev.PyDevBuilder</name>
11+
<arguments>
12+
</arguments>
13+
</buildCommand>
14+
</buildSpec>
15+
<natures>
16+
<nature>org.python.pydev.pythonNature</nature>
17+
</natures>
18+
</projectDescription>

.pydevproject

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2+
<?eclipse-pydev version="1.0"?><pydev_project>
3+
<pydev_pathproperty name="org.python.pydev.PROJECT_SOURCE_PATH">
4+
<path>/${PROJECT_DIR_NAME}</path>
5+
</pydev_pathproperty>
6+
<pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python 2.7</pydev_property>
7+
<pydev_property name="org.python.pydev.PYTHON_PROJECT_INTERPRETER">python 2.7.13</pydev_property>
8+
</pydev_project>

ALS/README.md

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,42 @@
1-
#Spark
1+
## This is an implementation of Alternating Least Squares (ALS) algorithm in Spark with Python 2.7
2+
3+
## Algorithm: Alternating Least Squares (ALS) Algorithm
4+
5+
## Task:
6+
The task is to modify the parallel implementation of ALS (alternating least squares) algorithm in Spark, so that it takes a utility matrix as the input, and output the root-mean-square deviation (RMSE) into standard output or a file after each iteration. The code for the algorithm is als.py under the <spark-2.1.0 installation directory>/examples/src/main/python.
7+
8+
#### Usage: bin/spark-submit ALS.py input-matrix n m f k p [output-file]
9+
1. n is the number of rows (users) of the matrix
10+
11+
12+
2. m is the number of columns (products). 
13+
14+
15+
3. f is the number of dimensions/factors in the factor model. That is, U is n-by-f matrix, while V is f-by-m matrix.
16+
17+
18+
4. k is the number of iterations.
19+
20+
21+
5. p, which is the number of partitions for the input-matrix
22+
23+
6. output-file, which is the path to the output file. This parameter is optional.
24+
25+
26+
#### Input: Take a utility matrix (mat.dat) as the input
27+
28+
#### Output: Output root-mean-square deviation (RMSE) into standard output or a file after each iteration
29+
After each iteration, output RMSE with 4 floating points.
30+
The "%.4f" % RMSE is adapted to format the RMSE value, and save into file as follows.
31+
32+
1.0019
33+
34+
35+
0.9794
36+
37+
38+
0.8464
39+
40+
41+
42+

0 commit comments

Comments
 (0)