IRootLab
An Open-Source MATLAB toolbox for vibrational biospectroscopy
sgs_weighted Class Reference

Detailed Description

Weighted Sub-Sampling.

Used in Adaboost

See also
sgs_randsub_base, uip_sgs_randsub_base.m, uip_sgs_weighted.m

Definition at line 5 of file sgs_weighted.m.

+ Inheritance diagram for sgs_weighted:
+ Collaboration diagram for sgs_weighted:

Public Member Functions

function sgs_weighted (in o)
 
function get_obsidxs_new (in o)
 
function get no_pieces (in o)
 If hasn't been setup yet, will return a NaN. More...
 
function setup (in o, in data)
 
function get_obsidxs (in o, in data)
 Solves o.no_unitss. More...
 
function assert (in o)
 Data-independent validation. Can be used at the GUI to check for parameter inconsistencies. More...
 
function get_description (in o, in flag_short)
 
function setbatch (in o, in params)
 Sets several properties of an object at once. More...
 
function get_methodname (in o, in flag_short)
 
function get_report (in o)
 Object reports are plain text. HTML would be cool but c'mon, we don't need that sophistication. More...
 
function get_html (in o, in flag_stylesheet)
 
function get_params (in o, in data)
 Calls Parameters GUI. More...
 
function extract_log (in o)
 
function get_ancestry (in o, in flag_title)
 

Public Attributes

Property weights
 weights per observation More...
 
Property bites
 =[.9, .1]: vectors of percentages. More...
 
Property type
 
Property bites_fixed
 Used only if type is 'fixed', otherwise bites will be used. More...
 
Property no_reps
 =10. The number of repetitions. More...
 
Property flag_group
 =0. Whether items from the same group (group) are to always remain together. More...
 
Property flag_perclass
 =0. Whether to perform on each class separately. More...
 
Property randomseed
 
Property no_pieces
 read-only More...
 
Property title
 
Property color
 

Protected Member Functions

function get_idxs_new (in o)
 Returns a 2D cell: rows are pieces, columns are bites, elements are indexes. More...
 
function do_assert (in o)
 Parameter validation. More...
 
function get_repidxs (in o)
 Overwrittern. More...
 
function do_setup (in o)
 
function do_get_report (in o)
 Default report. More...
 
function do_get_html (in o)
 Abstract. HTML inner body. More...
 

Protected Attributes

Property pvt_flag_fixed
 
Property pvt_no_units_sel
 
Property flag_setup
 
Property data
 
Property pieces
 
Property no_unitss
 
Property maps
 
Property pr_flag_group
 Calculated upon setup, will be zero if flag_group but dataset has no groups. More...
 
Property classtitle
 Class Title. Should have a descriptive name, as short as possible. More...
 
Property short
 Short for the method name. More...
 
Property flag_params
 
Property flag_ui
 (GUI setting) Whether to "publish" in blockmenu and datatool. Note that a class can be "published" without a GUI (set flag_params=0 in this case, at the class constructor). More...
 
Property moreactions
 (GUI setting) String cell containing names of methods that may be called from the GUIs More...
 

Constructor & Destructor Documentation

function sgs_weighted::sgs_weighted ( in  o)

Member Function Documentation

function sgs::assert ( in  o)
inherited

Data-independent validation. Can be used at the GUI to check for parameter inconsistencies.

function sgs_weighted::do_assert ( in  o)
protected

Parameter validation.

function irobj::do_get_html ( in  o)
protectedinherited

Abstract. HTML inner body.

function irobj::do_get_report ( in  o)
protectedinherited

Default report.

function sgs_randsub_base::do_setup ( in  o)
protectedinherited
function irobj::extract_log ( in  o)
inherited
Parameters
o
Returns
[o, log]
function irobj::get_ancestry ( in  o,
in  flag_title 
)
inherited
Parameters
o
flag_title=1
function irobj::get_description ( in  o,
in  flag_short 
)
inherited

Returns description string

Precedence according with flag_short:

  • 0: title > short > classtitle
  • 1: short > title > classtitle
Parameters
flag_short=0I am sealing this to make sure that no class will try to improvise on this function.
function irobj::get_html ( in  o,
in  flag_stylesheet 
)
inherited
Parameters
flag_stylesheet=1Whether to include the stylesheet in the HTML
function sgs_weighted::get_idxs_new ( in  o)
protected

Returns a 2D cell: rows are pieces, columns are bites, elements are indexes.

function irobj::get_methodname ( in  o,
in  flag_short 
)
inherited

This is used only to compose sequence string e.g. xxx->yyy->zzz

Parameters
flag_short=0
function sgs::get_obsidxs ( in  o,
in  data 
)
inherited

Solves o.no_unitss.

function sgs_randsub_base::get_obsidxs_new ( in  o)
inherited
function irobj::get_params ( in  o,
in  data 
)
inherited

Calls Parameters GUI.

If flag_params, tries uip_<class>.m. If fails, tries uip_<ancestor>.m and so on

function sgs_randsub_base::get_repidxs ( in  o)
protectedinherited

Overwrittern.

function irobj::get_report ( in  o)
inherited

Object reports are plain text. HTML would be cool but c'mon, we don't need that sophistication.

function get sgs::no_pieces ( in  o)
inherited

If hasn't been setup yet, will return a NaN.

function irobj::setbatch ( in  o,
in  params 
)
inherited

Sets several properties of an object at once.

Parameters
o
paramsCell followint the pattern
{'property1', value1, 'property2', value2, ...} 
function sgs::setup ( in  o,
in  data 
)
inherited

Member Data Documentation

Property sgs_randsub_base::bites
inherited

=[.9, .1]: vectors of percentages.

Definition at line 19 of file sgs_randsub_base.m.

Property sgs_randsub_base::bites_fixed
inherited

Used only if type is 'fixed', otherwise bites will be used.

Definition at line 28 of file sgs_randsub_base.m.

Property irobj::classtitle
protectedinherited

Class Title. Should have a descriptive name, as short as possible.

Definition at line 50 of file irobj.m.

Property irobj::color
inherited

=[0, .8, 0]. multipurpose feature, routines may use it for different things. Major use is to change the background of objtool and blockmenu. See also classes_html.m

Definition at line 42 of file irobj.m.

Property sgs::data
protectedinherited

Definition at line 32 of file sgs.m.

Property sgs::flag_group
inherited

=0. Whether items from the same group (group) are to always remain together.

Definition at line 12 of file sgs.m.

Property irobj::flag_params
protectedinherited

=1. (GUI setting) Whether to call a GUI when the block is selected in blockmenu.m . If true, a routine called "uip_"<class name> will be called.

Definition at line 57 of file irobj.m.

Property sgs::flag_perclass
inherited

=0. Whether to perform on each class separately.

Definition at line 15 of file sgs.m.

Property sgs::flag_setup
protectedinherited

Definition at line 30 of file sgs.m.

Property irobj::flag_ui
protectedinherited

(GUI setting) Whether to "publish" in blockmenu and datatool. Note that a class can be "published" without a GUI (set flag_params=0 in this case, at the class constructor).

Definition at line 60 of file irobj.m.

Property sgs::maps
protectedinherited

Definition at line 42 of file sgs.m.

Property irobj::moreactions
protectedinherited

(GUI setting) String cell containing names of methods that may be called from the GUIs

Definition at line 63 of file irobj.m.

Property sgs::no_pieces
inherited

read-only

Definition at line 23 of file sgs.m.

Property sgs_randsub_base::no_reps
inherited

=10. The number of repetitions.

Definition at line 31 of file sgs_randsub_base.m.

Property sgs::no_unitss
protectedinherited

Number of "units" in dataset. This may be a single value containing the number of observations or groups, depending on .flag_group, or a vector containing that information for each class, if .flag_perclass is True.

Definition at line 40 of file sgs.m.

Property sgs::pieces
protectedinherited

Definition at line 34 of file sgs.m.

Property sgs::pr_flag_group
protectedinherited

Calculated upon setup, will be zero if flag_group but dataset has no groups.

Definition at line 46 of file sgs.m.

Property sgs_randsub_base::pvt_flag_fixed
protectedinherited

Definition at line 11 of file sgs_randsub_base.m.

Property sgs_randsub_base::pvt_no_units_sel
protectedinherited

Definition at line 13 of file sgs_randsub_base.m.

Property sgs::randomseed
inherited

=0. Random seed. Only used if > 0. if > 0, MATLAB's rand('twister', o.randseed) will be called before. This can be used to repeat sequences.

Definition at line 19 of file sgs.m.

Property irobj::short
protectedinherited

Short for the method name.

Definition at line 53 of file irobj.m.

Property irobj::title
inherited

Definition at line 38 of file irobj.m.

Property sgs_randsub_base::type
inherited

='simple'. String containing one of the following possibilities:

  • 'simple' uses percentages in bites
  • 'balanced' same number of units are picked within each class. Needs flag_perclass to be TRUE, otherwise will give error. The "bites" property will be used to calculate fixed number of units
  • 'fixed' fixed number of units are picked. Uses bites_fixed

Definition at line 25 of file sgs_randsub_base.m.

Property sgs_weighted::weights

weights per observation

Definition at line 11 of file sgs_weighted.m.


The documentation for this class was generated from the following file: