Trouble with weka-xgboost

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

Trouble with weka-xgboost

B. Smith
Hello,

Has anyone had success loading the “weka-xgboost” classifier?  I’m having a
lot of trouble with it.  I followed all the instructions to install the
XGBoost shared library and the Weka package from GitHub’s
SigDelta/weka-xgboost.  In Weka, however, when I select XGBoost under the
tree classifiers nothing happens.  The little bird jumps up and immediately
sits back down with no results generated.  I tried adding my C:\xgboost\lib\
to the system and user Paths.  I also tried copying the xgboost.dll file to
both the Weka application and the wekapackages\xgboost\ directories.
Nothing seems to work, though.

Thanks for any help you can provide.



--
Sent from: https://weka.8497.n7.nabble.com/
_______________________________________________
Wekalist mailing list -- [hidden email]
Send posts to [hidden email]
To unsubscribe send an email to [hidden email]
To subscribe, unsubscribe, etc., visit https://list.waikato.ac.nz/postorius/lists/wekalist.list.waikato.ac.nz
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html
Reply | Threaded
Open this post in threaded view
|

Re: Trouble with weka-xgboost

Eibe Frank-3
It looks like the weka-xgboost package needs to be updated.

The easiest option to run XGBoost in WEKA via an official package is via the MLRClassifier that comes as part of the RPlugin package. XGBoost is one of the available classifiers/regressors in MLR and can be selected from a menu when configuring MLRClassifier in the WEKA GUIs. Recently, intallation of the RPlugin has been greatly simplified and only requires R to be installed. All R libraries that are needed will be installed automatically.

In theory, another option is to install the wekaPython package and use the ScikitLearnClassifier to run XGBoost, but that package does not currently appear to be working with the latest version of the Python libraries. More specifically, a required module in pandas seems to have been removed (https://stackoverflow.com/questions/54473018/where-is-pandas-tools).

Cheers,
Eibe

On Sat, Aug 8, 2020 at 12:44 PM B. Smith <[hidden email]> wrote:
Hello,

Has anyone had success loading the “weka-xgboost” classifier?  I’m having a
lot of trouble with it.  I followed all the instructions to install the
XGBoost shared library and the Weka package from GitHub’s
SigDelta/weka-xgboost.  In Weka, however, when I select XGBoost under the
tree classifiers nothing happens.  The little bird jumps up and immediately
sits back down with no results generated.  I tried adding my C:\xgboost\lib\
to the system and user Paths.  I also tried copying the xgboost.dll file to
both the Weka application and the wekapackages\xgboost\ directories.
Nothing seems to work, though.

Thanks for any help you can provide.



--
Sent from: https://weka.8497.n7.nabble.com/
_______________________________________________
Wekalist mailing list -- [hidden email]
Send posts to [hidden email]
To unsubscribe send an email to [hidden email]
To subscribe, unsubscribe, etc., visit https://list.waikato.ac.nz/postorius/lists/wekalist.list.waikato.ac.nz
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html

_______________________________________________
Wekalist mailing list -- [hidden email]
Send posts to [hidden email]
To unsubscribe send an email to [hidden email]
To subscribe, unsubscribe, etc., visit https://list.waikato.ac.nz/postorius/lists/wekalist.list.waikato.ac.nz
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html
Reply | Threaded
Open this post in threaded view
|

Re: Trouble with weka-xgboost

Eibe Frank-2
Administrator
It turns out that the wekaPython package still works after all, and you can
run XGBoost through the ScikitLearnClassifier in that package too. I'm not
sure why it didn't work for me before; I just tried again and it works now.
Perhaps I forgot to restart WEKA after installing the wekaPython package.

Doing it this way rather than using the RPlugin is slightly more involved
because you need to manually install packages such as pandas in Python and
also manually install the XGBoost package in Python.

The error that I quoted only affects an example flow for the KnowledgeFlow
that comes with wekaPython. It needs to be fixed but has nothing to do with
the wekaPython functionality in general.

Cheers,
Eibe



--
Sent from: https://weka.8497.n7.nabble.com/
_______________________________________________
Wekalist mailing list -- [hidden email]
Send posts to [hidden email]
To unsubscribe send an email to [hidden email]
To subscribe, unsubscribe, etc., visit https://list.waikato.ac.nz/postorius/lists/wekalist.list.waikato.ac.nz
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html
Reply | Threaded
Open this post in threaded view
|

Re: Trouble with weka-xgboost

B. Smith
In reply to this post by Eibe Frank-3
Thanks, Eibe!  I'll try the RPlugin package.



--
Sent from: https://weka.8497.n7.nabble.com/
_______________________________________________
Wekalist mailing list -- [hidden email]
Send posts to [hidden email]
To unsubscribe send an email to [hidden email]
To subscribe, unsubscribe, etc., visit https://list.waikato.ac.nz/postorius/lists/wekalist.list.waikato.ac.nz
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html
Reply | Threaded
Open this post in threaded view
|

Re: Trouble with weka-xgboost

Michael Hall
In reply to this post by Eibe Frank-2


> On Aug 8, 2020, at 2:38 AM, Eibe Frank-2 <[hidden email]> wrote:
>
> It turns out that the wekaPython package still works after all, and you can
> run XGBoost through the ScikitLearnClassifier in that package too. I'm not
> sure why it didn't work for me before; I just tried again and it works now.
> Perhaps I forgot to restart WEKA after installing the wekaPython package.
>
> Doing it this way rather than using the RPlugin is slightly more involved
> because you need to manually install packages such as pandas in Python and
> also manually install the XGBoost package in Python.
>
> The error that I quoted only affects an example flow for the KnowledgeFlow
> that comes with wekaPython. It needs to be fixed but has nothing to do with
> the wekaPython functionality in general.
>
> Cheers,
> Eibe

For the original poster weka shows some errors for me on the GitHub XGBoost
Explorer gives me a dialog with “Problem evaluating classifier: null”
weka.log shows…
java.lang.Exception: Illegal options: -use_predictor false
        weka.core.Utils.checkForRemainingOptions(Utils.java:504)
        weka.classifiers.trees.XGBoost.setOptions(XGBoost.java:626)

Control-click doesn’t work to modify options. This appears like it might be an incomplete implementation?

( weka.log located at $user.home/wekafiles/weka.log - whatever $user.home might be on your computer)

The python interface sounded interesting. The interface covered in the mooc I don’t think supported things like numpy.
Unfortunately weka.log shows errors on that for me.

The python environment is either not available or is not configured correctly:

Library "sklearn" is not available
Library "pandas" is not available, minimum version = 0.7.0

I’m not all that python familiar but with some googling they do show as installed for me…
pip show scikit-learn
Name: scikit-learn
Version: 0.23.2
...
Location: /Users/mjh/anaconda3/lib/python3.7/site-packages

Pandas the same sort of information also anaconda already installed.

Does the Weka interface work with the anaconda installs?
I tried a little to figure out if I could do a local install outside of anaconda but without any success.

Looking at log even MLR seems to currently be having issues…
Did not find variable R_HOME in Java cache or process environment.
Setting R_HOME to /Library/Frameworks/R.framework/Resources
Did not find variable R_LIBS_USER in Java cache or process environment.
Found variable HOME with value /Users/mjh in Java cache of environment.
Setting R_LIBS_USER to /Users/mjh/Library/R/4.0/library
Found rJava installed in /Users/mjh/Library/R/4.0/library/rJava
Failed to fix up rJava.so.
Getting parent classloader....
Injecting JRI classes into the root class loader...
Found variable R_HOME with value /Library/Frameworks/R.framework/Resources in process environment.
Found variable R_LIBS_USER with value /Users/mjh/Library/R/4.0/library in process environment.
Found rJava installed in /Users/mjh/Library/R/4.0/library/rJava
Failed to fix up rJava.so.
2020-08-08 20:13:50 weka.experiment.DatabaseUtils initialize
WARNING: Trying to add database driver (JDBC): jdbc.idbDriver - Warning, not in CLASSPATH?
Found variable R_HOME with value /Library/Frameworks/R.framework/Resources in process environment.
Found variable R_LIBS_USER with value /Users/mjh/Library/R/4.0/library in process environment.
Found rJava installed in /Users/mjh/Library/R/4.

A little later…
Could not acquire R session in MLR classifier.


_______________________________________________
Wekalist mailing list -- [hidden email]
Send posts to [hidden email]
To unsubscribe send an email to [hidden email]
To subscribe, unsubscribe, etc., visit https://list.waikato.ac.nz/postorius/lists/wekalist.list.waikato.ac.nz
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html
Reply | Threaded
Open this post in threaded view
|

Re: Trouble with weka-xgboost

Eibe Frank-3
Is it possible that you are not using the latest version of the RPlugin? Some changes were necessary because rJava changed.

Try to install all the requested Python libraries using

pip install numpy

etc.

Maybe the MOOC only talks about Jython? That’s a version of Python that runs on the JVM. 

The wekaPython package uses the standard Python distribution installed on your system in the background.

Cheers,
Eibe

On Sun, 9 Aug 2020 at 1:52 PM, Michael Hall <[hidden email]> wrote:


> On Aug 8, 2020, at 2:38 AM, Eibe Frank-2 <[hidden email]> wrote:
>
> It turns out that the wekaPython package still works after all, and you can
> run XGBoost through the ScikitLearnClassifier in that package too. I'm not
> sure why it didn't work for me before; I just tried again and it works now.
> Perhaps I forgot to restart WEKA after installing the wekaPython package.
>
> Doing it this way rather than using the RPlugin is slightly more involved
> because you need to manually install packages such as pandas in Python and
> also manually install the XGBoost package in Python.
>
> The error that I quoted only affects an example flow for the KnowledgeFlow
> that comes with wekaPython. It needs to be fixed but has nothing to do with
> the wekaPython functionality in general.
>
> Cheers,
> Eibe

For the original poster weka shows some errors for me on the GitHub XGBoost
Explorer gives me a dialog with “Problem evaluating classifier: null”
weka.log shows…
java.lang.Exception: Illegal options: -use_predictor false
        weka.core.Utils.checkForRemainingOptions(Utils.java:504)
        weka.classifiers.trees.XGBoost.setOptions(XGBoost.java:626)

Control-click doesn’t work to modify options. This appears like it might be an incomplete implementation?

( weka.log located at $user.home/wekafiles/weka.log - whatever $user.home might be on your computer)

The python interface sounded interesting. The interface covered in the mooc I don’t think supported things like numpy.
Unfortunately weka.log shows errors on that for me.

The python environment is either not available or is not configured correctly:

Library "sklearn" is not available
Library "pandas" is not available, minimum version = 0.7.0

I’m not all that python familiar but with some googling they do show as installed for me…
pip show scikit-learn
Name: scikit-learn
Version: 0.23.2
...
Location: /Users/mjh/anaconda3/lib/python3.7/site-packages

Pandas the same sort of information also anaconda already installed.

Does the Weka interface work with the anaconda installs?
I tried a little to figure out if I could do a local install outside of anaconda but without any success.

Looking at log even MLR seems to currently be having issues…
Did not find variable R_HOME in Java cache or process environment.
Setting R_HOME to /Library/Frameworks/R.framework/Resources
Did not find variable R_LIBS_USER in Java cache or process environment.
Found variable HOME with value /Users/mjh in Java cache of environment.
Setting R_LIBS_USER to /Users/mjh/Library/R/4.0/library
Found rJava installed in /Users/mjh/Library/R/4.0/library/rJava
Failed to fix up rJava.so.
Getting parent classloader....
Injecting JRI classes into the root class loader...
Found variable R_HOME with value /Library/Frameworks/R.framework/Resources in process environment.
Found variable R_LIBS_USER with value /Users/mjh/Library/R/4.0/library in process environment.
Found rJava installed in /Users/mjh/Library/R/4.0/library/rJava
Failed to fix up rJava.so.
2020-08-08 20:13:50 weka.experiment.DatabaseUtils initialize
WARNING: Trying to add database driver (JDBC): jdbc.idbDriver - Warning, not in CLASSPATH?
Found variable R_HOME with value /Library/Frameworks/R.framework/Resources in process environment.
Found variable R_LIBS_USER with value /Users/mjh/Library/R/4.0/library in process environment.
Found rJava installed in /Users/mjh/Library/R/4.

A little later…
Could not acquire R session in MLR classifier.


_______________________________________________
Wekalist mailing list -- [hidden email]
Send posts to [hidden email]
To unsubscribe send an email to [hidden email]
To subscribe, unsubscribe, etc., visit https://list.waikato.ac.nz/postorius/lists/wekalist.list.waikato.ac.nz
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html

_______________________________________________
Wekalist mailing list -- [hidden email]
Send posts to [hidden email]
To unsubscribe send an email to [hidden email]
To subscribe, unsubscribe, etc., visit https://list.waikato.ac.nz/postorius/lists/wekalist.list.waikato.ac.nz
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html
Reply | Threaded
Open this post in threaded view
|

Re: Trouble with weka-xgboost

Michael Hall


> On Aug 9, 2020, at 1:31 AM, Eibe Frank <[hidden email]> wrote:
>
> Is it possible that you are not using the latest version of the RPlugin? Some changes were necessary because rJava changed.

This was the case. Updating RPlugin has fixed the MLR issues. I was able to do a XGBoost classification.

>
> Try to install all the requested Python libraries using
>
> pip install numpy

I’m pretty sure pandas and scikit-learn have this is a dependency and Anaconda has included them as well.

pip show numpy

Name: numpy
Version: 1.16.4
...
Location: /Users/mjh/anaconda3/lib/python3.7/site-packages


>
> etc.
>
> Maybe the MOOC only talks about Jython? That’s a version of Python that runs on the JVM.
>
> The wekaPython package uses the standard Python distribution installed on your system in the background.
>

Yes, I think Jython had limitations that severely limited it’s use for machine learning. The CPython implementation looks much more promising for that. It still seems to miss my Anaconda installed python packages though.
 
_______________________________________________
Wekalist mailing list -- [hidden email]
Send posts to [hidden email]
To unsubscribe send an email to [hidden email]
To subscribe, unsubscribe, etc., visit https://list.waikato.ac.nz/postorius/lists/wekalist.list.waikato.ac.nz
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html
Reply | Threaded
Open this post in threaded view
|

wekaPython package was Re: Re: Trouble with weka-xgboost

Michael Hall


On Aug 9, 2020, at 3:51 AM, Michael Hall <[hidden email]> wrote:

 It still seems to miss my Anaconda installed python packages though.


Looked a little bit at the wekaPython package and it seems to get some unexpected or incorrect results.

I did some testing with a modified weka/python/PythonSesssion

Initialization fails. It expects this 
return s_pythonEnvCheckResults.length() < 5;

But gets this back…
python version: 3.7.3

I set it to ignore errors, commented out the checks. There is a sklearn/pandas test later…

from sklearn import datasets
from pandas import DataFrame
diabetes = datasets.load_diabetes()
dd = DataFrame(diabetes.data)
row1 = dd.iloc[0]
v1 = row1[0]
print(v1)

Although in some places it shows…
Script error:

Since no actual error is indicated I think this is just an unused section header. Actual results I end up getting are…
Sending command: 
"{\"debug\":true,\"command\":\"execute_script\",\"script\":\"from sklearn import datasets\\nfrom pandas import DataFrame\\ndiabetes = datasets.load_diabetes()\\ndd = DataFrame(diabetes.data)\\nrow1 = dd.iloc[0]\\nv1 = row1[0]\\nprint(v1)\\n\"}"
Script output:
0.0380759064334241

Which seems correct?
The variable list later shows…
DataFrame:type
diabetes:Bunch
dd:DataFrame
row1:Series
v1:float64
x:int

Again for the sklearn/pandas part this seems correct. 
So the only error seems to actually be incorrectly expecting the result from the init script. Despite the errors indicated in log sklearn/pandas appear to be working?  

_______________________________________________
Wekalist mailing list -- [hidden email]
Send posts to [hidden email]
To unsubscribe send an email to [hidden email]
To subscribe, unsubscribe, etc., visit https://list.waikato.ac.nz/postorius/lists/wekalist.list.waikato.ac.nz
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html
Reply | Threaded
Open this post in threaded view
|

Re: wekaPython package was Re: Re: Trouble with weka-xgboost

Mark Hall

Have you modified the pyCheck.py script? The only way you could get a result of “python version: … “ is if you uncomment lines in pyCheck.main():

 

def main():

    pyVersion = sys.version_info

    # print('python version: ' + str(pyVersion[0]) + '.' + str(                                                                                                 

    #    pyVersion[1]) + '.' + str(pyVersion[2]))                                                                                                               

    check_libraries()

    print(global_results)

 

Cheers,

Mark.

 

On 10/08/20, 12:15 PM, "Michael Hall" <[hidden email]> wrote:

 

 



On Aug 9, 2020, at 3:51 AM, Michael Hall <[hidden email]> wrote:

 

 It still seems to miss my Anaconda installed python packages though.

 

 

Looked a little bit at the wekaPython package and it seems to get some unexpected or incorrect results.

 

I did some testing with a modified weka/python/PythonSesssion

 

Initialization fails. It expects this 

return s_pythonEnvCheckResults.length() < 5;

 

But gets this back…

python version: 3.7.3

 

I set it to ignore errors, commented out the checks. There is a sklearn/pandas test later…

 

from sklearn import datasets
from pandas import DataFrame
diabetes = datasets.load_diabetes()
dd = DataFrame(diabetes.data)
row1 = dd.iloc[0]
v1 = row1[0]
print(v1)

Although in some places it shows…

Script error:

Since no actual error is indicated I think this is just an unused section header. Actual results I end up getting are…

Sending command: 
"{\"debug\":true,\"command\":\"execute_script\",\"script\":\"from sklearn import datasets\\nfrom pandas import DataFrame\\ndiabetes = datasets.load_diabetes()\\ndd = DataFrame(diabetes.data)\\nrow1 = dd.iloc[0]\\nv1 = row1[0]\\nprint(v1)\\n\"}"
Script output:
0.0380759064334241

 

Which seems correct?

The variable list later shows…

DataFrame:type
diabetes:Bunch
dd:DataFrame
row1:Series
v1:float64
x:int

Again for the sklearn/pandas part this seems correct. 

So the only error seems to actually be incorrectly expecting the result from the init script. Despite the errors indicated in log sklearn/pandas appear to be working?  


_______________________________________________
Wekalist mailing list -- [hidden email]
Send posts to [hidden email]
To unsubscribe send an email to [hidden email]
To subscribe, unsubscribe, etc., visit https://list.waikato.ac.nz/postorius/lists/wekalist.list.waikato.ac.nz
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html
Reply | Threaded
Open this post in threaded view
|

Re: wekaPython package was Re: Re: Trouble with weka-xgboost

Michael Hall


On Aug 9, 2020, at 10:08 PM, Mark Hall <[hidden email]> wrote:

Have you modified the pyCheck.py script? The only way you could get a result of “python version: … “ is if you uncomment lines in pyCheck.main():
 
def main():
    pyVersion = sys.version_info
    # print('python version: ' + str(pyVersion[0]) + '.' + str(                                                                                                 
    #    pyVersion[1]) + '.' + str(pyVersion[2]))                                                                                                               
    check_libraries()
    print(global_results)
 

Sorry, I think I did. Let me comment those back out.


_______________________________________________
Wekalist mailing list -- [hidden email]
Send posts to [hidden email]
To unsubscribe send an email to [hidden email]
To subscribe, unsubscribe, etc., visit https://list.waikato.ac.nz/postorius/lists/wekalist.list.waikato.ac.nz
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html
Reply | Threaded
Open this post in threaded view
|

Re: wekaPython package was Re: Re: Trouble with weka-xgboost

Michael Hall


On Aug 10, 2020, at 6:16 AM, Michael Hall <[hidden email]> wrote:



On Aug 9, 2020, at 10:08 PM, Mark Hall <[hidden email]> wrote:

Have you modified the pyCheck.py script? The only way you could get a result of “python version: … “ is if you uncomment lines in pyCheck.main():
 
def main():
    pyVersion = sys.version_info
    # print('python version: ' + str(pyVersion[0]) + '.' + str(                                                                                                 
    #    pyVersion[1]) + '.' + str(pyVersion[2]))                                                                                                               
    check_libraries()
    print(global_results)
 

Sorry, I think I did. Let me comment those back out.


I had also noticed there was a new release of the package and installed that. Wiped out what I had in the directory. If I run it’s main now
 as-is now I don’t get the version error. The PythonSession included sklearn/pandas test also works. However, weka.log is still showing…
Library "sklearn" is not available
Library "pandas" is not available, minimum version = 0.7.0
Also the sklearn classifier doesn’t show as selectable. 
Maybe something other than PythonSession is indicating these errors?


_______________________________________________
Wekalist mailing list -- [hidden email]
Send posts to [hidden email]
To unsubscribe send an email to [hidden email]
To subscribe, unsubscribe, etc., visit https://list.waikato.ac.nz/postorius/lists/wekalist.list.waikato.ac.nz
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html
Reply | Threaded
Open this post in threaded view
|

Re: wekaPython package was Re: Re: Trouble with weka-xgboost

Mark Hall

I have Anaconda python 3.7.3 installed on my Mac laptop and do not see these problems. Are you using conda environments? I’m not sure that the wekaPython package works with environments. I’ve always used just the base environment with Anaconda.

 

Cheers,

Mark.

 

On 10/08/20, 11:32 PM, "Michael Hall" <[hidden email]> wrote:

 

 



On Aug 10, 2020, at 6:16 AM, Michael Hall <[hidden email]> wrote:

 

 



On Aug 9, 2020, at 10:08 PM, Mark Hall <[hidden email]> wrote:

 

Have you modified the pyCheck.py script? The only way you could get a result of “python version: … “ is if you uncomment lines in pyCheck.main():

 

def main():

    pyVersion = sys.version_info

    # print('python version: ' + str(pyVersion[0]) + '.' + str(                                                                                                 

    #    pyVersion[1]) + '.' + str(pyVersion[2]))                                                                                                               

    check_libraries()

    print(global_results)

 

 

Sorry, I think I did. Let me comment those back out.

 

 

I had also noticed there was a new release of the package and installed that. Wiped out what I had in the directory. If I run it’s main now

 as-is now I don’t get the version error. The PythonSession included sklearn/pandas test also works. However, weka.log is still showing…

Library "sklearn" is not available
Library "pandas" is not available, minimum version = 0.7.0

Also the sklearn classifier doesn’t show as selectable. 

Maybe something other than PythonSession is indicating these errors?

 


_______________________________________________
Wekalist mailing list -- [hidden email]
Send posts to [hidden email]
To unsubscribe send an email to [hidden email]
To subscribe, unsubscribe, etc., visit https://list.waikato.ac.nz/postorius/lists/wekalist.list.waikato.ac.nz
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html
Reply | Threaded
Open this post in threaded view
|

Re: wekaPython package was Re: Re: Trouble with weka-xgboost

Michael Hall


On Aug 10, 2020, at 6:45 PM, Mark Hall <[hidden email]> wrote:

I have Anaconda python 3.7.3 installed on my Mac laptop and do not see these problems. Are you using conda environments? I’m not sure that the wekaPython package works with environments. I’ve always used just the base environment with Anaconda.
 

No I’m not doing environments yet. Not doing much with Anaconda lately. I guess I’ll see if I can actually splice my own debug PythonSession into the jar so Explorer picks it up. It looked like the python batch init script that’s used by PythonSession is the only place you can get those errors. You don’t get them as indicated previously by executing PythonSession directly. 


_______________________________________________
Wekalist mailing list -- [hidden email]
Send posts to [hidden email]
To unsubscribe send an email to [hidden email]
To subscribe, unsubscribe, etc., visit https://list.waikato.ac.nz/postorius/lists/wekalist.list.waikato.ac.nz
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html
Reply | Threaded
Open this post in threaded view
|

Re: wekaPython package was Re: Re: Trouble with weka-xgboost

Michael Hall


On Aug 10, 2020, at 6:52 PM, Michael Hall <[hidden email]> wrote:



On Aug 10, 2020, at 6:45 PM, Mark Hall <[hidden email]> wrote:

I have Anaconda python 3.7.3 installed on my Mac laptop and do not see these problems. Are you using conda environments? I’m not sure that the wekaPython package works with environments. I’ve always used just the base environment with Anaconda.
 

No I’m not doing environments yet. Not doing much with Anaconda lately. I guess I’ll see if I can actually splice my own debug PythonSession into the jar so Explorer picks it up. It looked like the python batch init script that’s used by PythonSession is the only place you can get those errors. You don’t get them as indicated previously by executing PythonSession directly. 


Not working but maybe some head way. I modified the batch script to show version as discussed earlier…
From Explorer...
sys.version_info(major=2, minor=7, micro=16, releaselevel='final', serial=0)

PythonSession directly executed…
 sys.version_info(major=3, minor=7, micro=3, releaselevel='final', serial=0)

Also my Anaconda version

This might be similar…

I tried switching the python command as suggested to a hardcoded Anaconda one. 

This got past the missing sklearn/pandas issues but failed to start the server showing this in weka.log…

weka.core.WekaException: Was unable to start python server
weka.python.PythonSession.initSession(PythonSession.java:599)
weka.gui.PythonPanel.<init>(PythonPanel.java:464)
weka.gui.explorer.PythonExplorerPanel.setup(PythonExplorerPanel.java:62)
weka.gui.explorer.PythonExplorerPanel.setExplorer(PythonExplorerPanel.java:74)

I haven’t looked to see if I can determine what causes that yet.

Why you may not have the same issue with Anaconda…
Did you have a prior python 2 version installed without pandas/sklearn?
Are you on OS X?



_______________________________________________
Wekalist mailing list -- [hidden email]
Send posts to [hidden email]
To unsubscribe send an email to [hidden email]
To subscribe, unsubscribe, etc., visit https://list.waikato.ac.nz/postorius/lists/wekalist.list.waikato.ac.nz
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html
Reply | Threaded
Open this post in threaded view
|

Re: wekaPython package was Re: Re: Trouble with weka-xgboost

Mark Hall

Yes, I’m using OSX. I assume you are starting Weka from the Mac application (rather than the terminal). It looks like Weka is using the default pre-installed python 2.7 in this case.

 

Recent versions of Anaconda have become more complex than they used to be. It used to be that just having the python executable in your PATH was sufficient. These days, Anaconda inserts startup code in your .profile that sets up your PATH with additional entries. Mine has the following:

 

# added by Anaconda3 2019.07 installer

# >>> conda init >>>

# !! Contents within this block are managed by 'conda init' !!

__conda_setup="$(CONDA_REPORT_ERRORS=false '/Users/mhall/anaconda3/bin/conda' shell.bash hook 2> /dev/null)"

if [ $? -eq 0 ]; then

    \eval "$__conda_setup"

else

    if [ -f "/Users/mhall/anaconda3/etc/profile.d/conda.sh" ]; then

        . "/Users/mhall/anaconda3/etc/profile.d/conda.sh"

        CONDA_CHANGEPS1=false conda activate base

    else

        \export PATH="/Users/mhall/anaconda3/bin:$PATH"

    fi

fi

unset __conda_setup

# <<< conda init <<<

 

This results in the first part of my PATH looking like:

 

/Users/mhall/anaconda3/bin:/Users/mhall/anaconda3/condabin

 

There are further entries added by Anaconda when running under Windows.

 

Cheers,

Mark.

 

 

On 11/08/20, 2:05 PM, "Michael Hall" <[hidden email]> wrote:

 

 



On Aug 10, 2020, at 6:52 PM, Michael Hall <[hidden email]> wrote:

 

 



On Aug 10, 2020, at 6:45 PM, Mark Hall <[hidden email]> wrote:

 

I have Anaconda python 3.7.3 installed on my Mac laptop and do not see these problems. Are you using conda environments? I’m not sure that the wekaPython package works with environments. I’ve always used just the base environment with Anaconda.

 

 

No I’m not doing environments yet. Not doing much with Anaconda lately. I guess I’ll see if I can actually splice my own debug PythonSession into the jar so Explorer picks it up. It looked like the python batch init script that’s used by PythonSession is the only place you can get those errors. You don’t get them as indicated previously by executing PythonSession directly. 

 

 

Not working but maybe some head way. I modified the batch script to show version as discussed earlier…

From Explorer...

sys.version_info(major=2, minor=7, micro=16, releaselevel='final', serial=0)

 

PythonSession directly executed…

 sys.version_info(major=3, minor=7, micro=3, releaselevel='final', serial=0)

Also my Anaconda version

 

This might be similar…

 

I tried switching the python command as suggested to a hardcoded Anaconda one. 

 

This got past the missing sklearn/pandas issues but failed to start the server showing this in weka.log…

 

weka.core.WekaException: Was unable to start python server
weka.python.PythonSession.initSession(PythonSession.java:599)
weka.gui.PythonPanel.<init>(PythonPanel.java:464)
weka.gui.explorer.PythonExplorerPanel.setup(PythonExplorerPanel.java:62)
weka.gui.explorer.PythonExplorerPanel.setExplorer(PythonExplorerPanel.java:74)

 

I haven’t looked to see if I can determine what causes that yet.

 

Why you may not have the same issue with Anaconda…

Did you have a prior python 2 version installed without pandas/sklearn?

Are you on OS X?

 

 


_______________________________________________
Wekalist mailing list -- [hidden email]
Send posts to [hidden email]
To unsubscribe send an email to [hidden email]
To subscribe, unsubscribe, etc., visit https://list.waikato.ac.nz/postorius/lists/wekalist.list.waikato.ac.nz
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html
Reply | Threaded
Open this post in threaded view
|

Re: wekaPython package was Re: Re: Trouble with weka-xgboost

Michael Hall


On Aug 10, 2020, at 10:12 PM, Mark Hall <[hidden email]> wrote:

Yes, I’m using OSX. I assume you are starting Weka from the Mac application (rather than the terminal). It looks like Weka is using the default pre-installed python 2.7 in this case.

Yes doing some terminal testing to try and figure out why it wasn’t working. But I would almost always run from the application.
My bash profile is identical to yours even to the installer date. I’m not sure applications pick up user bash profile env variables like Terminal does?

The code seems a bit touchy. It just started working a bit ago. I had left it at getting the server error. I tried chasing that down. All of a sudden it just started working. Could even do the SKLearn classifier. I started backing out my minor debug changes until I thought I had it back to unchanged. Still working. Just to be sure I reinstalled from the repository. The application didn’t work, original no pandas/sklearn errors.
I just tried from Terminal how I had been app testing…
/Applications/weka-3-9-3-corretto-jvm.app/Contents/MacOS/JavaAppLauncher

And it worked again. Maybe this way does honor the user bash profile with all the Anaconda settings? Anyhow right now it appears it doesn’t work for me with a normal app launch but does with a Terminal app launch as shown.
 


_______________________________________________
Wekalist mailing list -- [hidden email]
Send posts to [hidden email]
To unsubscribe send an email to [hidden email]
To subscribe, unsubscribe, etc., visit https://list.waikato.ac.nz/postorius/lists/wekalist.list.waikato.ac.nz
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html
Reply | Threaded
Open this post in threaded view
|

Re: Trouble with weka-xgboost

B. Smith
In reply to this post by Eibe Frank-2
I will.  Thanks, again.



--
Sent from: https://weka.8497.n7.nabble.com/
_______________________________________________
Wekalist mailing list -- [hidden email]
Send posts to [hidden email]
To unsubscribe send an email to [hidden email]
To subscribe, unsubscribe, etc., visit https://list.waikato.ac.nz/postorius/lists/wekalist.list.waikato.ac.nz
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html