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

Constructs a basic weighted ensemble object. More...

Inheritance diagram for EnsembleModel:
Inheritance graph
[legend]

Public Member Functions

function EnsembleModel (var varargin)
 
function getModels ()
 
function getSize ()
 
function getWeights ()
 
function setInputNames (var names)
 
function setOutputNames (var names)
 
function getSensitivityIndices (var varargin)
 
function setWeights (var w)
 Set the weights for the ensemble members, should be a scalar or vector. More...
 
function removeDuplicates ()
 Remove duplicate ensemble members. More...
 
function replaceWeakest (var model)
 Replace the ensemble member with the lowest weight. More...
 
function randomReplace (var model)
 Randomly replace one of the ensemble members with the given model. More...
 
function optimizeWeights ()
 Find a better ensemble weighting. More...
 
function getModelTypes ()
 The number of each model type in the ensemble as a java HashMap. More...
 
function addModel (var model)
 Add a model to the ensemble members. More...
 
function contains (var model)
 Return true if the ensemble already contains this model useing a grid-based equality operator. More...
 
function constructInModelSpace (var samples, var values)
 Construct a model through the samples. More...
 
function evaluateInModelSpace (var points)
 Evaluation at a set of points. More...
 
function getDescription ()
 Get the description of this model. More...
 
function getExpressionInModelSpace (var outputIndex)
 Returns the closed, symbolic expression (as a string) of the model for the given output number. More...
 
function complexity ()
 Returns the number of free variables in the model. More...
 
function saveobj ()
 
function getNestedModel ()
 
function basicPlotModel ()
 This is a basic/default implementation called by plotModel.m, if subclasses want more fancy features they should override plotModel and not basicPlotModel. More...
 
function init (var samples, var values)
 This base class method simply sets all the necessary fields (dimension, samples, values, id, ...) More...
 
function construct (var samples, var values)
 Constructs the model given the samples and values in simulator space. More...
 
function update (var samples, var values)
 Update the model with new data without fully retraining the model. More...
 
function getDimensions ()
 Return the input and output dimensions of the model. More...
 
function getExpression (var outputIndex)
 This function first converts the inputs to model space [-1,1] range using the transformation functions and then passes on these functions to the model-space expression. More...
 
function getId ()
 Returns the id of this model. More...
 
function getGrid ()
 Returns a set of samples evaluated on a dense grid to be used for evaluation of the model. More...
 
function equals (var m, var threshold)
 A grid based equality method. More...
 
function evaluate (var points)
 Evaluation at a set of points. More...
 
function evaluateDerivative (var points, var outputIndex)
 Approximate the derivative at the given points in simulator space. More...
 
function evaluateBatch (var points, var batchSize)
 Evaluate a large set of samples in smaller batchs. More...
 
function evaluateInModelSpaceBatch (var points, var batchSize)
 Evaluate a large set of samples in smaller batchs. More...
 
function setTransformationValues (var transf)
 Set the simulator to model and model to simulator transformation functions for this model. More...
 
function getTransformationFunctions ()
 Get the simulator to model and model to simulator transformation functions for this model. More...
 
function getTransformationValues ()
 
function setMeasureScores (var scores)
 Sets scores of this model. More...
 
function getMeasureScores ()
 Returns the structure containing the detailed measure scores for each output. More...
 
function getSamples ()
 Returns the set of samples (in simulator space) on which this model was built. More...
 
function getSamplesInModelSpace ()
 Returns the set of samples on which this model was built (in model space! so in [-1 1]) More...
 
function getValues ()
 Returns the set of values in the samples on which this model was built. More...
 
function setScore (var score)
 Set the global score for this model. More...
 
function getScore ()
 Return the global score of the model. More...
 
function getBounds ()
 Return the lower and upper bounds (in the original simulator space) of each model input. More...
 
function getInputNames ()
 Get the names of the input parameters. More...
 
function getOutputNames ()
 Get the names of the output parameters. More...
 
function setMode (var mode)
 
function getMode ()
 
function setTrainingTime (var trainingTime)
 
function getTrainingTime ()
 
function getType ()
 
function getVersionId ()
 
function display ()
 
function plotModel ()
 Plots the model on the given domain (default: [-1 1]). More...
 
function plotSobolIndices (var varargin)
 Plots the first order total Sobol indices in a pie chart. More...
 
function evaluateDerivativeInModelSpace (var points, var outputIndex)
 Approximate the derivative at the given points in model space. More...
 
function updateInModelSpace (var samples, var values)
 Update the model with new data without fully retraining the model. More...
 
function getSensitivityIndices (var order, var type, var method)
 

Static Public Member Functions

static function getPlotDefaults ()
 
static function loadobj (var this)
 

Detailed Description

Constructs a basic weighted ensemble object.

Constructor & Destructor Documentation

function EnsembleModel ( var  varargin)
inline

Member Function Documentation

function addModel ( var  model)

Add a model to the ensemble members.

function basicPlotModel ( )
inherited

This is a basic/default implementation called by plotModel.m, if subclasses want more fancy features they should override plotModel and not basicPlotModel.

Todo:
not sure why this would be needed
function complexity ( )

Returns the number of free variables in the model.

function construct ( var  samples,
var  values 
)
inherited

Constructs the model given the samples and values in simulator space.

This function scales the data to model space and calls constructInModelSpace()

function constructInModelSpace ( var  samples,
var  values 
)

Construct a model through the samples.

function contains ( var  model)

Return true if the ensemble already contains this model useing a grid-based equality operator.

function display ( )
inlineinherited
function equals ( var  m,
var  threshold 
)
inherited

A grid based equality method.

Evaluates 'm' and 'this' on a grid and returns true if the mean relative error is <= threshold

function evaluate ( var  points)
inherited

Evaluation at a set of points.

function evaluateBatch ( var  points,
var  batchSize 
)
inherited

Evaluate a large set of samples in smaller batchs.

Todo:
some duplicate code, see evaluateInModelSpaceBatch
function evaluateDerivative ( var  points,
var  outputIndex 
)
inherited

Approximate the derivative at the given points in simulator space.

This function transforms the points to model space and calls evaluateDerivativeInModelSpace

function evaluateDerivativeInModelSpace ( var  points,
var  outputIndex 
)
inherited

Approximate the derivative at the given points in model space.

It will return the gradient in each dimension. This is just a very simple implementation based on a simple symmetric approximation. Note that models can override this with more efficient implementations. For example Rational/Polynomial models would be able to provide exact derivatives. The same goes for Kriging models.

For a good tutorial/intro on gradients see: http://www-math.mit.edu/18.013A/HTML/chapter07/contents.html

function evaluateInModelSpace ( var  points)

Evaluation at a set of points.

function evaluateInModelSpaceBatch ( var  points,
var  batchSize 
)
inherited

Evaluate a large set of samples in smaller batchs.

function getBounds ( )
inherited

Return the lower and upper bounds (in the original simulator space) of each model input.

function getDescription ( )

Get the description of this model.

function getDimensions ( )
inherited

Return the input and output dimensions of the model.

function getExpression ( var  outputIndex)
inherited

This function first converts the inputs to model space [-1,1] range using the transformation functions and then passes on these functions to the model-space expression.

function getExpressionInModelSpace ( var  outputIndex)

Returns the closed, symbolic expression (as a string) of the model for the given output number.

function getGrid ( )
inherited

Returns a set of samples evaluated on a dense grid to be used for evaluation of the model.

Recycles previously evaluated grids.

function getId ( )
inherited

Returns the id of this model.

Id's are defined in the construct function, so that a model that is reconstructed gets a new unique id.

function getInputNames ( )
inherited

Get the names of the input parameters.

function getMeasureScores ( )
inherited

Returns the structure containing the detailed measure scores for each output.

function getMode ( )
inlineinherited
function getModels ( )
inline
function getModelTypes ( )

The number of each model type in the ensemble as a java HashMap.

function getNestedModel ( )
inlineinherited
function getOutputNames ( )
inherited

Get the names of the output parameters.

static function getPlotDefaults ( )
inlinestaticinherited
function getSamples ( )
inherited

Returns the set of samples (in simulator space) on which this model was built.

function getSamplesInModelSpace ( )
inherited

Returns the set of samples on which this model was built (in model space! so in [-1 1])

function getScore ( )
inherited

Return the global score of the model.

function getSensitivityIndices ( var  varargin)
inline
function getSensitivityIndices ( var  order,
var  type,
var  method 
)
inherited
function getSize ( )
inline
function getTrainingTime ( )
inlineinherited
function getTransformationFunctions ( )
inherited

Get the simulator to model and model to simulator transformation functions for this model.

Return values
inFuncsimulator -> model space
outFuncmodel -> simulator space
function getTransformationValues ( )
inlineinherited
function getType ( )
inlineinherited
function getValues ( )
inherited

Returns the set of values in the samples on which this model was built.

function getVersionId ( )
inlineinherited
function getWeights ( )
inline
function init ( var  samples,
var  values 
)
inherited

This base class method simply sets all the necessary fields (dimension, samples, values, id, ...)

static function loadobj ( var  this)
inlinestaticinherited
function optimizeWeights ( )

Find a better ensemble weighting.

Todo:
use already calculated model score for the weights ?
function plotModel ( )
inherited

Plots the model on the given domain (default: [-1 1]).

Slice plots are made for dimensions larger than 2. Dimensions higher than 5 are clamped to 0. Subclasses may override this method if they wish to allow for model specific plotting. This implementation simply calls basicPlotModel. The default plot options can be found by calling the static member function getPlotDefaults().

Calling syntax: fighandle = plotModel(model,[output number],[options structure])

function plotSobolIndices ( var  varargin)
inherited

Plots the first order total Sobol indices in a pie chart.

function randomReplace ( var  model)

Randomly replace one of the ensemble members with the given model.

function removeDuplicates ( )

Remove duplicate ensemble members.

function replaceWeakest ( var  model)

Replace the ensemble member with the lowest weight.

function saveobj ( )
function setInputNames ( var  names)
inline
function setMeasureScores ( var  scores)
inherited

Sets scores of this model.

function setMode ( var  mode)
inlineinherited
function setOutputNames ( var  names)
inline
function setScore ( var  score)
inherited

Set the global score for this model.

function setTrainingTime ( var  trainingTime)
inlineinherited
function setTransformationValues ( var  transf)
inherited

Set the simulator to model and model to simulator transformation functions for this model.

function setWeights ( var  w)

Set the weights for the ensemble members, should be a scalar or vector.

The weights will be normalized so they sum to 1.

function update ( var  samples,
var  values 
)
inherited

Update the model with new data without fully retraining the model.

This is useful for model types that support on-line learning This base class implementation simply calls construct. It is up to the model type to give a more efficient implementation

function updateInModelSpace ( var  samples,
var  values 
)
inherited

Update the model with new data without fully retraining the model.

This is useful for model types that support on-line learning This base class implementation simply calls constructInModelSpace. It is up to the model type to give a more efficient implementation


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