Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

To learn more about Simple Metrics, please see the C3.ai resources here:

  • Developer Documentation

...

Another type of SimpleMetric is a tsDecl (Timeseries Declaration) metric. tsDecl metrics are often used to turn non-timeseries raw data (e.g., event data, status data, or data with irregular intervals) into timeseries. tsDecl metrics have the same fields as standard SimpleMetric, except for the 'tsDecl' field, which replaces the 'expression' field. tsDecl metrics may allow users the added flexibility to define new metrics which the expression field may not support. Using a tsDecl metric, the above metric can be re-written as:

Code Block
languagepy
met = c3.SimpleMetric(
	id='JHU_ConfirmedCases3_OutbreakLocation',
	name='JHU_ConfirmedCases3',
	srcType='OutbreakLocation',
	path="aggregateMeasurements.(measurementType == 'confirmed' && origin == "
       "'Johns Hopkins University')",
	tsDecl={
		'data': 'data',
		'treatment': 'AVG',
		'start': 'start',
		'value': 'value'
	}
)

Please note that the above examples do not have an example context in which they work. This will be updated soon with a version backed up by a working exercise.

To learn more about tsDecl metrics, please see the C3.ai resources here:

  • Developer Documentation

...

Compound Metrics

Compound metrics allow C3.ai developers to manipulate or combine existing metrics into more complex timeseries. Compound metrics are built on top of one or many existing Simple or Compound metrics. Please note, to evaluate a Compound metric on a C3.ai Type, all Simple metrics, used in that Compound metric, must be defined on that C3.ai Type, as well. Otherwise, an error is returned.

...