Basic structure of a builder, how can this work? #11
Replies: 1 comment 1 reply
-
This is how I am proceeding with the manager->director->builder interactions. These notes are in the appropriate readme files in the repo and in the prologue of each appropriate go file, but I wanted to put them here for discussion. manager.... VxDataProcessor ManagerThe Manager has the following responsibilities and transformations.
InputsThe rest API service will call the manager with a scorecard document ID. TypeThe type (what kind of builders are needed) is determined by the manager which will queue the appropriate data setThe scorecard is an unmarshalled JSON structure .... Result setThe result set is a part of the scorecard structure ... {
"SCORECARD": {
"dateRange": "01/30/2023 20:00 - 03/01/2023 18:00",
"id": "SC:anonymous--1row-at-202303030114:0:01/30/2023_20_00_-_03/01/2023_18_00",
"name": "anonymous--1row-at-202303030114",
"plotParams": {..},
"processedAt": 0,
**"results": {...}**
} It can be reached like
and subsets of data may be reached like
DIRECTORVxDataProcessor mysql_directorThe Director has the following responsibilities...
InputsThe manager starts a director in a go routine and gives it an sc_row structure struct sc_element {
app_url string
row_ptr *map
result_ptr *int
} TypeThe type specifies what kind of builder is required for this data set data setThe data set is a JSON structure .... Result setThe result set is a JSON structure ... AlgorithmThe algorithm specifies what the calculation algorithm is that is to be applied to the data set to achieve the specified result. BuilderA builder has to implement the ScorecardCellBuilder interface defined in iBuilder.
It isn't defined yet but the ScorecardCellBuilder interface will define a top level entry point that enables the |
Beta Was this translation helpful? Give feedback.
-
Initially I am thinking the algorithm is really a function.
Of course GO doesn't really do eval (it's compiled not interpreted) and it probably shouldn't even if someone did implement it because that would lead to incompatibilities when deploying different architectures, so the algorithm is probably a function. We do need to identify the proper function to use (i.e. algorithm), but that can be done with a switch statement.
The data, I believe, is a map. You obviously need populationA and populationB which are arrays of numbers, probably float64. It might be more complicated, like an array of these populations for example a list of forecast lead times that each have two populations.
The function has to apply a statistic to the populations and then compare them, so there needs to be a function for each statistic. Those are probably different builder types. In a given scorecard major Row you can have many different statistical calculations (each of those minor rows is a stat/variable combination).
So for student's t test as one example consider this and
this
So maybe we have builders that are like "TtestRMSE" and "TtestBias".
For data I don't think it is a good idea to have the calculation builders do QUERIES, like a query that would be like
SELECT AVE(data[*]['temperature']) where ....
we should query the data into sets of numbers that are put into the proper data structure and then pass that into the calculation builders. Otherwise the calculation builders will get too specific to be applied to other data sets. That said we probably do have DATA builders which do queries and data manipulation and then they pass the data into the calculation builders. Even then the DATA builders shouldn't be doing math inside the queries. Query for data and then do MATH in code.
Beta Was this translation helpful? Give feedback.
All reactions