(1) Mahout 0.7 is not supported anymore and u shouldn't be using it.
(2) To get ur code to compile with 0.9 remove the DistanceMeasure arguments
in ur call to KMeansDriver.run()
WeightedVectorWritable was replaced by WeightedPropertyVectorWritable
in 0.9.
So change the line of code to WeightedVectorWritable value = new
WeightedPropertyVectorWritable();
It would be helpful if u could post the compilation errors u r seeing
to better help u.
On Tue, Jun 17, 2014 at 3:24 AM, Aleksander Sadecki <
[email protected]> wrote:
> Hi,
>
> I was using Apache Mahout version 0.7 and I was using this piece of code:
>
> KMeansDriver.run(conf, new Path("testdata/points"), new
> Path("testdata/clusters"), output, new EuclideanDistanceMeasure(),0.001,
> 10, true, 0.0, false);
>
> Next, I was iterating in this way to see the results:
>
> SequenceFile.Reader reader = new SequenceFile.Reader(fs, new
> Path("output/" + Kluster.CLUSTERED_POINTS_DIR + "/part-m-00000"),conf);
>
> IntWritable key = new IntWritable();
> WeightedVectorWritable value = new WeightedVectorWritable();
>
> while (reader.next(key, value)) {
> value.getVector();
> // ...
> }
>
> I changed version from 0.7 to 0.9 and I have got compilation problems in
> lines:
>
> KMeansDriver.run(...
>
> and
>
> value.getVector(...
>
> Could you tell me how I can fix it?
>
> my pom.xml:
> <mahout.version>0.9</mahout.version>
> <mahout.groupid>org.apache.mahout</mahout.groupid>
>
> <dependency>
> <groupId>${mahout.groupid}</groupId>
> <artifactId>mahout-core</artifactId>
> <version>${mahout.version}</version>
> </dependency>
> <dependency>
> <groupId>${mahout.groupid}</groupId>
> <artifactId>mahout-core</artifactId>
> <type>test-jar</type>
> <scope>test</scope>
> <version>${mahout.version}</version>
> </dependency>
> <dependency>
> <groupId>${mahout.groupid}</groupId>
> <artifactId>mahout-math</artifactId>
> <version>${mahout.version}</version>
> </dependency>
> <dependency>
> <groupId>${mahout.groupid}</groupId>
> <artifactId>mahout-math</artifactId>
> <type>test-jar</type>
> <scope>test</scope>
> <version>${mahout.version}</version>
> </dependency>
> <dependency>
> <groupId>${mahout.groupid}</groupId>
> <artifactId>mahout-examples</artifactId>
> <version>${mahout.version}</version>
> </dependency>
>
> Thank you in advance
> Alex
>
>
>