create(String displayName, String type, Dictionary settings, List<String> inputIdList,
List<String> outputIdList, List<String> excludedInputIds, List<String>
excludedDatasetIds)
This method generates a new approximation with specified attributes.
- Arguments
-
displayName
: String naming the current approximation.
type
: String identifying the method used by the approximation,
such as 'RSM'.
settings
: Python dictionary-like object containing all optional parameters, matching one of the
following schemas:
inputIdList
: An optional list of input parameter IDs
identifying parameters to be used as inputs for the approximation.
outputIdList
: An optional list of output parameter IDs
identifying parameters to be predicted by the approximation.
excludedInputIds
: An optional list of input parameter IDs
identifying parameters to be ignored during approximation training.
excludedDatasetIds
: An optional list of data set IDs
identifying data sets to be ignored during approximation training.
- Return Value
ApproxObject(Dictionary)
You can use the
ApproximationAPI.library
command to retrieve all
available types and settings.
evaluate(Dictionary evalJson)
This method evaluates one or more approximations at one or more points. The point options
are either a single point (which uses the
approxPoint
argument), a list of points (supplied using
approxPoints
),
or a sweep of points (in which point sweeps are generated as a single input parameter is
varied across a supplied array of values while all other parameters are held constant.
- Arguments
-
evalJson
: A dictionary-like object containing all required
request information.
- Evaluate Schema
- Return Value
- The structure of the return value depends on the arguments you use:
approxPoint
: Returns a nested dictionary-like object with each
output value for each approximation at the specified point. For
example:{"approx-id-1":{
{
"output-id-1":1.0,
"output-id-2":2.0
}
}}
approxPoints
: Similar to approxPoint
, but each
approx-id
corresponds to an array of output dictionaries. For
example:{"approx-id-1":[
{
"output-id-1":1.0,
"output-id-2":2.0
},{
"output-id-1":1.5,
"output-id-2":2.5
}
]}
baselinePoint
and sweepValues
: Similar to
approxPoint
; however, rather than returning a single point
value for each output parameter, it returns a dictionary-like object containing a
list-like object of values corresponding to each provided sweep. For
example:#Input argument
Output = ApproximationAPI.evaluate({
"approxIds": ["approx-id-1"],
"baselinePoint": {"input-id-1": 1.0, "input-id-2":1.8},
"sweepValues": {"input-id-1": [0.0, 0.5, 1.0, 1.5, 2.0]
})
#Output
{"approx-id-1":{
"output-id-1":{
"input-id-1":[5, 10, 15, 20, 25]
},
"output-id-2":{
"input-id-1":[15, 110, 115, 120, 125]
}
}}
Only
provide one of approxPoint
,
approxPoints
, or
baselinePoint
/sweepValues
.
Supply both
baselinePoint
and sweepValues
together. This determines
the manner in which the method evaluates the approximation.
Providing approxPoint
evaluates the specified approximations at a single
point. Providing approxPoints
evaluates the approximations at a list of
specified points.
Providing both sweepValues
and baselinePoint
evaluates an
array of points for each input supplied in sweepValues
, in which a single
input is modified at a time with all other inputs held constant at the values you provide in
baselinePoint
.
errorMeasures(List<String> approxIds)
This method gets all error measures for a specified set of approximations.
- Arguments
approxIds
: List of strings identifying approximations.
- Return Value
- Returns a Python dictionary-like object containing all information on error measures for the
specified approximations.
The
approxId
value is in the
id
attribute of an
approxObject
. These objects can be obtained using the select and next
methods on this class, among others.
getCoefficientsData(String approxId)
This method gets approximation coefficients data for a specified approximation.
- Arguments
approxId
: String identifying an approximation.
- Return Value
- Returns the coefficients data file as a string.
The
approxId
value is in the
id
attribute of an
approxObject
. You can obtain these objects using the
select()
and
next()
methods, among others.
globalEffects(String approxId)
This method gets global effects for a specified approximation.
- Arguments
approxId
: String identifying an approximation.
- Return Value
- Returns global effects data for the specified approximations as a dictionary-like
object
The
approxId
value is in the
id
attribute of an
approxObject
. You can obtain these objects using the
select()
and
next()
methods, among others.
mainEffects(String approxId)
This method gets the main effects data for a specified approximation.
- Arguments
approxId
: String identifying an approximation.
- Return Value
- Returns the main effects data for the specified approximations as a dictionary-like
object.
The
approxId
value is in the
id
attribute of an
approxObject
. You can obtain these objects using the
select()
and
next()
methods, among others.
deleteApproximations(List<String> approxIds)
This method deletes specified approximations.
- Arguments
approxIds
: List-like object containing strings identifying one or
more approximations.
- Return Value
- None.
The
approxId
values are the
id
attributes of
approxObjects
. You can obtain these objects using the
select()
and
next()
methods, among others.
trainApproximation(String approxId, String displayName, Dictionary settings,
List<String> inputIds, List<String> outputIds, List<String>excludedInputIds,
List<String>excludedDatasetIds)
This method initiates training for a specified approximation, optionally passing it updated
settings, input/output parameters, and excluded parameters.
- Arguments
-
approxId
: A string uniquely identifying an approximation.
displayName
: An optional string for updating the approximation
name.
settings
: Python dictionary-like object containing all optional parameters, matching one of the
following schemas:
inputIds
: An optional list of input parameter IDs identifying
parameters to be used as inputs for the approximation.
outputIds
: An optional list of output parameter IDs identifying
parameters to be predicted by the approximation.
excludedInputIds
: An optional list of input parameter IDs
identifying parameters to be ignored during approximation training.
excludedDatasetIds
: An optional list of data set IDs
identifying data sets to be ignored during approximation training.
- Return Value
- None.
describeApproximation(String approxId)
This method gets the approximation object describing a specified approximation, containing
the approximation type and settings (such as polyOrder
for RSM).
- Arguments
approxId
: A string containing the ID of an approximation.
- Return Value
- Returns a dictionary-like object containing all attributes of an approximation, such
as approximation type and settings.
select(Callable selector)
This method selects all approximations matching a specified callable option. This is a
wrapper for the iterator method, which iterates over the collection of all approximations,
passing each to the selector object and returning those for which the selector object
returns true.
- Arguments
selector
: This is a Python callable object.
- Return Value
- Returns a Python list of approxObject objects (a list-like object containing dictionary-like
objects).
getIterator()
This method creates an iterator and returns the ID.
- Arguments
- None.
- Return Value
- Returns a string with the ID of the created approximation iterator.
next(String iteratorId)
This method gets the next approximation object in an approximation iterator.
- Arguments
iteratorId
: ID string returned by the getIterator method.
- Return Value
- Returns an
approxObject
(dictionary-like object).
hasNext(String iteratorId)
This method determines if an iterator contains at least one more item. If
hasNext()
returns true, next()
returns another
approxObject
.
- Arguments
iteratorId
: ID string returned by the
getIterator()
method.
- Return Value
- Returns true if the iterator contains at least one more item.