Skip to content

Instantly share code, notes, and snippets.

import org.apache.spark.ml.feature.{CountVectorizer, RegexTokenizer, StopWordsRemover}
import org.apache.spark.mllib.clustering.{LDA, OnlineLDAOptimizer}
import org.apache.spark.mllib.linalg.Vector
import sqlContext.implicits._
val numTopics: Int = 100
val maxIterations: Int = 100
val vocabSize: Int = 10000

Keybase proof

I hereby claim:

  • I am feynmanliang on github.
  • I am feynman (https://keybase.io/feynman) on keybase.
  • I have a public key ASDISK0rUZWGgEO6xCKFhIoLWMFM9iReGIYlgD0YZukZBAo

To claim this, I am signing this object:

[
{
"action": "talk",
"text": "Please wait while we connect you."
},
{
"action": "connect",
"timeout": 20,
"from": "12015100650",
"endpoint": [

Do you even read these?

Keybase proof

I hereby claim:

  • I am feynmanliang on github.
  • I am feynman (https://keybase.io/feynman) on keybase.
  • I have a public key ASCNE3Hd3sTW9NIXdtB7kYN566UbsrJ3BEe9GVNH-BoCgQo

To claim this, I am signing this object:

import org.apache.http.client.methods.HttpGet
import org.apache.http.impl.client.{BasicResponseHandler, HttpClientBuilder}
import org.apache.spark.mllib.fpm.PrefixSpan
// sequence database
val sequenceDatabase = {
val url = "http://www.philippe-fournier-viger.com/spmf/datasets/SIGN.txt"
val client = HttpClientBuilder.create().build()
val request = new HttpGet(url)
val response = client.execute(request)

[SPARK-10478] SoftmaxFunction.eval Benchmarks Before/After PR 8648

Num Examples Num Classes Before Average Runtime (ms) After Average Runtime (ms)
1000 5 5.3315174999999995 0.4096546
1000 50 6.7308793 4.1289975
1000 250 21.5866622 21.25164
10000 5 4.2153461 4.145396
10000 50 42.2423785 41.0198213
10000 250 215.2192236 208.61861249999998
100000 5 43.517224899999995 41.2843315
# SPECIFICATION:
#
# check_sudoku() determines whether its argument is a valid Sudoku
# grid. It can handle grids that are completely filled in, and also
# grids that hold some empty cells where the player has not yet
# written numbers.
#
# First, your code must do some sanity checking to make sure that its
# argument:
#
@feynmanliang
feynmanliang / calendar.java
Created March 8, 2012 22:24
Quick calendar hack-up for friend
import java.util.Scanner;
public class calendar {
// initialize static scanned
public static Scanner input = new Scanner(System.in);
public static void main(String[] args) {
int month = getMonth();
int year = getYear();
@feynmanliang
feynmanliang / Solution.java
Created February 23, 2012 01:22
csfall11-insertionsort
/*
Please write complete compilable code.
Your class should be named Solution
Read input from standard input (STDIN) and print output to standard output(STDOUT).
For more details, please check http://www.interviewstreet.com/recruit/challenges/faq/view#stdio
*/
import java.util.Scanner;
public class Solution {