vowpal_wabbit training data - svm
I am trying to understand vowpal_wabbit data structure for the training and test data but cannot seem to understand them.
I have some training data like.
Feature 1: 0
Feature 2: 1
Feature 3: 10
Feature 4: 5
Class label : A
Feature 1: 0
Feature 2: 2
Feature 3: 30
Feature 4: 8
Class label : C
Feature 1: 2
Feature 2: 10
Feature 3: 9
Feature 4: 7
Class label : B
I have explored some training data examples based on this website.
http://hunch.net/~vw/validate.html
My Validation data
1 | haha:1 hehe:2 hoho:3
1 | haha:2 hehe:2 hoho:3
3 | haha:3 hehe:2 hoho:3
1 | haha:4 hehe:2 hoho:3
2 | haha:5 hehe:2 hoho:3
However, I do not understand why it claims that I have 4 and 5 features respectively.
Validation:
Validation Feedback
Total of 5 examples pasted.
(example #1) Example “1 | haha:1 hehe:2 hoho:3”.
(example #1) Found “[label] |…” prefix format.
(example #1) Example label / response / class is “1”.
(example #1) Example has default “1.0” importance weight.
(example #1) Example has default “0” base.
(example #1, namespace #1) Using default namespace.
(example #1, namespace #1) Found 3 feature(s).
(example #1, namespace #1, feature #1) Label “haha”.
(example #1, namespace #1, feature #1) Value “1”.
(example #1, namespace #1, feature #2) Label “hehe”.
(example #1, namespace #1, feature #2) Value “2”.
(example #1, namespace #1, feature #3) Label “hoho”.
(example #1, namespace #1, feature #3) Value “3”.
(example #2) Example “1 | haha:2 hehe:2 hoho:3 ”.
(example #2) Found “[label] |…” prefix format.
(example #2) Example label / response / class is “1”.
(example #2) Example has default “1.0” importance weight.
(example #2) Example has default “0” base.
(example #2, namespace #1) Using default namespace.
(example #2, namespace #1) Found 4 feature(s).
(example #2, namespace #1, feature #1) Label “haha”.
(example #2, namespace #1, feature #1) Value “2”.
(example #2, namespace #1, feature #2) Label “hehe”.
(example #2, namespace #1, feature #2) Value “2”.
(example #2, namespace #1, feature #3) Label “hoho”.
(example #2, namespace #1, feature #3) Value “3”.
(example #2, namespace #1, feature #4) Label “”.
(example #2, namespace #1, feature #4) Using default value of “1” for feature.
(example #3) Example “3 | haha:3 hehe:2 hoho:3 ”.
(example #3) Found “[label] |…” prefix format.
(example #3) Example label / response / class is “3”.
(example #3) Example has default “1.0” importance weight.
(example #3) Example has default “0” base.
(example #3, namespace #1) Using default namespace.
(example #3, namespace #1) Found 4 feature(s).
(example #3, namespace #1, feature #1) Label “haha”.
(example #3, namespace #1, feature #1) Value “3”.
(example #3, namespace #1, feature #2) Label “hehe”.
(example #3, namespace #1, feature #2) Value “2”.
(example #3, namespace #1, feature #3) Label “hoho”.
(example #3, namespace #1, feature #3) Value “3”.
(example #3, namespace #1, feature #4) Label “”.
(example #3, namespace #1, feature #4) Using default value of “1” for feature.
(example #4) Example “1 | haha:4 hehe:2 hoho:3 ”.
(example #4) Found “[label] |…” prefix format.
(example #4) Example label / response / class is “1”.
(example #4) Example has default “1.0” importance weight.
(example #4) Example has default “0” base.
(example #4, namespace #1) Using default namespace.
(example #4, namespace #1) Found 4 feature(s).
(example #4, namespace #1, feature #1) Label “haha”.
(example #4, namespace #1, feature #1) Value “4”.
(example #4, namespace #1, feature #2) Label “hehe”.
(example #4, namespace #1, feature #2) Value “2”.
(example #4, namespace #1, feature #3) Label “hoho”.
(example #4, namespace #1, feature #3) Value “3”.
(example #4, namespace #1, feature #4) Label “”.
(example #4, namespace #1, feature #4) Using default value of “1” for feature.
(example #5) Example “2 | haha:5 hehe:2 hoho:3 ”.
(example #5) Found “[label] |…” prefix format.
(example #5) Example label / response / class is “2”.
(example #5) Example has default “1.0” importance weight.
(example #5) Example has default “0” base.
(example #5, namespace #1) Using default namespace.
(example #5, namespace #1) Found 5 feature(s).
(example #5, namespace #1, feature #1) Label “haha”.
(example #5, namespace #1, feature #1) Value “5”.
(example #5, namespace #1, feature #2) Label “hehe”.
(example #5, namespace #1, feature #2) Value “2”.
(example #5, namespace #1, feature #3) Label “hoho”.
(example #5, namespace #1, feature #3) Value “3”.
(example #5, namespace #1, feature #4) Label “”.
(example #5, namespace #1, feature #4) Using default value of “1” for feature.
(example #5, namespace #1, feature #5) Label “”.
(example #5, namespace #1, feature #5) Using default value of “1” for feature.
why it claims that i have 4 and 5 features respectively
The extra space symbols at the end of lines are interpreted as extra features by http://hunch.net/~vw/validate.html. (Yes, the last line in your sample has two extra spaces.) Note that validate.html reports an empty name of the extra features:
(example #4, namespace #1, feature #4) Label “”.
Note that validate.html is implemented in JavaScript and is completely independent on the implementation of VW itself (which is in C). VW ignores the trailing spaces. You can test it with:
$ vw -P 1 < sample.data
...
average since example example current current current
loss last counter weight label predict features
1.000000 1.000000 1 1.0 1.0000 0.0000 4
0.522042 0.044084 2 2.0 1.0000 0.7900 4
1.838150 4.470366 3 3.0 3.0000 0.8857 4
1.488676 0.440255 4 4.0 1.0000 1.6635 4
1.270585 0.398217 5 5.0 2.0000 1.3690 4
So all five example are reported as having 4 features (see the last column).
Why four? There is an extra constant (intercept) feature automatically added. If you don't want it, you can use vw --noconstant.
Related
Liferay 7 DXP EE Form Email Formatting
I've created a new custom form in Liferay DXP EE. I would also like to modify and create a custom formatting for how the email is sent. The current email displays the for label then has a line break and then shows the enter value below it like so: • Form Label 1 Form value 1 • Form Label 2 Form value 2 I would like it to display as follows: • Form Label 1: Form value 1 • Form Label 2: Form value 2 I would like the form results to display 2 form labels and values per line. Is it possible to change the formatting like this? What do I need to modify to do this?
You need to modify the "form_entry_add_body.soy" template file inside the web form portlet, but since it's not jsp we can not create a fragment file to override this soy file. However you can create your own custom DDLFormEmailNotificationSender class and register with high service ranking and use modified template from there. There is a challenges to register this class because it's private class so you need to follow this blog. I tried to solve this way but i could not, have a look at this liferay forum post so i have used dirty hack. Hope this will help you.
How to create nested box in PlantUML?
I cannot make a nested box in plantUML. #startuml box "B0" #LightBlue Bob -> Alice : hello Box "B1" #LightYellow Bob --> Cunny : hi end box end box #enduml This gives an error that box cannot be nested. Any other way to show nested box, like in layered diagrams?
It seems it's still not supported: http://forum.plantuml.net/6304/please-add-box-and-or-participant-nesting-ability You can up-vote the feature request.
It's been implemented and you can use it if you have v1.2022.0 or a newer release. The feature seems to be in an early stage and it needs the teoz engine. Example: #startuml !pragma teoz true box "component" box "sub1\n\n" participant a box "subsub1" participant suba end box endbox box "sub2" participant b endbox end box #enduml Github issue for reference (The examples comes from here)
Gruping Grid GXT 2
How can I put the total values of a group of the grid in the same line with the type of the group? Like: [-] Fruits $4.00 Banana $2.00 Apple $2.00 So when I have the group collapsed, I have this [+] Fruits $4.00
Use Live Group Summary. Link: Sencha GXT 2 LiveGroupSummary Example If you want to show the summary row at top, it will be a difficult task as there is no direct way of doing it. You have GXT classes GroupingView and GroupViewSummary which extends GroupingView. You can see in the doRender method of GroupingView, the header text is being generated. You will have to override the method by following the steps of renderSummary method of GroupSummaryView. The header and summary, both are created in different classes, so it will be a difficult task. Just follow the implementation of GroupViewSummary which extends GroupingView and change the renderSummary and doRender method according to your need. I will not suggest doing so, because it might break the functionality.
Back Stack in fragments using Tabs in Action Bar in Android
I am developing an application which have following requirements: 1) App has few tabs and each tab has multiple activities. 2) There should be proper back navigation to make the application user friendly. For this, I used action bar and tabs in my application. Tabs has multiple screens (Requirement). Tab 1: Fragment A --> Fragment B ---> Fragment C Tab 2: Fragment P --> Fragment Q ---> Fragment R Tab 3: Fragment X --> Fragment Y ---> Fragment Z Now I want to use the back functionality from each fragment So the user comeback from next fragment to previous fragment in each tab like: Fragment c --> Fragment B ---> Fragment A I want that user can use back button of device and We can use custom button in action bar for the back navigation. I also want to change the title of action bar according to the current fragment. How can I implement this? Any other better approach which can be used in this situation.' Please reply. I am not getting solution for this type of situations. Thanks a lot. Please provide me solution or best approach for this. Thanks Again.
Have a look at this example, it should do what you want. https://gist.github.com/andreynovikov/4619215
JavaFX - toggle button with separator
The Java FX Scen Builder contains quite a special form of a toggle button. Several Buttons are visually concatenated and separated by a small vertical line: I wonder how this is done. Does somebody have any idea?
It's an HBox of ToggleButton's all with the same ToggleGroup and custom css. There is an example with source code of displaying a similar control group in the Ensemble sample application (which Ensemble terms a Pill Button). The Ensemble sample source license is BSD I think, so you should be able to use it in your app. Go to Ensemble, search for Pill in the Ensemble sample app, click on the "Save NetBeans Project..." button on the Pill Button sample and open the resultant project in NetBeans, full code, css and supporting image files will be included in the project.
As an easier alternative to custom CSS, the Controls FX project provides the Segmented Button control, that allow to visually group buttons just like OP asked. It is BSD licensed so I guess safe to use in most cases. And the library has many other useful and well designed controls. The segmented button looks like this : Very straightforward to use : ToggleButton tb1 = new Button("Red"); ToggleButton tb1 = new Button("Green"); ToggleButton tb1 = new Button("Blue"); SegmentedButton seg = new SegmentedButton(); seg.getButtons().addAll(tb1,tb2,tb3); hbox.getChildren().add(seg); It allows to specify if the selection should be mutually exclusive or not. For the second bwhaviour (non mutually exclusive) set the segmented buttons's group to null : seg.setToggleGroup(null); Source : http://controlsfx.bitbucket.org/org/controlsfx/control/SegmentedButton.html