Users analyser (insights for users).
More...
|
| check_indicators_requirements () |
| Checks if the analyser satisfies all the model indicators requirements.
|
|
| get_iterator_sql (string $tablename, int $contextlevel, ?string $action=null, ?string $tablealias=null, array $contexts=[]) |
| Get the sql of a default implementation of the iterator.
|
|
| order_sql (?string $fieldname=null, string $order='ASC', ?string $tablealias=null) |
| Returns the order by clause.
|
|
| provided_sample_data () |
| This provides samples' user and context.
|
|
|
core_analytics local indicator base[] | $indicators |
| The model indicators.
|
|
string[] | $log |
| Simple log array.
|
|
int | $modelid |
|
array | $options |
| Execution options.
|
|
core_analytics local target base | $target |
| The model target.
|
|
core_analytics local time_splitting base[] | $timesplittings |
| Time splitting methods to use.
|
|
Users analyser (insights for users).
- Copyright
- 2019 David Monllao
- License
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
◆ add_log()
core_analytics\local\analyser\base::add_log |
( |
| $string | ) |
|
|
inherited |
Adds a register to the analysis log.
- Parameters
-
- Return values
-
◆ check_indicator_requirements()
Checks that this analyser satisfies the provided indicator requirements.
- Parameters
-
- Return values
-
true|string[] | True if all good, missing requirements list otherwise |
◆ check_indicators_requirements()
core_analytics\local\analyser\base::check_indicators_requirements |
( |
| ) |
|
|
protectedinherited |
Checks if the analyser satisfies all the model indicators requirements.
- Exceptions
-
- Return values
-
◆ context_restriction_support()
static core_analytics\local\analyser\base::context_restriction_support |
( |
| ) |
|
|
staticinherited |
Returns an array of context levels that can be used to restrict the contexts used during analysis.
The contexts provided to self\get_analysables_iterator will match these contextlevels.
- Return values
-
array | Array of context levels or an empty array if context restriction is not supported. |
Reimplemented in core_analytics\local\analyser\by_course.
◆ get_all_samples() [1/2]
This will return just one user as we analyse users separately.
- Parameters
-
- Return values
-
◆ get_all_samples() [2/2]
This function returns this analysable list of samples.
- Parameters
-
- Return values
-
array | array[0] = int[] (sampleids) and array[1] = array (samplesdata) |
◆ get_analysables()
core_analytics\local\analyser\base::get_analysables |
( |
| ) |
|
|
inherited |
◆ get_analysables_iterator()
core\analytics\analyser\users::get_analysables_iterator |
( |
?string | $action = null, |
|
|
array | $contexts = [] ) |
The site users are the analysable elements returned by this analyser.
- Parameters
-
string | null | $action | 'prediction', 'training' or null if no specific action needed. |
context[] | $contexts | Only analysables that depend on the provided contexts. All analysables in the system if empty. |
- Return values
-
Reimplemented from core_analytics\local\analyser\base.
◆ get_indicators()
core_analytics\local\analyser\base::get_indicators |
( |
| ) |
|
|
inherited |
Getter for indicators.
- Return values
-
◆ get_iterator_sql()
core_analytics\local\analyser\base::get_iterator_sql |
( |
string | $tablename, |
|
|
int | $contextlevel, |
|
|
?string | $action = null, |
|
|
?string | $tablealias = null, |
|
|
array | $contexts = [] ) |
|
protectedinherited |
Get the sql of a default implementation of the iterator.
This method only works for analysers that return analysable elements which ids map to a context instance ids.
- Parameters
-
string | $tablename | The name of the table |
int | $contextlevel | The context level of the analysable |
string | null | $action | |
string | null | $tablealias | The table alias |
context[] | $contexts | Only analysables that depend on the provided contexts. All analysables if empty. |
- Return values
-
array | [0] => sql and [1] => params array |
◆ get_labelled_data()
core_analytics\local\analyser\base::get_labelled_data |
( |
array | $contexts = [] | ) |
|
|
inherited |
Returns labelled data (training and evaluation).
- Parameters
-
context[] | $contexts | Restrict the analysis to these contexts. No context restrictions if null. |
- Return values
-
◆ get_logs()
core_analytics\local\analyser\base::get_logs |
( |
| ) |
|
|
inherited |
Returns the analysis logs.
- Return values
-
◆ get_modelid()
core_analytics\local\analyser\base::get_modelid |
( |
| ) |
|
|
inherited |
Model id getter.
- Return values
-
◆ get_options()
core_analytics\local\analyser\base::get_options |
( |
| ) |
|
|
inherited |
Options getter.
- Return values
-
◆ get_sample_analysable()
core\analytics\analyser\users::get_sample_analysable |
( |
| $sampleid | ) |
|
◆ get_samples()
core\analytics\analyser\users::get_samples |
( |
| $sampleids | ) |
|
◆ get_samples_origin()
core\analytics\analyser\users::get_samples_origin |
( |
| ) |
|
◆ get_static_data()
core_analytics\local\analyser\base::get_static_data |
( |
array | $contexts = [] | ) |
|
|
inherited |
Returns indicator calculations as an array.
- Parameters
-
context[] | $contexts | Restrict the analysis to these contexts. No context restrictions if null. |
- Return values
-
◆ get_target()
core_analytics\local\analyser\base::get_target |
( |
| ) |
|
|
inherited |
Returns the analysed target.
- Return values
-
◆ get_timesplittings()
core_analytics\local\analyser\base::get_timesplittings |
( |
| ) |
|
|
inherited |
Getter for time splittings.
- Return values
-
◆ get_unlabelled_data()
core_analytics\local\analyser\base::get_unlabelled_data |
( |
array | $contexts = [] | ) |
|
|
inherited |
Returns unlabelled data (prediction).
- Parameters
-
context[] | $contexts | Restrict the analysis to these contexts. No context restrictions if null. |
- Return values
-
◆ instantiate_indicators()
core_analytics\local\analyser\base::instantiate_indicators |
( |
| ) |
|
|
inherited |
Instantiate the indicators.
- Return values
-
core_analytics\local\indicator\base[] | |
◆ join_sample_user()
core\analytics\analyser\users::join_sample_user |
( |
| $sampletablealias | ) |
|
◆ one_sample_per_analysable()
static core\analytics\analyser\users::one_sample_per_analysable |
( |
| ) |
|
|
static |
◆ order_sql()
core_analytics\local\analyser\base::order_sql |
( |
?string | $fieldname = null, |
|
|
string | $order = 'ASC', |
|
|
?string | $tablealias = null ) |
|
protectedinherited |
Returns the order by clause.
- Parameters
-
string | null | $fieldname | The field name |
string | $order | 'ASC' or 'DESC' |
string | null | $tablealias | The table alias of the field |
- Return values
-
◆ potential_context_restrictions()
static core_analytics\local\analyser\base::potential_context_restrictions |
( |
string | $query = null | ) |
|
|
staticinherited |
Returns the possible contexts used by the analyser.
This method uses separate logic for each context level because to iterate through the list of contexts calling get_context_name for each of them would be expensive in performance terms.
This generic implementation returns all the contexts in the site for the provided context level. Overwrite it for specific restrictions in your analyser.
- Parameters
-
string | null | $query | Context name filter. |
- Return values
-
◆ processes_user_data()
core\analytics\analyser\users::processes_user_data |
( |
| ) |
|
◆ provided_sample_data()
core\analytics\analyser\users::provided_sample_data |
( |
| ) |
|
|
protected |
◆ sample_access_context()
core\analytics\analyser\users::sample_access_context |
( |
| $sampleid | ) |
|
◆ sample_description()
core\analytics\analyser\users::sample_description |
( |
| $sampleid, |
|
|
| $contextid, |
|
|
| $sampledata ) |
Returns the description of a sample.
- Parameters
-
int | $sampleid | |
int | $contextid | |
array | $sampledata | |
- Return values
-
array | array(string, renderable) |
Reimplemented from core_analytics\local\analyser\base.
◆ $timesplittings
core_analytics local time_splitting base [] core_analytics\local\analyser\base::$timesplittings |
|
protectedinherited |
Time splitting methods to use.
Multiple time splitting methods during evaluation and 1 single time splitting method once the model is enabled.
The documentation for this class was generated from the following file: