Re: XGBoost Installation
Prakash Bhagat <[email protected]>
| Newsgroups | gmane.comp.ai.weka |
|---|---|
| Message-ID | <CAOSMTW1X+67_rpoOQezWVL-ZQqrc9dMiHT-3QBgeiZt86LLj5g@mail.gmail.com> |
Thanks so much for this! For your first point, how do I set a minimum number of boosting iterations? I have looked within the MLR classifier setting however see no option for min iterations. If I use a cost matrix in the classifier then under more options for test I should create the same confusion matrix, correct? Kind regards, Prakash On Sat, Jun 5, 2021 at 12:56 PM Eibe Frank <[email protected]> wrote: > The default number of iterations used by XGBoost when applied through the > RPlugin is 1. You definitely need to increase the number of boosting > iterations. I would also switch the CostSensitiveClassifier to use the > minimum-expected cost approach, not the default approach based on > reweighting the training data. > > Of course, you should also specify the same cost matrix for evaluation > under "More options..." in the Classify tab. > > The following configuration worked well in a quick try on the sonar data > from the UCI repository: > > weka.classifiers.meta.CostSensitiveClassifier -cost-matrix "[0.0 5.0; 1.0 > 0.0]" -M -W weka.classifiers.mlr.MLRClassifier -- -learner classif.xgboost > -params nrounds=100,max_depth=3,subsample=0.5,colsample_bynode=0.5 > > You can right-click on the text field containing the classifier > configuration in the Classify panel and paste the above configuration into > the Explorer (assuming you have a dataset with only two classes, it should > work). > > The reason for using the minimum-expected cost mode of the > CostSensitiveClassifier is that it does not change the training data. The > default mode of the CostSensitiveClassifier uses instance weights in the > training data to reflect costs. I don't know how well that works in > conjunction with MLRClassifier. > > Cheers, > Eibe > > On Sat, Jun 5, 2021 at 11:33 PM Prakash Bhagat < > [email protected]> wrote: > >> Thanks very much, >> >> I have managed to get windows access and followed the tutorial on youtube >> for downloading the rplugin. I am using xgboost as a classification method >> and comparing it to random forests. Random forest gives an accuracy of 75% >> whereas XGBoost gives an accuracy of only 52%. I was wondering if you could >> help me as i may have made some errors when implementing xgboost. >> I have attached the data used. I filled in missing values for revol_util >> and converted nominal features to binary when using xgboost. >> I then used the costsensitiveclassifier with a 5 to 1 cost for false >> positives and used 5 fold cross-validation. Following this, I used >> mlrclassifier and used classif.xgboost under Rlearner. >> I will do hyper parameter tuning after but was wandering if i had made a >> mistake with xgboost as the accuracy is so low. >> Any help would be much appreciated! >> >> Kind regards, >> Prakash >> >> On Sat, Jun 5, 2021 at 4:16 AM Eibe Frank <[email protected]> wrote: >> >>> You cannot set environment variables, etc., in WEKA's built-in CLI, >>> which is really quite primitive and only pretends to be a proper OS >>> terminal! You need to run the command in the macOS terminal. However, as I >>> said, you should not set R_HOME explicitly unless you have installed R in a >>> non-standard location. WEKA's RPlugin will find R on the Mac if it is >>> installed in the standard place. >>> >>> Cheers, >>> Eibe >>> >>> On Sat, Jun 5, 2021 at 1:43 PM Prakash Bhagat < >>> [email protected]> wrote: >>> >>>> Yes, I have followed this guide: >>>> https://riptutorial.com/weka/topic/7916/how-to-use-r-in-weka >>>> I pasted this in the command line in WEKA: export >>>> R_HOME=/Library/Frameworks/R.framework/Resources >>>> java -Xss10M -Xmx4096M -cp .:weka.jar weka.gui.GUIChooser >>>> >>>> And this is the error from weka: >>>> >>>> Kind regards, >>>> Prakash >>>> >>>> >>>> >>>> On 04 Jun,2021, at 13:52, Eibe Frank <[email protected]> wrote: >>>> >>>> Are you still running WEKA with R_HOME set to some value? It is >>>> normally best to let WEKA set the value of R_HOME itself. >>>> >>>> If there are any error messages shown in the terminal from which you >>>> run WEKA, it would be useful to share those. >>>> >>>> Cheers, >>>> Eibe >>>> >>>> On Fri, Jun 4, 2021 at 11:43 PM Prakash Bhagat < >>>> [email protected]> wrote: >>>> >>>>> https://github.com/SigDelta/weka-xgboost/releases - This is the link >>>>> I used to download xgboost. >>>>> Using this downloaded I installed xgboost as an unofficial package in >>>>> tools. It then comes under trees however does not run. >>>>> >>>>> With the RPlugin the MLR classifier is unavailable to use. I have >>>>> downloaded a new version of R and within R I also downloaded the MLR >>>>> package. This still however does not run. >>>>> I have installed rJava within R as well. >>>>> <Screenshot 2021-06-04 at 11.51.31.png> >>>>> >>>>> On 04 Jun,2021, at 11:07, Eibe Frank <[email protected]> wrote: >>>>> >>>>> Which unofficial version do you mean? Both, RPlugin and wekaPython, >>>>> are official packages, and both enable you to use XGBoost. With the >>>>> RPlugin, you need to use XGBoost through the MLRClassifier and select >>>>> XGBoost as the base learner (the first time you select this base learner, >>>>> it will try to install it in R, which may take a while). Similarly, with >>>>> wekaPython, you also need to use the corresponding ScikitLearnClassifier in >>>>> WEKA with XGBoost as the base learner (and you need to have XGBoost >>>>> installed in your relevant Python environment, which you may need to do >>>>> manually). >>>>> >>>>> The easiest way to use XGBoost in WEKA is probably through the RPlugin >>>>> because the only manual work you (normally) need to do is to install R. >>>>> >>>>> There might be an unofficial WEKA package for XGBoost out there, but >>>>> it may not be maintained. >>>>> >>>>> Cheers, >>>>> Eibe >>>>> >>>>> >>>>> On Fri, Jun 4, 2021 at 4:49 PM <[email protected]> wrote: >>>>> >>>>>> Dear All, >>>>>> >>>>>> I have a mac with the latest version of R and python installed. I am >>>>>> using WEKA for an assignment and need to use XGBoost. >>>>>> I have tried downloading the unofficial version as a package however >>>>>> that does not work. >>>>>> I then tried the R Plugin version downloading RPlugin and pasting >>>>>> this in the command line in WEKA: >>>>>> export R_HOME=/Library/Frameworks/R.framework/Resources >>>>>> java -Xss10M -Xmx4096M -cp .:weka.jar weka.gui.GUIChoose >>>>>> >>>>>> This however did not work either and R does not run. >>>>>> >>>>>> If anyone has a very specific step-by-step guide to getting XGBoost >>>>>> on macOS please let me know! >>>>>> >>>>>> Kind regards, >>>>>> PYB >>>>>> _______________________________________________ >>>>>> Wekalist mailing list -- [email protected] >>>>>> Send posts to [email protected] >>>>>> To unsubscribe send an email to [email protected] >>>>>> 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 -- [email protected] >>>>> Send posts to [email protected] >>>>> To unsubscribe send an email to [email protected] >>>>> 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 -- [email protected] >>>>> Send posts to [email protected] >>>>> To unsubscribe send an email to [email protected] >>>>> 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 -- [email protected] >>>> Send posts to [email protected] >>>> To unsubscribe send an email to [email protected] >>>> 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 -- [email protected] >>>> Send posts to [email protected] >>>> To unsubscribe send an email to [email protected] >>>> 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 -- [email protected] >>> Send posts to [email protected] >>> To unsubscribe send an email to [email protected] >>> 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 -- [email protected] >> Send posts to [email protected] >> To unsubscribe send an email to [email protected] >> 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 -- [email protected] > Send posts to [email protected] > To unsubscribe send an email to [email protected] > 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 -- [email protected] Send posts to [email protected] To unsubscribe send an email to [email protected] 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
Screenshot 2021-06-04 at 14.02.40.png
(image/png, 299 KB) - not displayed