Implement a metric store
When you define metrics in separate datasets, you may not remember whether a metric already exists and end up re-building it to answer a new business question.
To avoid that situation, you can use AML Extend to define metrics in a central place and and extend datasets to take on these metrics.
// In metrics.aml
// Define a Partial Type of Dataset which contains a group of metrics
PartialDataset revenue_metrics {
metric gmv { ... }
metric mrr { ... }
metric arr { ... }
}
// In company.dataset.aml
Dataset company_with_revenue = company.extend(revenue_metrics)
// In store.dataset.aml
Dataset store_with_revenue = store.extend(revenue_metrics)
A Partial Type is useful for defining a group of properties to be re-used in multiple extensions.
Initializing an object with PartialDataset
type allows you to specify a subset of properties in a dataset, whereas normally you'd have to specify all properties (label
, data_source_name
, etc).
Simialarly, you can also initialize an object with PartialModel
to declare a group of dimensions which can be re-used in multiple extensions.