I am using Weka Explorer to do a SMOTE oversampling of my training data. The file format is libsvm compatible. It's loaded. Everything looks fine. But when I select filter->supervised learning->SMOTE, and choose the default settings. Then I should press "apply" to start sampling, but the problem is that the "apply" button is gray, disabled. I can't do it.
What might cause this? Really thanks for any information.
The data format I loaded in Weka Exlporer is this:
-1 1:-1.0 2:-1.0 3:-1.0 4:-1.0 5:-1.0 6:-1.0 7:0.5 8:0.0043 9:0.0063 10:1.0
1 1:-1.0 2:-1.0 3:1.0 4:-1.0 5:-1.0 6:1.0 7:0.5 8:0.0028 9:0.0028 10:3.0
This is the format LIBSVM accepts. Wekta allows libsvm format. Right?
Related
This feels like it should be possible. But I've not managed to find out how just yet.
To achieve this via the desktop application it's simple;
Use the Arrange > Insert > Advanced > CSV option
Diagram generated
Export to HTML or SVG
Open up in Chrome
I want to achieve this programmatically because the data that is entered as part of Step 1 will be created on the fly.
Not possible at time of writing - https://github.com/jgraph/drawio-desktop/issues/591
Update
"this was recently fixed since v20.7.4 (github.com/jgraph/drawio-desktop/issues/…) –
Exodus 4D"
Based on the answer to this question, I was able to get 2-column papaja with listings wrapping (rather than overflowing column width). But the listings package turns off various features that help code listings and R output stand out relative to the main text.
A simple solution would be if I could globally change the font faces and/or sizes selectively for code and R output. Is there a way to do that in papaja? I haven't been able to figure this out from papaja or Rmarkdown documentation. Thank you!
When you use the listings package in a papaja (or bookdown) document, what is technically happening is that all code is wrapped into an lstlisting LaTeX environment that comes with its own capabilities of customizing code appearance. Hence, you don't see the syntax highlighting that you would otherwise see if you would not use the listings package. The documentation of the listings package with instructions how to style your code can be found here.
To make use of this, you can extend the YAML header of your papaja document like this:
documentclass : "apa6"
classoption : "jou"
output :
papaja::apa6_pdf:
pandoc_args: --listings
header-includes:
- \lstset{breaklines=true,language=R,basicstyle=\tiny\ttfamily,frame=trB,commentstyle=\color{darkgray}\textit}
Here, I first specify the code's language, and use a tiny monospace font. With frame, I add a frame around the code block, and with commentstyle I set comments in italic and gray.
I am using Workbook gem to preview the excel file without page breaks in my website. Right now, I am successful in extracting the excel file and writing it into html format and display as preview.
The following code extracts and writes the excel to html:
excel_file = Workbook::Book.open "#{file_url}"
excel_file.write_to_html(file_name + ".html")
But this gives me an unformatted html sheet with no rows and columns or any of the existing excel file.
According to murb/workbook documentation, it is said that we can pass the format as a hash within its options.
write_to_html(filename = "#{title}.html", options = {})
So, to achieve the format hash, I tried the following code:
excel_file.template.formats
But this returns a null hash. So, how can i get all the formats from the excel file and write to html? Or at least show the html table with borders for all rows and columns.
The author here. The Workbook gem is mainly built to extract and rerepresent the data in files, and not so much the formatting. In the past I made a few attempts on adding support to maintain formatting when converting, but it is far from complete. Some importers don't even set the formatting hash as you found out, notably the xlsx importer needs work on this.
The HTML was built to simply give a basic preview of the data. It basically returns a html-page with all tables which is by default unformatted, although format-names are used in the classes. There is an option though, if you'd pass style_with_inline_css: true... but then it requires an importer to actually set the format hash properly...
I'm happy to guide you here and there when you want to improve the xlsx importer code to suit your needs and hopefully the workbook gem in general, but it will need serious work if you want more than just some background colours and font properties.
Running some random code I found on the internet a few weeks ago has changed the pagesize and linesize defaults of my SAS output window. I don't remember what code it was though unfortunately. The current default pagesize is 15, which is generally way too small.
Does anyone know how to change the default?
I can change this using "options pagesize=80" or something but that only lasts for the current session. I can also change it in the GUI from Tools>Options>Output>Display but any changes won't save to my next session.
Any tips would be much appreciated! This is kind of excruciating. Thanks!
Your editor preferences are stored in a SAS catalog. Only 1 SAS session can open/write to this catalog at a single time. You can find out the location of the catalog that your SAS session is using by running this code:
proc options;run;
... And then search for SASUSER in the log.
If you launch SAS and it tries to use a SASUSER catalog that is already in use by another session, it will give you the message:
WARNING: Unable to copy SASUSER registry to WORK registry. Because of this,
WARNING: you will not see registry customizations during this session.
Are you seeing this message when you launch SAS? If so, it means that you have another instance of SAS open on your machine that has that catalog open. You have 2 options:
Close all instances of sas.exe on your machine (via task manager, be sure to check process names, not just the applications tab) then try making the change again.
Setup another shortcut to launch sas.exe. On this shortcut, specify a different SASUSER location like so:
sas.exe -SASUSER "d:\sas\profile2.cfg"
Also, I'm assuming you have the option to 'Save settings on exit' checked. Or if this isn't the case you can save your current settings by typing the command save into the command bar.
EDIT :
Some additional places to check that may override any profile settings:
Your sasv9.cfg file. Again, run proc options;run; and search for sasv9.cfg. It will give you the location of this file. If the file simply contains a list of other filenames, be sure to open up those 'included' files and check those.
Your autoexec file. If your SAS environment is specifying an autoexec file to load at launch, make sure it's not adjusting them there. Also if it is using an autoexec file, make sure you have all the loggin options turned on as the first thing that happens when SAS loads: option mprint notes source source2;.
Try right-clicking on SAS and choose 'Launch as Admininstrator'. If your profile is in a read-only location due to priveleges, perhaps your settings aren't being saved.
Look in your windows event log to see if SAS is loggin any errors there.
According to the SAS for Windows documentation, pagesize is controlled in part by the default printer. 15 is the minimum value, so it's possible that there is something wrong with your default printer and/or SAS is doing something odd (such as not finding one). If 'some random code' changed your default printer, you could simply try changing it back (see your SYSPRINT option).
I believe you can override this in your sasv9.cfg, commonly located in a path like C:\Program Files\SAS\SAS Foundation\9.4\nls\en\sasv9.cfg (varying based on what language version of SAS you use and your version, plus installation details), by simply adding -pagesize=80 or whatever you wish the default to be. You also can add options pagesize=80; to your autoexec.sas (or a new autoexec.sas if you don't have one already); see this paper or the documentation for more details on that.
I am using GUI version of WEKA and I am classifying using the Naive Bayes. Can anyone please let me know how to find out which instances are misclassified.
Go to classify tab in Weka explorer
Click more options...
Check output predictions
Click OK
Hope that helps.
I faced this very same problem earlier and I tackle it just fine now.
What I do, is the following:
Make one String attribute that assigns each instance a unique ID. I
have assigned the names of the documents to each of my instances.
Generate the WEKA supported .arff file.
Whenever you have to run a classifier on this .arff data, you will notice that you have to exclude the Instance ID attribute. If you don't do this, Weka will pop-up an error saying that the classifier cannot process String attributes. Instead of excluding, run filter StringToNominal on the InstanceID.
Now, as said by #Rushdi, click "More Options" on the classify tab.
Check Output predictions on the "Classifier Evaluation Options" pop-up.
Enter the Attribute number of the Instance ID in the "Output additional attributes" box.
Run the classifier on the whole data, excluding the Instance ID attribute. (Most classifiers have this as an option called "StartSet" in "Ranker" for example which I use along with SMO classifier.)
If you've done everything properly so far, you will see all the instances listed along with their real and predicted output values and also the Instance ID which can tell you exactly which documents were incorrectly classified.
Hope this helps someone.
Good Luck!
In your output there should be a incorrectly classified section with a number and percentage, that should be it. The red box in this image is what you're looking for. Edit: Original image source here
This works for me:
Decompile the official weka.jar
Search into the library the classification that you want to test for know how it works and determinate what instances are misclassified.