mahout-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sean Owen <sro...@gmail.com>
Subject Re: Creating Multinomial Random numbers with Mahout
Date Fri, 04 Sep 2009 16:23:02 GMT
Just look at the org.apache.mahout.matrix.Vector interface? should be
pretty clear. Like with the java.util.Vector interface the 'set'
operation necessarily needs a position argument!

probabilities.set(0, 0.2);
probabilities.set(1, 0.1);
...


On Fri, Sep 4, 2009 at 5:18 PM, Sven Boekhoff<sven@boekhoff.info> wrote:
> It solved the first part of my question. i do not know how to create a
> vector.
> I tried e.g.:
>
> Vector probabilities = new Vector();
>
> //to then set the values like:
>
> probabilities.set((double) 0.1);
> probabilities.set((double) 0.2);
> probabilities.set((double) 0.3);
> probabilities.set((double) 0.4);
>
> But eclipse shows an error (but does not say what is wrong). I do not know
> how to use interfaces. Obviously I can't use it as if it was a class.
>
> Should be easy,... somehow.

Mime
View raw message