![]() |
IRootLab
An Open-Source MATLAB toolbox for vibrational biospectroscopy
|
Grid Search.
Grid search is an simple iterative way of optimization that avoids using the gradient of the objective function (F(.)). Instead, it evaluates F(.) at all points within a point grid and finds to find the maximum value. A new, finer grid is then formed around the point that corresponds to this maximum and the process follows.
The idea came from the guide that comes with LibSVM [1].
Rather than passing a vector from the domain to the objective function, this grid search assigns values to fields within a structure ('.obj') and calls the objective function ('.f_get_rate()') passing '.obj' as a parameter.
Grid search is of course not restricted to SVM neither to classifiers.
Not published in the GUI at the moment.
[1] http://www.csie.ntu.edu.tw/~cjlin/papers/guide/guide.pdf.
Definition at line 20 of file gridsearch.m.
Public Member Functions | |
function | gridsearch () |
function | add_param (in o, in varargin) |
Adds parameter using gridsearchparam constructor with varargin. More... | |
function | assert (in o) |
function | make_defaults (in o, in data) |
function | get_grades (in o, in params) |
Abstract. Method to get the per-feature grades. BMTool stuff. More... | |
function | get_gradeslegend (in o, in params) |
Abstract. Method to get block title based on passed parameters. BMTool stuff. More... | |
function | use (in o, in data) |
Applies block to data. More... | |
function | train (in o, in data, in varargin) |
Trains block. More... | |
function | boot (in o) |
Configures the structure to deal with new type of data. 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 | sgs |
Property | clssr |
Mold classifier. More... | |
Property | log_mold |
Property | postpr_test |
(Optional) Block to post-process the test data. For example, a grag_classes_first. More... | |
Property | postpr_est |
Property | no_refinements |
Number of times to zoom close to best point. More... | |
Property | maxmoves |
Property | params |
Array of gridsearchparam objects. More... | |
Property | paramspecs |
Property | flag_parallel |
Property | chooser |
Chooser object. More... | |
Property | title |
Property | color |
Protected Member Functions | |
function | do_use (in o, in data) |
function | get_ticks (in o, in centre, in length, in no_points) |
function | do_train (in o, in data) |
function | do_boot (in o) |
Boots the block. More... | |
function | do_get_report (in o) |
Default report. More... | |
function | do_get_html (in o) |
Abstract. HTML inner body. More... | |
Protected Attributes | |
Property | inputclass |
Property | flag_bootable |
=0. (High-Level setting and internal function) Whether or not the block is bootable. More... | |
Property | flag_trainable |
=0. (High-Level + internal function). Whether or not the block can be trained, or completely non-data-based. More... | |
Property | flag_incrtrain |
Property | flag_fixednf |
=1. (internal function) If true, dataset number of features will be checked upon training and using. Ignored if o.flag_trainable is 0. More... | |
Property | flag_fixedno |
=0. (internal function) If true, dataset number of observations will be checked upon training and using. Ignored if o.flag_trainable is 0. More... | |
Property | flag_multiin |
=0. (High-Level setting (gencode)) Whether block allows/expects multiple objects as input. More... | |
Property | flag_out |
=1. (High-Level setting (gencode)) Whether the block generates any output at all (counterexample: vis blocks) More... | |
Property | flag_train_inliers_only |
Property | flag_train_require_inliers |
Property | nf |
=-1. Number of features. Cleared at boot(), assigned or reinforced at train(). More... | |
Property | no |
=-1. Number of observations. More... | |
Property | flag_trained |
=0. Set to 1 by train() if training is successful; set back to 0 after booting. More... | |
Property | flag_booted |
=0. Set to 1 by boot() after booting the block More... | |
Property | time_train |
Trainings time. More... | |
Property | time_use |
Use time. 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... | |
function gridsearch::gridsearch | ( | ) |
function gridsearch::add_param | ( | in | o, |
in | varargin | ||
) |
Adds parameter using gridsearchparam constructor with varargin.
function gridsearch::assert | ( | in | o | ) |
|
inherited |
Configures the structure to deal with new type of data.
Booting accounts for clearing any recordings; model structure; stored data etc from the object so that it can be re-used anew.
|
protectedinherited |
Boots the block.
Abstract. Booting accounts for clearing any recordings; model structure; stored data etc from the object so that it can be re-used anew.
|
protectedinherited |
Abstract. HTML inner body.
|
protectedinherited |
Default report.
|
protectedinherited |
|
protected |
|
inherited |
o |
|
inherited |
o | |
flag_title=1 |
|
inherited |
Returns description string
Precedence according with flag_short:
flag_short=0 | I am sealing this to make sure that no class will try to improvise on this function. |
|
inherited |
Abstract. Method to get the per-feature grades. BMTool stuff.
|
inherited |
Abstract. Method to get block title based on passed parameters. BMTool stuff.
|
inherited |
flag_stylesheet=1 | Whether to include the stylesheet in the HTML |
|
inherited |
This is used only to compose sequence string e.g. xxx->yyy->zzz
flag_short=0 |
|
inherited |
Calls Parameters GUI.
If flag_params
, tries uip_<class>.m. If fails, tries uip_<ancestor>.m and so on
|
inherited |
Object reports are plain text. HTML would be cool but c'mon, we don't need that sophistication.
|
protected |
function gridsearch::make_defaults | ( | in | o, |
in | data | ||
) |
|
inherited |
Sets several properties of an object at once.
o | |
params | Cell followint the pattern{'property1', value1, 'property2', value2, ...} |
|
inherited |
Trains block.
|
inherited |
Applies block to data.
Property gridsearch::chooser |
Chooser object.
Definition at line 74 of file gridsearch.m.
|
protectedinherited |
Property gridsearch::clssr |
Mold classifier.
Definition at line 31 of file gridsearch.m.
|
inherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
=0. (internal function). Whether or not the block accepts incremental training. The meaning is:
|
protectedinherited |
|
protectedinherited |
Property gridsearch::flag_parallel |
=0. Whether to run in parallel mode!
Definition at line 71 of file gridsearch.m.
|
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.
|
protectedinherited |
If true, train() will pass on to do_train() a dataset with inliers only. If this flag is true, flag_train_require_inliers will be ignored, because flag_train_inliers_only being true is one way to solve the "inliers requirement".
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
Property gridsearch::log_mold |
=(automatic). Cell array. Molds for the recording.
Automatic logs are rates, time_train, and time_use.
If passed, make sure that first log is rate, and second is time
log titles will become fields inside the sovaluess.values
Definition at line 41 of file gridsearch.m.
Property gridsearch::maxmoves |
=3. Maximum number of tries per iteration. A try counts when the chosen item was on any edge. In this case, the search space will be shifted to have the chosen in the middle, without refinements
Definition at line 58 of file gridsearch.m.
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
Property gridsearch::no_refinements |
Number of times to zoom close to best point.
Definition at line 54 of file gridsearch.m.
Property gridsearch::params |
Array of gridsearchparam objects.
Definition at line 61 of file gridsearch.m.
Property gridsearch::paramspecs |
Parameters specifications in a cell
If provided, will override gridsearch::params
Definition at line 66 of file gridsearch.m.
Property gridsearch::postpr_est |
Block to post-process the estimation issued by the classifier. Examples:
Definition at line 50 of file gridsearch.m.
Property gridsearch::postpr_test |
(Optional) Block to post-process the test data. For example, a grag_classes_first.
Definition at line 44 of file gridsearch.m.
Property gridsearch::sgs |
SGS. If not supplied, the data property will be expected to have at least two elements. Another option is to use obsidxs instead
Definition at line 28 of file gridsearch.m.
|
protectedinherited |
|
protectedinherited |