Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
spark
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cs525-sp18-g07
spark
Commits
dfb15244
Commit
dfb15244
authored
11 years ago
by
Reynold Xin
Browse files
Options
Downloads
Patches
Plain Diff
Fixed SVDPlusPlusSuite in Maven build.
parent
74b46acd
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
graphx/src/test/resources/als-test.data
+16
-0
16 additions, 0 deletions
graphx/src/test/resources/als-test.data
graphx/src/test/scala/org/apache/spark/graphx/lib/SVDPlusPlusSuite.scala
+3
-7
3 additions, 7 deletions
.../scala/org/apache/spark/graphx/lib/SVDPlusPlusSuite.scala
with
19 additions
and
7 deletions
graphx/src/test/resources/als-test.data
0 → 100644
+
16
−
0
View file @
dfb15244
1,1,5.0
1,2,1.0
1,3,5.0
1,4,1.0
2,1,5.0
2,2,1.0
2,3,5.0
2,4,1.0
3,1,1.0
3,2,5.0
3,3,1.0
3,4,5.0
4,1,1.0
4,2,5.0
4,3,1.0
4,4,5.0
This diff is collapsed.
Click to expand it.
graphx/src/test/scala/org/apache/spark/graphx/lib/SVDPlusPlusSuite.scala
+
3
−
7
View file @
dfb15244
...
...
@@ -19,11 +19,7 @@ package org.apache.spark.graphx.lib
import
org.scalatest.FunSuite
import
org.apache.spark.SparkContext
import
org.apache.spark.SparkContext._
import
org.apache.spark.graphx._
import
org.apache.spark.graphx.util.GraphGenerators
import
org.apache.spark.rdd._
class
SVDPlusPlusSuite
extends
FunSuite
with
LocalSparkContext
{
...
...
@@ -31,16 +27,16 @@ class SVDPlusPlusSuite extends FunSuite with LocalSparkContext {
test
(
"Test SVD++ with mean square error on training set"
)
{
withSpark
{
sc
=>
val
svdppErr
=
8.0
val
edges
=
sc
.
textFile
(
"mllib/data
/als
/
test.data"
).
map
{
line
=>
val
edges
=
sc
.
textFile
(
getClass
.
getResource
(
"
/als
-
test.data"
).
getFile
).
map
{
line
=>
val
fields
=
line
.
split
(
","
)
Edge
(
fields
(
0
).
toLong
*
2
,
fields
(
1
).
toLong
*
2
+
1
,
fields
(
2
).
toDouble
)
}
val
conf
=
new
SVDPlusPlus
.
Conf
(
10
,
2
,
0.0
,
5.0
,
0.007
,
0.007
,
0.005
,
0.015
)
// 2 iterations
var
(
graph
,
u
)
=
SVDPlusPlus
.
run
(
edges
,
conf
)
graph
.
cache
()
val
err
=
graph
.
vertices
.
collect
.
map
{
case
(
vid
,
vd
)
=>
val
err
=
graph
.
vertices
.
collect
()
.
map
{
case
(
vid
,
vd
)
=>
if
(
vid
%
2
==
1
)
vd
.
_4
else
0.0
}.
reduce
(
_
+
_
)
/
graph
.
triplets
.
collect
.
size
}.
reduce
(
_
+
_
)
/
graph
.
triplets
.
collect
()
.
size
assert
(
err
<=
svdppErr
)
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment