I'm new here, but I just wanted to add that Scala is extremely cool. I've moved to Scala wherever possible in my work. It's really nice, and well worth effort to learn. Scala has put the joy back into programming.
Instead of trying to call Scala from Java, perhaps you might enjoy writing your stuff in Scala. On Fri, Sep 12, 2014 at 11:53 AM, Pat Ferrel <[email protected]> wrote: > #1 I’m glad to see someone using this. I haven’t tried calling Scala from > Java and would expect a fair amount of difficulty with it. Scala constructs > objects to deal with its new features (anonymous functions, traits, > implicits) and you have to guess at what those will look like to java. > Maybe you could try the Scala community. > > Intellij will auto convert java to scala when you paste it into a .scala > file. For some reason yours doesn’t seem to work but I’ve seen it work > pretty well. > > I started to convert your code and it pointed out a bug in mine, a bad > value in the default schema. I’d be interested in helping with this as a > way to work out the kinks in creating drivers. > > Are you interested in this or are you set on using java? Either way I’ll > post a gist of your code using the MahoutDriver as the template and > converted to Scala. It’ll take me a few minutes. > > On Sep 12, 2014, at 6:46 AM, Frank Scholten <[email protected]> > wrote: > > Hi all, > > Trying out the new spark-itemsimilarity code, but I am new to Scala and > have hard time calling certain methods from Java. > > Here is a Gist with a Java main that runs the cooccurrence analysis: > > https://gist.github.com/frankscholten/d373c575ad721dd0204e > > When I run this I get an exception: > > Exception in thread "main" java.lang.NoSuchMethodError: > > org.apache.mahout.drivers.TextDelimitedIndexedDatasetReader.readElementsFrom(Ljava/lang/String;Lcom/google/common/collect/BiMap;)Lorg/apache/mahout/drivers/IndexedDataset; > > What do I have to do here to use the Scala readers from Java? > > Cheers, > > Frank > >
