Weka 3.6.

43 views
Skip to first unread message

Nour Chetouane

unread,
Jun 21, 2022, 2:35:22 PM6/21/22
to python-we...@googlegroups.com
Hello again,

Sorry to spam you with so many emails,

I have a quick question; 
Does weka old version 3.6.14  include SelfOrganizingMap ? 

because the class is not found, maybe it was called something else or placed in another package than weka.clusterer.

Where can I find the exact packages of this old version of weka ? 

Thank you !

Nour Chetouane

unread,
Jun 21, 2022, 3:07:52 PM6/21/22
to python-we...@googlegroups.com
Is weka_3.6.14-1_all.deb the latest possible version to install on Ubuntu 18.04 ? 

How can I update to the latest version of weka like 3.8? 

Because I need to run SelfOrganizingMap but apparently it is not available in weka_3.6.14-1_all.deb

thank you 

Peter Reutemann

unread,
Jun 21, 2022, 4:59:30 PM6/21/22
to python-weka-wrapper
> I have a quick question;
> Does weka old version 3.6.14 include SelfOrganizingMap ?
>
> because the class is not found, maybe it was called something else or placed in another package than weka.clusterer.
>
> Where can I find the exact packages of this old version of weka ?

Support for Weka packages was introduced with 3.7.2 (developer), which
then forked into 3.8.x (stable) and 3.9.x (developer).
Older versions didn't have support for that (you needed to add the
appropriate jar files to your CLASSPATH).

SOMs were never part of the core Weka distribution, as far as I know.

Nowadays, you can use SOMs (as clustering algorithm) through the
3rd-party Weka package SelfOrganizingMap:
https://sourceforge.net/projects/wekann/files/SelfOrganizingMap/

Cheers, Peter
--
Peter Reutemann
Dept. of Computer Science
University of Waikato, NZ
+64 (7) 858-5174 (office)
+64 (7) 577-5304 (home office)
https://www.cs.waikato.ac.nz/~fracpete/
http://www.data-mining.co.nz/

Peter Reutemann

unread,
Jun 21, 2022, 5:03:17 PM6/21/22
to python-weka-wrapper
> Is weka_3.6.14-1_all.deb the latest possible version to install on Ubuntu 18.04 ?
>
> How can I update to the latest version of weka like 3.8?
>
> Because I need to run SelfOrganizingMap but apparently it is not available in weka_3.6.14-1_all.deb

The Weka team never made Debian packages of releases available, this
was done by another Debian maintainer for a while.

You can download the latest snapshot as Debian or Redhat package from
Weka's snapshot page:
https://www.cs.waikato.ac.nz/~ml/weka/snapshots/weka_snapshots.html

Peter Reutemann

unread,
Jun 21, 2022, 5:12:18 PM6/21/22
to python-weka-wrapper
> > Is weka_3.6.14-1_all.deb the latest possible version to install on Ubuntu 18.04 ?
> >
> > How can I update to the latest version of weka like 3.8?
> >
> > Because I need to run SelfOrganizingMap but apparently it is not available in weka_3.6.14-1_all.deb
>
> The Weka team never made Debian packages of releases available, this
> was done by another Debian maintainer for a while.
>
> You can download the latest snapshot as Debian or Redhat package from
> Weka's snapshot page:
> https://www.cs.waikato.ac.nz/~ml/weka/snapshots/weka_snapshots.html

BTW pww3 bundles 3.9.x already. So not sure why you want to install it
separately...

Nour Chetouane

unread,
Jun 22, 2022, 5:37:56 AM6/22/22
to python-we...@googlegroups.com
Hello, 

Thank you for your reply.
So, the environment on Oceancode that I am using is:  Ubunto 18.04 with Python 3.9. 
The latest version of  pww3 is 0.2.9.

This is what is installed in the docker file:

RUN apt-get update \
&& apt-get install -y --no-install-recommends \
build-essential=12.4ubuntu1 \
openjdk-8-jdk=8u312-b07-0ubuntu1~18.04 \
openjdk-8-jre=8u312-b07-0ubuntu1~18.04 \
python3-dev=3.6.7-1~18.04 \
python3-numpy=1:1.13.3-2ubuntu1 \
python3-pip=9.0.1-2.3~ubuntu1.18.04.5 \
python3-setuptools=39.0.1-2 \
python3-venv=3.6.7-1~18.04 \
python3-wheel=0.30.0-0.2 \
&& rm -rf /var/lib/apt/lists/*

RUN conda install -y \
conda==4.13.0 \
&& conda clean -ya
RUN conda install -y \
matplotlib==3.5.1 \
numpy==1.22.3 \
pandas==1.4.2 \
seaborn==0.11.2 \
&& conda clean -ya

RUN pip install -U --no-cache-dir \
arff==0.9

RUN pip3 install -U --no-cache-dir \
python-weka-wrapper3==0.2.9 \
sklearn-weka-plugin==0.0.6

When I try to run SelfOrganizingMap i get this error message:

Exception in thread "Thread-0" java.lang.ClassNotFoundException: weka.clusterers.SelfOrganizingMap
        java.net.URLClassLoader.findClass(URLClassLoader.java:387)
        java.lang.ClassLoader.loadClass(ClassLoader.java:418)
        sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
        java.lang.ClassLoader.loadClass(ClassLoader.java:351)
        java.lang.Class.forName0(Native Method)
        java.lang.Class.forName(Class.java:348)
        weka.core.WekaPackageClassLoaderManager.forName(WekaPackageClassLoaderManager.java:198)
        weka.core.WekaPackageClassLoaderManager.forName(WekaPackageClassLoaderManager.java:178)
        weka.core.ResourceUtils.forName(ResourceUtils.java:80)
        weka.core.Utils.forName(Utils.java:1112)

        at java.net.URLClassLoader.findClass(URLClassLoader.java:387)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:348)
        at weka.core.WekaPackageClassLoaderManager.forName(WekaPackageClassLoaderManager.java:198)
        at weka.core.WekaPackageClassLoaderManager.forName(WekaPackageClassLoaderManager.java:178)
        at weka.core.ResourceUtils.forName(ResourceUtils.java:80)
        at weka.core.Utils.forName(Utils.java:1112)
Failed to instantiate weka.clusterers.SelfOrganizingMap: weka.clusterers.SelfOrganizingMap
Traceback (most recent call last):
  File "/code/main.py", line 58, in <module>
    main()
  File "/code/main.py", line 32, in main
    Data_Clustering.main(Location)
  File "/code/Data_Clustering.py", line 80, in main
    clusterer = Clusterer(classname="weka.clusterers." + str(algorithm))
  File "/opt/conda/lib/python3.9/site-packages/weka/clusterers.py", line 56, in __init__
    self.is_updateable = self.check_type(jobject, "weka.clusterers.UpdateableClusterer")
  File "/opt/conda/lib/python3.9/site-packages/weka/core/classes.py", line 859, in check_type
    return is_instance_of(jobject, intf_or_class)
  File "/opt/conda/lib/python3.9/site-packages/weka/core/classes.py", line 286, in is_instance_of
    if is_array(obj):
  File "/opt/conda/lib/python3.9/site-packages/weka/core/classes.py", line 310, in is_array
    cls = javabridge.call(obj, "getClass", "()Ljava/lang/Class;")
  File "/opt/conda/lib/python3.9/site-packages/javabridge/jutil.py", line 888, in call
    fn = make_call(o, method_name, sig)
  File "/opt/conda/lib/python3.9/site-packages/javabridge/jutil.py", line 836, in make_call
    assert o is not None
AssertionError

Thank you for your help !
Remarque: I am living in Europe sorry if I am sending emails in non working times. 

--
You received this message because you are subscribed to the Google Groups "python-weka-wrapper" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python-weka-wra...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python-weka-wrapper/CAHoQ12%2BVj8%3Dnn6r7nxpo%3DfrYdwvJM7jbjm7O_7E4d-zQ3F5vdw%40mail.gmail.com.

Peter Reutemann

unread,
Jun 22, 2022, 6:15:15 AM6/22/22
to python-we...@googlegroups.com
You haven't actually installed the SelfOrganizingMap Weka package.

You need to COPY a Python script into the Docker container (which has instructions to install all required Weka packages using pww3) and then execute it.

A while ago, I wrote an intro to Docker, which might be useful if you're new to Docker:
https://www.data-mining.co.nz/docker-for-data-scientists/

Cheers, Peter
--
Peter Reutemann
Dept. of Computer Science
University of Waikato, NZ
+64 (7) 858-5174 (office)
+64 (7) 577-5304 (home office)

Nour Chetouane

unread,
Jun 22, 2022, 6:32:22 AM6/22/22
to python-we...@googlegroups.com
Thank you Peter, 
Can you please lead me to which Python script I need to copy exactly ? maybe you could send me  the link to it?

Peter Reutemann

unread,
Jun 22, 2022, 2:46:50 PM6/22/22
to python-we...@googlegroups.com
That pww3 script "you" need to write yourself, as it contains the instructions to install the packages that "you" need in your docker image.

Check the example on how to install.packages:

https://fracpete.github.io/python-weka-wrapper3/examples.html#packages

For reproducibility, you should specify the exact version:

https://fracpete.github.io/python-weka-wrapper3/weka.core.html?highlight=install_package#weka.core.packages.install_package

Cheers, Peter
--
Peter Reutemann
Dept. of Computer Science
University of Waikato, NZ
+64 (7) 858-5174 (office)
+64 (7) 577-5304 (home office)
http://www.cs.waikato.ac.nz/~fracpete/
http://www.data-mining.co.nz/

Jun 22, 2022 22:32:23 Nour Chetouane <nourche...@gmail.com>:

Nour Chetouane

unread,
Jun 22, 2022, 2:59:54 PM6/22/22
to python-we...@googlegroups.com
I tried this but it didn't work.
Thank you anyway.


Peter Reutemann

unread,
Jun 22, 2022, 3:05:04 PM6/22/22
to python-we...@googlegroups.com
What errors did you get?

Alternatively, download the zip files of the packages that you need, COPY them into the image and have your main pww3 script install the packages from these zip files within the image if they're not installed.

Cheers, Peter
--
Peter Reutemann
Dept. of Computer Science
University of Waikato, NZ
+64 (7) 858-5174 (office)
+64 (7) 577-5304 (home office)
http://www.cs.waikato.ac.nz/~fracpete/
http://www.data-mining.co.nz/

Jun 23, 2022 06:59:59 Nour Chetouane <nourche...@gmail.com>:

--
You received this message because you are subscribed to the Google Groups "python-weka-wrapper" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python-weka-wra...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python-weka-wrapper/CAAUzbZhtYonG8%2BXCDoEfAwf8N-y2nqhaYNeBY-OBDpon%2BMVJFQ%40mail.gmail.com.

--
You received this message because you are subscribed to the Google Groups "python-weka-wrapper" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python-weka-wra...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python-weka-wrapper/7feec691-1eba-4e86-827b-2d9140ef59ca%40gmail.com.

--
You received this message because you are subscribed to the Google Groups "python-weka-wrapper" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python-weka-wra...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python-weka-wrapper/CAAUzbZhiy9qyjx49kY_XLWGqjzFMPjxNYFC96dTtb1ez4fZprA%40mail.gmail.com.

--
You received this message because you are subscribed to the Google Groups "python-weka-wrapper" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python-weka-wra...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python-weka-wrapper/3d1bb90b-ffde-4402-9b98-40dc340a695f%40gmail.com.

--
You received this message because you are subscribed to the Google Groups "python-weka-wrapper" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python-weka-wra...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages