Skip to content

Commit

Permalink
Added more examples
Browse files Browse the repository at this point in the history
  • Loading branch information
sramirez committed May 25, 2015
1 parent e8da5f2 commit 3e2bbe5
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
22 changes: 22 additions & 0 deletions examples/FStest.scala
@@ -0,0 +1,22 @@
package examples
import org.apache.spark.SparkContext
import org.apache.spark.SparkConf
import org.apache.spark.mllib.regression.LabeledPoint
import org.apache.spark.mllib.util.MLUtils
import org.apache.spark.mllib.linalg.Vectors
import java.util.ArrayList
import org.apache.spark.mllib.feature._

object FStest {
def main(args: Array[String]): Unit = {
val initStartTime = System.nanoTime()
val conf = new SparkConf().setAppName("FS test")
val sc = new SparkContext(conf)
val data = MLUtils.loadLibSVMFile(sc, "a2a.libsvm")
val selector = MrmrSelector.train(data)
val redData = data.map { lp =>
LabeledPoint(lp.label, selector.transform(lp.features))
}
println(redData.first().toString())
}
}
6 changes: 6 additions & 0 deletions examples/fast-mrmr
@@ -0,0 +1,6 @@
!#/bin/bash

cd fast-mRMR/cpu/src
make
chmod +x fast-mrmr
./fast-mrmr -f ../data.mrmr -n 50

0 comments on commit 3e2bbe5

Please sign in to comment.