Moodle APIs
3.8
Moodle 3.8.6 (Build: 20201109)
|
Runs an analysis of the site. More...
Public Member Functions | |
__construct (\core_analytics\local\analyser\base $analyser, bool $includetarget, core_analytics\local\analysis\result $result) | |
Constructor. More... | |
calculate (\core_analytics\local\time_splitting\base $timesplitting, array &$sampleids, array $ranges, core_analytics\local\target\base $target) | |
Calculates indicators and targets. More... | |
get_headers (\core_analytics\local\time_splitting\base $timesplitting, core_analytics\local\target\base $target) | |
Returns the headers for the csv file based on the indicators and the target. More... | |
process_analysable (\core_analytics\analysable $analysable) | |
Processes an analysable. More... | |
run (array $contexts=[]) | |
Runs the analysis. More... | |
Static Public Member Functions | |
static | clean_time_splitting_id ($timesplittingid) |
Remove all possibly problematic chars from the time splitting method id (id = its full class name). More... | |
static | fill_firstanalyses_cache (int $modelid, ?int $analysableid=null) |
Fills a cache containing the first time each analysable in the provided model was analysed. More... | |
Protected Member Functions | |
add_context_metadata (\core_analytics\local\time_splitting\base $timesplitting, array &$dataset, core_analytics\local\target\base $target) | |
Adds dataset context info. More... | |
calculate_indicators (\core_analytics\local\time_splitting\base $timesplitting, array $sampleids, array $ranges) | |
Calculates indicators. More... | |
fill_dataset (\core_analytics\local\time_splitting\base $timesplitting, array &$dataset, ?array $calculatedtarget=null) | |
Adds time range indicators and the target to each sample. More... | |
filter_out_prediction_samples_and_ranges (array &$sampleids, array &$ranges, core_analytics\local\time_splitting\base $timesplitting) | |
Filters out samples that have already been used for prediction. More... | |
filter_out_train_samples (array &$sampleids, core_analytics\local\time_splitting\base $timesplitting) | |
Filters out samples that have already been used for training. More... | |
get_processed_analysables () | |
Get analysables that have been already processed. More... | |
process_time_splitting (\core_analytics\local\time_splitting\base $timesplitting, core_analytics\analysable $analysable, core_analytics\local\target\base $target) | |
Processes the analysable samples using the provided time splitting method. More... | |
save_prediction_samples (array $sampleids, array $ranges, core_analytics\local\time_splitting\base $timesplitting, ?\stdClass $predictsamplesrecord=null) | |
Saves samples that have just been used for prediction. More... | |
save_train_samples (array $sampleids, core_analytics\local\time_splitting\base $timesplitting) | |
Saves samples that have just been used for training. More... | |
update_analysable_analysed_time (array $processedanalysables, int $analysableid) | |
Updates the analysable analysis time. More... | |
Runs an analysis of the site.
core_analytics\analysis::__construct | ( | \core_analytics\local\analyser\base | $analyser, |
bool | $includetarget, | ||
core_analytics\local\analysis\result | $result | ||
) |
Constructor.
core_analytics\local\analyser\base | $analyser | |
bool | $includetarget | Whether to calculate the target or not. |
core_analytics\local\analysis\result | $result |
|
protected |
Adds dataset context info.
metadata1,metadata2,metadata3,..... value1, value2, value3,.....
header1,header2,header3,header4,..... stud1value1,stud1value2,stud1value3,stud1value4,..... stud2value1,stud2value2,stud2value3,stud2value4,.....
core_analytics\local\time_splitting\base | $timesplitting | |
array | $dataset | |
core_analytics\local\target\base | $target |
null |
core_analytics\analysis::calculate | ( | \core_analytics\local\time_splitting\base | $timesplitting, |
array & | $sampleids, | ||
array | $ranges, | ||
core_analytics\local\target\base | $target | ||
) |
Calculates indicators and targets.
core_analytics\local\time_splitting\base | $timesplitting | |
array | $sampleids | |
array | $ranges | |
core_analytics\local\target\base | $target |
array|null |
|
protected |
Calculates indicators.
core_analytics\local\time_splitting\base | $timesplitting | |
array | $sampleids | |
array | $ranges |
array |
|
static |
Remove all possibly problematic chars from the time splitting method id (id = its full class name).
string | $timesplittingid |
string |
|
protected |
Adds time range indicators and the target to each sample.
This will identify the sample as belonging to a specific range.
core_analytics\local\time_splitting\base | $timesplitting | |
array | $dataset | |
array | null | $calculatedtarget |
null |
|
static |
Fills a cache containing the first time each analysable in the provided model was analysed.
int | $modelid | |
int | null | $analysableid |
null |
|
protected |
Filters out samples that have already been used for prediction.
int[] | $sampleids | |
array | $ranges | |
core_analytics\local\time_splitting\base | $timesplitting |
stdClass|null | The analytics_predict_samples record or null |
|
protected |
Filters out samples that have already been used for training.
int[] | $sampleids | |
core_analytics\local\time_splitting\base | $timesplitting |
null |
core_analytics\analysis::get_headers | ( | \core_analytics\local\time_splitting\base | $timesplitting, |
core_analytics\local\target\base | $target | ||
) |
Returns the headers for the csv file based on the indicators and the target.
core_analytics\local\time_splitting\base | $timesplitting | |
core_analytics\local\target\base | $target |
string[] |
|
protected |
Get analysables that have been already processed.
stdClass[] |
core_analytics\analysis::process_analysable | ( | \core_analytics\analysable | $analysable | ) |
Processes an analysable.
This method returns the general analysable status, an array of files by time splitting method and an error message if there is any problem.
core_analytics\analysable | $analysable |
stdClass[] | Results objects by time splitting method |
|
protected |
Processes the analysable samples using the provided time splitting method.
core_analytics\local\time_splitting\base | $timesplitting | |
core_analytics\analysable | $analysable | |
core_analytics\local\target\base | $target |
stdClass | Results object. |
core_analytics\analysis::run | ( | array | $contexts = [] | ) |
Runs the analysis.
context[] | $contexts | Restrict the analysis to these contexts. No context restrictions if null. |
null |
|
protected |
Saves samples that have just been used for prediction.
int[] | $sampleids | |
array | $ranges | |
core_analytics\local\time_splitting\base | $timesplitting | |
stdClass | null | $predictsamplesrecord | The existing record or null if there is no record yet. |
null |
|
protected |
Saves samples that have just been used for training.
int[] | $sampleids | |
core_analytics\local\time_splitting\base | $timesplitting |
null |
|
protected |
Updates the analysable analysis time.
array | $processedanalysables | |
int | $analysableid |
null |