A question about Apache Mahout API

classic Classic list List threaded Threaded
21 messages Options
12
Reply | Threaded
Open this post in threaded view
|

A question about Apache Mahout API

seyfullahd
When I try to do a matrix multiplication job (their sizes are appropriate for multiplication, both of them is a reference of DoubleMatrix2D but different types of instances in runtime as it can be seen in exception log), I am getting an exception as:

"java.lang.ClassCastException: org.apache.mahout.math.matrix.impl.SelectedDenseDoubleMatrix2D cannot be cast to org.apache.mahout.math.matrix.impl.DenseDoubleMatrix2D
        at org.apache.mahout.math.matrix.impl.DenseDoubleMatrix2D.zMult(DenseDoubleMatrix2D.java:580)"

Do you have an idea of how to fix it?

Thanks in advance.

Seyfullah
Reply | Threaded
Open this post in threaded view
|

Re: A question about Apache Mahout API

Dawid Weiss-2
Not really -- make sure you don't have two different versions of
Mahout math on classpath (so that class version conflicts can be ruled
out). If this isn't the case then this looks like a bug in Mahout (or
in that particular version which we use).

Dawid

On Wed, Jul 10, 2013 at 10:23 PM, seyfullahd <[hidden email]> wrote:

> When I try to do a matrix multiplication job (their sizes are appropriate for
> multiplication, both of them is a reference of DoubleMatrix2D but different
> types of instances in runtime as it can be seen in exception log), I am
> getting an exception as:
>
> "java.lang.ClassCastException:
> org.apache.mahout.math.matrix.impl.SelectedDenseDoubleMatrix2D cannot be
> cast to org.apache.mahout.math.matrix.impl.DenseDoubleMatrix2D
>         at
> org.apache.mahout.math.matrix.impl.DenseDoubleMatrix2D.zMult(DenseDoubleMatrix2D.java:580)"
>
> Do you have an idea of how to fix it?
>
> Thanks in advance.
>
> Seyfullah
>
>
>
> --
> View this message in context: http://carrot2-users-and-developers-forum.607571.n2.nabble.com/A-question-about-Apache-Mahout-API-tp7578181.html
> Sent from the Carrot2 Users and Developers Forum mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> See everything from the browser to the database with AppDynamics
> Get end-to-end visibility with application monitoring from AppDynamics
> Isolate bottlenecks and diagnose root cause in seconds.
> Start your free trial of AppDynamics Pro today!
> http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
> _______________________________________________
> Carrot2-developers mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/carrot2-developers
>

------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
Carrot2-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/carrot2-developers
Reply | Threaded
Open this post in threaded view
|

Re: A question about Apache Mahout API

seyfullahd
Thanks Dawid,

I checked the classpath, and it's ok.

It must be a bug in Mahout as you said. And the later version mahout-math-0.7.jar is not compatible since org/apache/mahout/math/matrix package is completely removed :(

I created an issue for this situation in Mahout's Jira (https://issues.apache.org/jira/browse/MAHOUT-1283).

Unfortunately, I would not be able to complete my very last experiments until the bug is fixed, and I think it is not so close :) Poor me :)
Reply | Threaded
Open this post in threaded view
|

Re: A question about Apache Mahout API

Dawid Weiss-2
Mahout is open source -- grab the sources of that version and fix the bug! :)

Dawid

On Thu, Jul 11, 2013 at 10:22 PM, seyfullahd <[hidden email]> wrote:

> Thanks Dawid,
>
> I checked the classpath, and it's ok.
>
> It must be a bug in Mahout as you said. And the later version
> mahout-math-0.7.jar is not compatible since org/apache/mahout/math/matrix
> package is completely removed :(
>
> I created an issue for this situation in Mahout's Jira
> (https://issues.apache.org/jira/browse/MAHOUT-1283).
>
> Unfortunately, I would not be able to complete my very last experiments
> until the bug is fixed, and I think it is not so close :) Poor me :)
>
>
>
> --
> View this message in context: http://carrot2-users-and-developers-forum.607571.n2.nabble.com/A-question-about-Apache-Mahout-API-tp7578181p7578186.html
> Sent from the Carrot2 Users and Developers Forum mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> See everything from the browser to the database with AppDynamics
> Get end-to-end visibility with application monitoring from AppDynamics
> Isolate bottlenecks and diagnose root cause in seconds.
> Start your free trial of AppDynamics Pro today!
> http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
> _______________________________________________
> Carrot2-developers mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/carrot2-developers
>

------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
Carrot2-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/carrot2-developers
Reply | Threaded
Open this post in threaded view
|

Re: A question about Apache Mahout API

seyfullahd
JIRA dawid.weiss@cs.put.poznan.pl wrote
Mahout is open source -- grab the sources of that version and fix the bug! :)

Dawid
Yess!, thank God it is :) Thank you for encouraging me :)

Good evening!

Seyfullah
Reply | Threaded
Open this post in threaded view
|

Re: A question about Apache Mahout API

ted.dunning
This post has NOT been accepted by the mailing list yet.

DoubleMatrix2D is part of the old Colt library and is completely superseded by the various implementations of Matrix.

You should move to the 0.8 version of Mahout (currently in the release process).
Reply | Threaded
Open this post in threaded view
|

Re: A question about Apache Mahout API

ted.dunning
This post has NOT been accepted by the mailing list yet.
In reply to this post by seyfullahd
Ah...

You will get much quicker answers on the Mahout mailing list.
Reply | Threaded
Open this post in threaded view
|

Re: A question about Apache Mahout API

seyfullahd
Hi Ted,

Thanks for answering. I have new questions if you're still reading here.

First, where and how can I get the jar of 0.8 version of Mahout?

And the second, when I move to it, could I be able to use the old DoubleMatrix2D references, or would i need to refactor to the new API?

Thanks

Seyfullah
Reply | Threaded
Open this post in threaded view
|

Re: A question about Apache Mahout API

seyfullahd
And I asked this question in here, because it was firstly related to here. I have to say that, I am getting very very quick and helpful answers :)

I also thank you for your interest, if I can't get answers for this question here,  I will definitely try asking it in Mahout mailing list also.

Seyfullah
Reply | Threaded
Open this post in threaded view
|

Re: A question about Apache Mahout API

ted.dunning

On Thu, Jul 11, 2013 at 3:45 PM, seyfullahd [via Carrot2 Users and Developers Forum] <[hidden email]> wrote:
I also thank you for your interest, if I can't get answers for this question here,  I will definitely try asking it in Mahout mailing list also.

Well, I certainly will help here, but the fact that I found out about your question at all is just luck.

To get a Mahout 0.8 jar, you need to compile it yourself (until about a week from now).

And, yes, I would recommend you switch to the Mahout API.  Very little code will need to change (if any) other than the types and constructor calls.  The DenseMatrix is closest to what you are using now.

Reply | Threaded
Open this post in threaded view
|

Re: A question about Apache Mahout API

Dawid Weiss-2
If you can bring the code in Carrot2 up to speed with the most recent
version of Mahout, Seyfullah, it'd be an even better contribution!
This doesn't mean to dodge the cast (?) bug in Mahout entirely, but
there have been many improvements to Mahout libraries over the course
of time and an upgrade is scheduled anyway. So if you have a patch
already why not submit it ;)

Dawid

On Fri, Jul 12, 2013 at 4:48 AM, ted.dunning <[hidden email]> wrote:

>
> On Thu, Jul 11, 2013 at 3:45 PM, seyfullahd [via Carrot2 Users and
> Developers Forum] <[hidden email]> wrote:
>>
>> I also thank you for your interest, if I can't get answers for this
>> question here,  I will definitely try asking it in Mahout mailing list also.
>
>
> Well, I certainly will help here, but the fact that I found out about your
> question at all is just luck.
>
> To get a Mahout 0.8 jar, you need to compile it yourself (until about a week
> from now).
>
> And, yes, I would recommend you switch to the Mahout API.  Very little code
> will need to change (if any) other than the types and constructor calls.
> The DenseMatrix is closest to what you are using now.
>
>
> ________________________________
> View this message in context: Re: A question about Apache Mahout API
>
> Sent from the Carrot2 Users and Developers Forum mailing list archive at
> Nabble.com.
>
> ------------------------------------------------------------------------------
> See everything from the browser to the database with AppDynamics
> Get end-to-end visibility with application monitoring from AppDynamics
> Isolate bottlenecks and diagnose root cause in seconds.
> Start your free trial of AppDynamics Pro today!
> http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
> _______________________________________________
> Carrot2-developers mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/carrot2-developers
>

------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
Carrot2-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/carrot2-developers
Reply | Threaded
Open this post in threaded view
|

Re: A question about Apache Mahout API

seyfullahd
JIRA dawid.weiss@cs.put.poznan.pl wrote
If you can bring the code in Carrot2 up to speed with the most recent
version of Mahout, Seyfullah, it'd be an even better contribution!
This doesn't mean to dodge the cast (?) bug in Mahout entirely, but
there have been many improvements to Mahout libraries over the course
of time and an upgrade is scheduled anyway. So if you have a patch
already why not submit it ;)

Dawid
If I figure it out, I will. Promise :)
I'll be glad if I can make such a contribution!

Seyfullah
Reply | Threaded
Open this post in threaded view
|

Re: A question about Apache Mahout API

seyfullahd
In reply to this post by ted.dunning
ted.dunning wrote
To get a Mahout 0.8 jar, you need to compile it yourself (until about a
week from now).

And, yes, I would recommend you switch to the Mahout API.  Very little code
will need to change (if any) other than the types and constructor calls.
 The DenseMatrix is closest to what you are using now.
Thank you Ted,

I am gonna try it.

Seyfullah
Reply | Threaded
Open this post in threaded view
|

Re: A question about Apache Mahout API

seyfullahd
In reply to this post by ted.dunning
ted.dunning wrote
To get a Mahout 0.8 jar, you need to compile it yourself (until about a
week from now).
From the git repository I can get the Mahout 0.8 tagged code, but since I am not so familiar with Maven projects, I am not being able to build the jar in a short time.

Moreover, in Apache jenkins build server I can get the Mahout 0.9 snapshot jar, but I couldn't get Mahout 0.8's jar.

Can someone please help me as getting Mahout 0.8's jar, its source jar and javadocs if it is not so difficult for those who know how to do it. If not, can someone please help me to generate those artifacts quicker.

Thanks in advance

Seyfullah

Reply | Threaded
Open this post in threaded view
|

Re: A question about Apache Mahout API

Dawid Weiss-2
Here you go:

# get the tagged revision
svn checkout http://svn.apache.org/repos/asf/mahout/tags/mahout-0.8
cd mahout-0.8

# download and install maven 3. I have maven 3.0.3
mvn clean package -DskipTests=true

# you'll get the target JAR in:
# ./math/target/mahout-math-0.8.jar

For development in Eclipse I'd recommend reading README.txt, specifically:

To setup your ide run 'mvn eclipse:eclipse' or 'mvn idea:idea'

And then import "an existing project" into workspace.

Dawid

On Fri, Jul 12, 2013 at 5:46 PM, seyfullahd <[hidden email]> wrote:

> ted.dunning wrote
>> To get a Mahout 0.8 jar, you need to compile it yourself (until about a
>> week from now).
>
> >From the git repository I can get the Mahout 0.8 tagged code, but since I am
> not so familiar with Maven projects, I am not being able to build the jar in
> a short time.
>
> Moreover, in Apache jenkins build server I can get the Mahout 0.9 snapshot
> jar, but I couldn't get Mahout 0.8's jar.
>
> Can someone please help me as getting Mahout 0.8's jar, its source jar and
> javadocs if it is not so difficult for those who know how to do it. If not,
> can someone please help me to generate those artifacts quicker.
>
> Thanks in advance
>
> Seyfullah
>
>
>
>
>
> --
> View this message in context: http://carrot2-users-and-developers-forum.607571.n2.nabble.com/A-question-about-Apache-Mahout-API-tp7578181p7578202.html
> Sent from the Carrot2 Users and Developers Forum mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> See everything from the browser to the database with AppDynamics
> Get end-to-end visibility with application monitoring from AppDynamics
> Isolate bottlenecks and diagnose root cause in seconds.
> Start your free trial of AppDynamics Pro today!
> http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
> _______________________________________________
> Carrot2-developers mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/carrot2-developers
>

------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
Carrot2-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/carrot2-developers
Reply | Threaded
Open this post in threaded view
|

Re: A question about Apache Mahout API

seyfullahd
Thank you Dawid,

You are definitely a life saver :)

I followed your instructions, it can succesfully build mahout-math-0.8.jar, but after that it started to build "Building Mahout Core 0.8"  which I dont know what it is and failed :) Probably, we won't need it, but I could not be sure.

When I try it further times, I also started to make an impact analysis about what parts of the code will change and how they should be changed. I already completed it on class level but not started to operation level. I saw that the the possible change is not a little change and will require testing, and also I am in a restricted time. I have to complete my last experiments and finish preparing a proceeding for a conference whose submission deadline is on 25 July in order to be graduated :) Then, I thought for a while for alternative workaround solutions and the idea come to my mind: Instead of the bugged multiplication, multiply the second matrix's transpose with first matrix's transpose, and get the transpose of the result :)  When I investigate the Mahout 0.6 sources I saw this will compile and work :) For now, I choosed this solution.

But, even if now I could not contribute, I am looking forward to be able to contribute in some way to Carrot2 code. If I have some spare time after I completed writing the paper, and if you don't move to Mahout 0.8 yet on that time, maybe still I can contribute :)

And a paragraph of my first impressions for new version Mahout:

* I am not sure, but I think they combined collections into mahout-math.jar
* 1D matrixes are gone and vectors come instead.
* Matrix classes becomes better implemented, preventing such cast exceptions in multiplication processing :)
* Functions classes remains with same names.

Thank you very much.

Seyfullah

Reply | Threaded
Open this post in threaded view
|

Re: A question about Apache Mahout API

ted.dunning

On Sat, Jul 13, 2013 at 6:14 AM, seyfullahd [via Carrot2 Users and Developers Forum] <[hidden email]> wrote:
* I am not sure, but I think they combined collections into mahout-math.jar

This is correct.

Reply | Threaded
Open this post in threaded view
|

Re: A question about Apache Mahout API

seyfullahd
It would be great if toString methods were implemented for debugging purposes for especially matrix and vector classes :) Carrot API for instance serves such toString methods which are really helpful when somebody needs debugging.
Reply | Threaded
Open this post in threaded view
|

Re: A question about Apache Mahout API

Dawid Weiss-2
> but after that it started to build "Building Mahout Core 0.8"  which I dont
> know what it is and failed :)

Always include a description of what exactly failed (the error string,
exception?). This build passed for me so I guess it's something on
your side.

> It would be great if toString methods were implemented for debugging purposes
> for especially matrix and vector classes :)

I think they are implemented in the head branch of Mahout.

Dawid

------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
Carrot2-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/carrot2-developers
Reply | Threaded
Open this post in threaded view
|

Re: A question about Apache Mahout API

seyfullahd
JIRA dawid.weiss@cs.put.poznan.pl wrote
> but after that it started to build "Building Mahout Core 0.8"  which I dont
> know what it is and failed :)

Always include a description of what exactly failed (the error string,
exception?). This build passed for me so I guess it's something on
your side.
I'm sorry, you are right. It is not important anymore, but the reason why it failed was that it could not download some files (jars as far I remember).  I thought maybe they didn't upload them right or I was not allowed to download that files.

Seyfullah

------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
Carrot2-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/carrot2-developers
12