diff options
author | Joseph E. Gonzalez <joseph.e.gonzalez@gmail.com> | 2013-09-17 17:34:24 -0700 |
---|---|---|
committer | Joseph E. Gonzalez <joseph.e.gonzalez@gmail.com> | 2013-09-17 17:34:24 -0700 |
commit | a3fb29938cd61174785722054cc9331360ccccfe (patch) | |
tree | 291f330beda2019db474f2a28fc81b2eb9ffcfb3 /python/examples/als.py | |
parent | 205dba352f0905f77ce285aa1ad7e92f67681e4f (diff) | |
parent | 5ccb60d467f58c104f37e05e99a50fdf06301e5e (diff) | |
download | spark-a3fb29938cd61174785722054cc9331360ccccfe.tar.gz spark-a3fb29938cd61174785722054cc9331360ccccfe.tar.bz2 spark-a3fb29938cd61174785722054cc9331360ccccfe.zip |
Merging changes between Reynold's branch and Joey's modifications.
Diffstat (limited to 'python/examples/als.py')
-rwxr-xr-x | python/examples/als.py | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/python/examples/als.py b/python/examples/als.py index 010f80097f..a77dfb2577 100755 --- a/python/examples/als.py +++ b/python/examples/als.py @@ -1,3 +1,20 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + """ This example requires numpy (http://www.numpy.org/) """ @@ -31,8 +48,7 @@ def update(i, vec, mat, ratings): if __name__ == "__main__": if len(sys.argv) < 2: - print >> sys.stderr, \ - "Usage: PythonALS <master> <M> <U> <F> <iters> <slices>" + print >> sys.stderr, "Usage: als <master> <M> <U> <F> <iters> <slices>" exit(-1) sc = SparkContext(sys.argv[1], "PythonALS", pyFiles=[realpath(__file__)]) M = int(sys.argv[2]) if len(sys.argv) > 2 else 100 @@ -67,5 +83,5 @@ if __name__ == "__main__": usb = sc.broadcast(us) error = rmse(R, ms, us) - print "Iteration %d:" % i + print "Iteration %d:" % i print "\nRMSE: %5.4f\n" % error |