This files describes API changes in analytics sub system, information provided here is intended especially for developers. === 3.7 === * \core_analytics\regressor::evaluate_regression and \core_analytics\classifier::evaluate_classification have been updated to include a new $trainedmodeldir param. This new param will be used to evaluate the existing trained model. * Plugins and core subsystems can now declare default prediction models by describing them in their db/analytics.php file. Models should not be created manually via the db/install.php file any more. * The method \core_analytics\manager::add_builtin_models() has been deprecated. The functionality has been replaced with automatic update of models provided by the core moodle component. There is no need to call this method explicitly any more. Instead, adding new models can be achieved by updating the lib/db/analytics.php file and bumping the core version. * \core_analytics\model::execute_prediction_callbacks now returns an array with both sample's contexts and the prediction records. * \core_analytics\model::export() now expects the renderer instance as an argument. * Time splitting methods: * \core_analytics\local\time_splitting\base::append_rangeindex and \core_analytics\local\time_splitting\base::infer_sample_info are now marked as final and can not be overwritten. * Can now overwrite include_range_info_in_training_data() and get_training_ranges() methods. They can be used to create time splitting methods with a pre-defined number of ranges. * Can now overwrite cache_indicator_calculations(). You should return false if the time frames generated by your time-splitting method are unique and / or can hardly be reused by further models. * Can now overwrite valid_for_evaluation(). You can return false if the time-splitting method can not be used to evaluate prediction models or if it does not make sense to evaluate prediction models with it, as for example upcoming_periodic children classes. * \core_analytics\local\analyser\base::get_most_recent_prediction_range has been moved to \core_analytics\local\time_splitting\base::get_most_recent_prediction_range and it is not overwritable by time splitting methods. * Targets: * The visibility of the following methods must now be public: ignored_predicted_classes() and get_insights_users() * Prediction_actions() has now a 3rd parameter $isinsightuser. This parameter is true when we are listing actions for the user that will receives the insight. * Can now implement a always_update_analysis_time() method so analysable elements' timeanalysed is only updated when analysable elements have been successfully evaluated. It is useful for lightweight targets. * Can not implement two new methods to tune the insights generated by the model: get_insight_subject() and get_insight_context_url(). * Analysers: * The visibility of get_all_samples() method must now be public. * get_analysables() method has been deprecated in favour of a new get_analysables_interator() for performance reasons. * Can overwrite a new one_sample_per_analysable() method if the analysables they use only have one sample. The insights generated by models will then include the suggested actions in the notification. === 3.5 === * There are two new methods for analysers, processes_user_data() and join_sample_user(). You need to overwrite them if your analyser uses user data. As a general statement, you should overwrite these new methods if your samples return 'user' data. These new methods are used for analytics' privacy API implementation.