This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pyspark import SparkContext, SparkConf | |
from pyspark.sql import SQLContext | |
conf = SparkConf() | |
conf.setMaster("local[4]") | |
conf.setAppName("Spark Cassandra") | |
conf.set("spark.cassandra.connection.host","127.0.0.1") | |
sc = SparkContext(conf=conf) | |
sqlContext = SQLContext(sc) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
print("hello") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import numpy as np | |
import keras | |
import keras.preprocessing.text as kpt | |
from keras.preprocessing.text import Tokenizer | |
from keras.models import model_from_json | |
# we're still going to use a Tokenizer here, but we don't need to fit it | |
tokenizer = Tokenizer(num_words=3000) | |
# for human-friendly printing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
print("hello") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MySplit { | |
public static String[] mySplit(String text, String delimiter) { | |
java.util.List<String> parts = new java.util.ArrayList<String>(); | |
text += delimiter; | |
for (int i = text.indexOf(delimiter), j=0; i != -1;) { | |
String temp = text.substring(j,i); | |
if(temp.trim().length() != 0) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.datumbox.framework.common.Configuration; | |
import com.datumbox.framework.common.dataobjects.Dataframe; | |
import com.datumbox.framework.common.dataobjects.Record; | |
import com.datumbox.framework.core.machinelearning.classification.SoftMaxRegression; | |
import com.datumbox.framework.core.machinelearning.topicmodeling.LatentDirichletAllocation; | |
import com.datumbox.framework.core.utilities.text.extractors.UniqueWordSequenceExtractor; | |
import java.io.UncheckedIOException; |