#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

Reply via email to