Quarters time splitting method.
More...
|
static | get_name () |
| Returns a lang_string object representing the name for the time spliting method.
|
|
|
core_analytics analysable | $analysable |
|
string | $id |
|
int | $modelid |
| The model id.
|
|
array | $ranges = [] |
|
Quarters time splitting method.
- Copyright
- 2016 David Monllao
- License
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
◆ append_rangeindex()
core_analytics\local\time_splitting\base::append_rangeindex |
( |
| $sampleid, |
|
|
| $rangeindex ) |
|
finalinherited |
Generates a unique sample id (sample in a range index).
- Parameters
-
int | $sampleid | |
int | $rangeindex | |
- Return values
-
◆ cache_indicator_calculations()
core_analytics\local\time_splitting\base::cache_indicator_calculations |
( |
| ) |
|
|
inherited |
Whether to cache or not the indicator calculations.
Indicator calculations are stored to be reused across models. The calculations are indexed by the calculation start and end time, and these times depend on the time-splitting method. You should overwrite this method and return false if the time frames generated by your time-splitting method are unique and / or can hardly be reused by further models.
- Return values
-
Reimplemented in core_analytics\local\time_splitting\after_start, and core_analytics\local\time_splitting\upcoming_periodic.
◆ define_ranges()
core_analytics\local\time_splitting\equal_parts::define_ranges |
( |
| ) |
|
|
protectedinherited |
◆ get_all_ranges()
core_analytics\local\time_splitting\base::get_all_ranges |
( |
| ) |
|
|
inherited |
Returns the ranges used by this time splitting method.
- Return values
-
◆ get_analysable()
core_analytics\local\time_splitting\base::get_analysable |
( |
| ) |
|
|
inherited |
get_analysable
- Return values
-
◆ get_distinct_ranges()
core_analytics\local\time_splitting\base::get_distinct_ranges |
( |
| ) |
|
|
inherited |
Returns the distinct range indexes in this time splitting method.
- Return values
-
◆ get_id()
core_analytics\local\time_splitting\base::get_id |
( |
| ) |
|
|
inherited |
Returns the time splitting method id.
- Return values
-
◆ get_most_recent_prediction_range()
core_analytics\local\time_splitting\base::get_most_recent_prediction_range |
( |
| ) |
|
|
inherited |
Returns the most recent range that can be used to predict.
This method is only called when calculating predictions.
- Return values
-
◆ get_name()
static core\analytics\time_splitting\quarters::get_name |
( |
| ) |
|
|
static |
Returns a lang_string object representing the name for the time spliting method.
Used as column identificator.
If there is a corresponding '_help' string this will be shown as well.
- Return values
-
Reimplemented from core_analytics\local\time_splitting\base.
◆ get_number_parts()
core\analytics\time_splitting\quarters::get_number_parts |
( |
| ) |
|
|
protected |
◆ get_range_by_index()
core_analytics\local\time_splitting\base::get_range_by_index |
( |
| $rangeindex | ) |
|
|
inherited |
Returns range data by its index.
- Parameters
-
- Return values
-
array|false | Range data or false if the index is not part of the existing ranges. |
◆ get_training_ranges()
core_analytics\local\time_splitting\base::get_training_ranges |
( |
| ) |
|
|
inherited |
◆ include_range_info_in_training_data()
core_analytics\local\time_splitting\base::include_range_info_in_training_data |
( |
| ) |
|
|
inherited |
Whether to include the range index in the training data or not.
By default, we consider that the different time ranges included in a time splitting method may not be compatible between them (i.e. the indicators calculated at the end of the course can easily differ from indicators calculated at the beginning of the course). So we include the range index as one of the variables that the machine learning backend uses to generate predictions.
If the indicators calculated using the different time ranges available in this time splitting method are comparable you can overwrite this method to return false.
Note that:
- This is only relevant for models whose predictions are not based on assumptions (i.e. the ones using a machine learning backend to generate predictions).
- The ranges can only be included in the training data when we know the final number of ranges the time splitting method will have. E.g. We can not know the final number of ranges of a 'daily' time splitting method as we will have one new range every day.
- Return values
-
Reimplemented in core_analytics\local\time_splitting\periodic.
◆ infer_sample_info()
core_analytics\local\time_splitting\base::infer_sample_info |
( |
| $uniquesampleid | ) |
|
|
finalinherited |
Returns the sample id and the range index from a uniquesampleid.
- Parameters
-
- Return values
-
array | array($sampleid, $rangeindex) |
◆ is_valid_analysable()
◆ ready_to_predict()
core_analytics\local\time_splitting\base::ready_to_predict |
( |
| $range | ) |
|
|
inherited |
◆ ready_to_train()
core_analytics\local\time_splitting\base::ready_to_train |
( |
| $range | ) |
|
|
inherited |
Should we use this time range for training?
- Parameters
-
- Return values
-
◆ set_analysable()
Assigns the analysable and updates the time ranges according to the analysable start and end dates.
- Parameters
-
- Return values
-
◆ set_modelid()
core_analytics\local\time_splitting\base::set_modelid |
( |
int | $modelid | ) |
|
|
inherited |
Assigns the model id to this time-splitting method it case it needs it.
- Parameters
-
◆ valid_for_evaluation()
core_analytics\local\time_splitting\base::valid_for_evaluation |
( |
| ) |
|
|
inherited |
◆ validate_ranges()
core_analytics\local\time_splitting\base::validate_ranges |
( |
| ) |
|
|
protectedinherited |
Validates the time splitting method ranges.
- Exceptions
-
- Return values
-
The documentation for this class was generated from the following file:
- lib/classes/analytics/time_splitting/quarters.php