Skip to content

Commit

Permalink
style changes
Browse files Browse the repository at this point in the history
  • Loading branch information
rezazadeh committed Mar 20, 2014
1 parent 9a56a02 commit 4ce6caa
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ object SparkPCA {
System.err.println("Usage: SparkPCA <master> m n")
System.exit(1)
}
val sc = new SparkContext(args(0), "SVD",
System.getenv("SPARK_HOME"), Seq(System.getenv("SPARK_EXAMPLES_JAR")))
val sc = new SparkContext(args(0), "PCA",
System.getenv("SPARK_HOME"), SparkContext.jarOfClass(this.getClass))

val m = args(2).toInt
val n = args(3).toInt

// Make example matrix
val data = Array.tabulate(m, n){ (a, b) =>
val data = Array.tabulate(m, n) { (a, b) =>
(a + 2).toDouble * (b + 1) / (1 + a + b) }

// recover top principal component
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ object SparkSVD {
System.exit(1)
}
val sc = new SparkContext(args(0), "SVD",
System.getenv("SPARK_HOME"), Seq(System.getenv("SPARK_EXAMPLES_JAR")))
System.getenv("SPARK_HOME"), SparkContext.jarOfClass(this.getClass))

// Load and parse the data file
val data = sc.textFile(args(1)).map { line =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import org.jblas.{DoubleMatrix, Singular, MatrixFunctions}
* Class used to obtain principal components
*/
class PCA {
private var k: Int = 1
private var k = 1

/**
* Set the number of top-k principle components to return
Expand Down
6 changes: 3 additions & 3 deletions mllib/src/main/scala/org/apache/spark/mllib/linalg/SVD.scala
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ import org.jblas.{DoubleMatrix, Singular, MatrixFunctions}
* Class used to obtain singular value decompositions
*/
class SVD {
private var k: Int = 1
private var computeU: Boolean = true
private var rCond: Double = 1e-9
private var k = 1
private var computeU = true
private var rCond = 1e-9

/**
* Set the number of top-k singular vectors to return
Expand Down

0 comments on commit 4ce6caa

Please sign in to comment.