The SUMO toolbox  2018a
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Pages
Public Member Functions | List of all members
RandomModelBuilder Class Reference

Generate random models, usefull as a baseline benchmark. More...

Inheritance diagram for RandomModelBuilder:
Inheritance graph
[legend]

Public Member Functions

function RandomModelBuilder (var config)
 Class constructor. More...
 
function runLoop ()
 Just randomly create new models. More...
 
function createMovie ()
 Creates a movie of the best models versus the sample or model iteration. More...
 
function defaultFitnessFunction (var pop, var train)
 Return the score of the given models or parameter vector (representing one or more models). More...
 
function generateNewModels (var number, var wantModels, var previousPop)
 Generates starting points for the hyperparameter optimization. More...
 
function observe (var tag, var x_value, var object)
 Observe each observable. More...
 
function printBestResults ()
 Print information about the best modeling results so far. More...
 
function rebuildBestModel (var keepOldModels)
 Each time new samples are added, the last x best models are re-evaluated against all measures. More...
 
function registerObserver (var tag, var x_name, var description, var observables)
 Register a new observable. More...
 
function scoreModels (var models)
 Attaches a score to a given set of models. More...
 
function setData (var state)
 Set the data point (samples and values) on the ModelBuilder object. More...
 
function setModelInfo (var model, var score)
 Set important contextual information on the model: the input names, output names, transformation values, measure data, etc. More...
 
function done ()
 This function returns true if all final targets were met. More...
 
function getBestModel ()
 Return the last best model built. More...
 
function getBestModelScore ()
 Get the Global score of the best model. More...
 
function getBestModels (var n)
 Return the `n' last best models, optionally filtered for one output. More...
 
function getData ()
 Get current samples en values, i.e. More...
 
function getState ()
 Get the complete current state structure. More...
 
function getKeepOldModels ()
 Should old models be kept when managing the model trace. More...
 
function clearBestModels ()
 Clears the best model trace. More...
 
function getMaximumTime ()
 Get the maximum running time. More...
 
function getOutputDirectory ()
 Get the output directory. More...
 
function getModelFactory ()
 Get the ModelFactory. More...
 
function getNumObjectives ()
 Returns the number of objectives the model builder has to deal with (if they are not combined) This corresponds to the number of enabled measures. More...
 
function getOutputNames ()
 Returns the output names. More...
 
function getParallelMode ()
 Returns whether we are running in parallel mode. More...
 
function getParetoMode ()
 Returns whether we are doing multiobjective optimization. More...
 
function getRestartStrategy ()
 Returns the restart strategy we are using. More...
 
function getStartTime ()
 Returns the time we started. More...
 
function isSamplingEnabled ()
 Returns whether adaptive sampling is enabled. More...
 
function setLevelPlotObject (var levelObj)
 Sets a LevelPlot object. More...
 
function setModelFactory (var mf)
 Sets a ModelFactory object. More...
 
function setRunNumber (var number)
 Sets the run number. More...
 
function setStartTime (var time, var maxTime)
 Sets the start time. More...
 
function evaluateMeasures (var model)
 This function evaluates the model on all the measures and returns the scores. More...
 

Detailed Description

Generate random models, usefull as a baseline benchmark.

Constructor & Destructor Documentation

function RandomModelBuilder ( var  config)
inline

Class constructor.

Returns
instance of the class

Member Function Documentation

function clearBestModels ( )
inlineinherited

Clears the best model trace.

function createMovie ( )
inherited

Creates a movie of the best models versus the sample or model iteration.

Create a quicktime movie of all the .jpeg files in the output directory.

function defaultFitnessFunction ( var  pop,
var  train 
)
inherited

Return the score of the given models or parameter vector (representing one or more models).

This is a generic implementation that every model builder can use.

Parameters
poppopulation of sumo models
traindo we want to fit the sumo models (boolean)
function done ( )
inlineinherited

This function returns true if all final targets were met.

function evaluateMeasures ( var  model)
inherited

This function evaluates the model on all the measures and returns the scores.

It also calculates the global score of the model, based on a combination of the (weighted) separate measure scores.

Parameters
modelsumo Model
function generateNewModels ( var  number,
var  wantModels,
var  previousPop 
)
inherited

Generates starting points for the hyperparameter optimization.

Also implements different restart strategies (= i.e.

Parameters
numbernumber of points to generate
wantModelswrap the points in sumo models (boolean)
previousPopprevious sumo population

how to continue the hyperparameter optimization process in the next modeling iteration)

function getBestModel ( )
inlineinherited

Return the last best model built.

function getBestModels ( var  n)
inlineinherited

Return the `n' last best models, optionally filtered for one output.

Parameters
nnumber of sumo models to retrieve
function getBestModelScore ( )
inlineinherited

Get the Global score of the best model.

function getData ( )
inlineinherited

Get current samples en values, i.e.

the samples and values of all simulations ran up till now.

function getKeepOldModels ( )
inlineinherited

Should old models be kept when managing the model trace.

function getMaximumTime ( )
inlineinherited

Get the maximum running time.

function getModelFactory ( )
inlineinherited

Get the ModelFactory.

function getNumObjectives ( )
inlineinherited

Returns the number of objectives the model builder has to deal with (if they are not combined) This corresponds to the number of enabled measures.

function getOutputDirectory ( )
inlineinherited

Get the output directory.

function getOutputNames ( )
inlineinherited

Returns the output names.

function getParallelMode ( )
inlineinherited

Returns whether we are running in parallel mode.

function getParetoMode ( )
inlineinherited

Returns whether we are doing multiobjective optimization.

function getRestartStrategy ( )
inlineinherited

Returns the restart strategy we are using.

function getStartTime ( )
inlineinherited

Returns the time we started.

function getState ( )
inlineinherited

Get the complete current state structure.

function isSamplingEnabled ( )
inlineinherited

Returns whether adaptive sampling is enabled.

function observe ( var  tag,
var  x_value,
var  object 
)
inherited

Observe each observable.

Records the values in the matching profilers.

Parameters
tagprofiles to write to (e.g., all profilers starting with 'best')
x_valuex value to profile
objecty value to profile
function printBestResults ( )
inherited

Print information about the best modeling results so far.

Includes the best model score, type of error function, target, etc.

function rebuildBestModel ( var  keepOldModels)
inherited

Each time new samples are added, the last x best models are re-evaluated against all measures.

rebuildBestModels ensures lucky models (on the new data) to be kept.

Parameters
keepOldModelskeep the old model trace (boolean)

The best of these is set as the new best model

function registerObserver ( var  tag,
var  x_name,
var  description,
var  observables 
)
inherited

Register a new observable.

Only registers the profiler if it is enabled in the configuration.

Parameters
tagprofiles to write to (e.g., all profilers starting with 'best')
x_namename of the x-axis
descriptiondescription of the observable
observablescell array of Observable objects
function runLoop ( )

Just randomly create new models.

TODO.

function scoreModels ( var  models)
inherited

Attaches a score to a given set of models.

Calls all Measure object attached to the ModelBuilder.

Parameters
modelscell array of sumo models

Afterwards, the sumo models are ordered based on the score.

function setData ( var  state)
inherited

Set the data point (samples and values) on the ModelBuilder object.

New data for a ModelBuilder passes through here.

Parameters
statestruct
function setLevelPlotObject ( var  levelObj)
inlineinherited

Sets a LevelPlot object.

Parameters
levelObjLevelPlot object
function setModelFactory ( var  mf)
inlineinherited

Sets a ModelFactory object.

Parameters
mfModelFactory object
function setModelInfo ( var  model,
var  score 
)
inherited

Set important contextual information on the model: the input names, output names, transformation values, measure data, etc.

This is information only the modelbuilder has.

Parameters
modelsumo Model
scorescore
function setRunNumber ( var  number)
inlineinherited

Sets the run number.

Parameters
numberrun number.
function setStartTime ( var  time,
var  maxTime 
)
inlineinherited

Sets the start time.

Parameters
timestart time
maxTimemaximum time we are allowed to run

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