Commit Graph

86 Commits

Author SHA1 Message Date
Eloy Lafuente (stronk7) ba1f804ffa MDL-65292 style: Fix all function declarations white space
This has been generated running the following Sniffs, all
them part of the Moodle's CodeSniffer standard:
- PSR12.Functions.ReturnTypeDeclaration
- PSR12.Functions.NullableTypeDeclaration
- moodle.Methods.MethodDeclarationSpacing
- Squiz.Whitespace.ScopeKeywordSpacing

All them are, exclusively, about correct spacing, so the changes
are, all them, only white space changes.

Only exceptions to the above are 3 changes what were setting the
return type in a new line, and, when that happens, the closing
parenthesis (bracket) has to go to the same line than the colon.
2024-02-28 23:33:26 +01:00
Marina Glancy b0a83aa7bd MDL-76362 various: Avoid passing nulls to functions that don't allow nulls
PHP 8.1 is more strict on the parameter type. Functions such as trim(), strlen(), str_replace(), etc
show notice when null is passed as an argument
2023-01-23 09:15:54 +08:00
Paul Holden cecd90ffec MDL-66392 analytics: make model output directory default to empty.
Falling back to path within $CFG->dataroot/models.
2020-10-21 18:04:26 +01:00
David Monllaó 47b506e2f7 MDL-67039 analytics: Unidimensional array if no predictions 2019-11-04 09:32:05 +08:00
David Monllaó ef05f29267 MDL-67038 analytics: Remove null strings from the DB 2019-10-30 12:40:32 +08:00
David Monllaó 76b5ee4545 MDL-64739 tool_analytics: Restrict models to specific contexts 2019-10-21 09:54:39 +08:00
Eloy Lafuente (stronk7) 20502fa30c Merge branch 'MDL-66004_master' of git://github.com/dmonllao/moodle 2019-10-02 20:53:24 +02:00
David Monllaó aa5b705607 MDL-66004 mlbackend_python: Package installed on a separate server 2019-10-02 08:41:14 +08:00
David Monllaó 386d109172 MDL-62191 analytics: Support for bulk actions 2019-09-27 14:13:52 +08:00
David Monllaó 16cb4f32a0 MDL-66536 analytics: Indicators can add extra data for targets 2019-09-18 13:07:21 +08:00
David Monllaó b024720499 MDL-66536 analytics: Bulk-fetch samples data
For one_sample_per_analysable models.
2019-09-18 13:04:30 +08:00
David Monllaó 93e71c712d MDL-66091 report_insights: Unify contextwithinsights cache sets 2019-09-18 13:00:06 +08:00
David Monllaó 486e797c5f MDL-66091 analytics: Targets choose if there should be a report or not 2019-09-17 13:58:55 +08:00
David Monllaó abc745fbd0 MDL-66498 analytics: get_samples() with no params limit 2019-09-11 12:44:55 +08:00
David Monllaó 4fd74fba6f MDL-66498 analytics: Avoid get_in_or_equal for big arrays
Also, join directly with context table.
2019-09-11 12:44:55 +08:00
David Monllaó 5ef49c591a MDL-65633 tool_analytics: Notification for invalid analysis intervals 2019-07-18 18:38:13 +02:00
David Monllaó 3cb0aaaa8c MDL-65633 analytics: New interfaces for time-splitting methods 2019-07-18 18:38:13 +02:00
David Monllaó 1d5cb38292 MDL-65562 analytics: New get_prediction_actions API 2019-07-09 13:36:11 +02:00
Adrian Greeve d15589bc08 Merge branch 'MDL-65601_master' of git://github.com/dmonllao/moodle 2019-05-16 13:25:44 +08:00
David Monllaó 589a3f57a0 MDL-65601 analytics: Add missing set_modelid calls 2019-05-15 09:34:35 +02:00
David Monllaó a1fb183df0 MDL-65583 tool_analytics: Model name from a data attribute
The credit and the patch using this approach goes to David Mudrák.
2019-05-13 22:54:28 +02:00
David Mudrák 066a4d6493 MDL-64786 analytics: Allow renaming models via inplace editable element 2019-04-15 08:22:13 +02:00
David Mudrák ed47112e1b MDL-64786 analytics: Add missing parameter to model::export() method
All methods that export an object to be rendered via a template, must
have the instance of a renderer available.
2019-04-15 08:17:45 +02:00
David Monllaó 982fef46f4 MDL-64783 analytics: Activities due insight forwards to calendar
The patch includes changes applied after the peer review.
2019-04-09 00:29:57 +02:00
David Monllaó 9f690999ec MDL-64783 analytics: Performance improvements and internal refactoring
The base classes analyser and time-splitting method had too many
reponsibilities. A new analysis class has been created.
2019-04-09 00:26:39 +02:00
David Monllaó e85c2f372b MDL-64783 analytics: Improvements to the insights system 2019-04-09 00:26:23 +02:00
David Monllaó 50935afba4 MDL-64783 analytics: Upcoming activities due and related API changes 2019-04-09 00:25:24 +02:00
Eloy Lafuente (stronk7) 481c1ae4ce Merge branch 'MDL-64779_master' of git://github.com/dmonllao/moodle 2019-04-02 23:23:13 +02:00
David Monllaó f54a4092c7 MDL-61667 analytics: Remove duplicated capability checks
\core_analytics\model::create and \core_analytics\model::enable methods
are called from install/upgrade scripts. Therefore, they should not
include any capability check. Their capability checks are actually
redundant, as the user capabilities are already checked in the
entry-point scripts.
2019-04-01 14:57:57 +02:00
David Mudrák aa8af6fcfc MDL-61667 analytics: Fix checking that a given model does not exist
The original implementation did not work well for checking that the
given model does NOT exist. If no record was found in the
analytics_models table, the code execution continued and it reached the
moment when indicators were checked. If no indicators were provided, the
call ended up with error 'array_keys() expects parameter 1 to be array,
boolean given' (because indicators were set to false).
2019-04-01 14:23:06 +02:00
David Mudrák 4de4d1652b MDL-61667 analytics: Don't autoenable models with time splitting defined
When the API had originally been designed, it was assumed that the
presence of the time splitting method implies no requirement for the
machine learning backend and that it is a sign of less performance
demanding models. So it seemed to be safe and useful to have such models
automatically enabled. That assumption did not prove to be valid. Most
of the time is spent calculating indicators that depend on log tables.

We realized it would be useful to be able to specify the default time
splitting method without the need to have such models auto-enabled.
2019-04-01 14:23:06 +02:00
David Monllaó 75dfc588b5 MDL-64779 tool_analytics: Export selector 2019-04-01 13:56:37 +02:00
David Mudrák c679d39c36 MDL-64996 analytics: Don't mark static model as untrained after clearing
Static predictions models (i.e. those using a target based on
assumptions, not facts) are always considered as trained. Clearing them
must not mark them as untrained. Doing so would make them being skipped
by the prediction scheduled task.
2019-03-25 08:56:11 +01:00
David Monllaó 3576b66bfd MDL-60936 analytics: Timesplittings setting only for evaluation 2019-03-18 09:34:52 +01:00
David Monllaó e97dfff78d MDL-64787 tool_analytics: Include training data source in the log table 2019-03-07 20:44:48 +01:00
David Monllaó bc82b89586 MDL-64787 mlbackend: Evaluate trained models 2019-03-07 20:43:30 +01:00
David Monllaó 74823933c8 MDL-64787 tool_analytics: UI for trained models evaluation 2019-03-07 20:43:30 +01:00
David Monllaó c70a7194f4 MDL-60944 analytics: Include trained ML models 2019-02-26 10:58:41 +01:00
David Monllaó e4453adc55 MDL-60944 tool_analytics: Adding create and delete features
Extra modifications to refine the preexisting patch.
2019-02-25 09:54:07 +01:00
Ankit Agarwal 349c44128d MDL-60944 analytics: Add base support for import / export 2019-02-25 09:54:07 +01:00
Eloy Lafuente (stronk7) bd5fdcfccd MDL-63422 general: review core loop / switch / case / continue
This commit reviews all continue uses in core happening within a
loop / switch / case hierarchy. This does not cover:

- Changes to libraries. Will be handled in another issue / commit.
- Uses out from loops, will be reviewed by other commit.

The policy followed has been:
- When possible, take rid of the continue.
- When clearly the intention was to jump to next element in loop
  change to continue 2
- When it was not clear, keep old behavior switching to break, no
  matter how weird the behavior may be.
2018-10-31 00:17:59 +01:00
David Monllao d44ce97fe1 MDL-60520 analytics: Do not block model updates if the backend is down 2018-10-22 13:58:33 +02:00
David Monllao ed12ba6ba8 MDL-60520 analytics: Per-model ml backend 2018-10-22 13:58:33 +02:00
Ankit Agarwal fabe98ac92 MDL-60861 analytics: Enabling a model requires timesplitting 2017-12-11 10:47:01 +05:30
David Monllao 0af2421acd MDL-59988 analytics: Reset trained status on clear 2017-10-18 07:02:23 +02:00
Andrew Nicols 0b53be9056 Merge branch 'MDL-59987_master' of git://github.com/dmonllao/moodle 2017-10-17 12:00:51 +08:00
David Monllao 2dca133916 MDL-59988 analytics: Process pending training and prediction files 2017-10-13 12:29:21 +02:00
David Monllao 325b3bdd8e MDL-59988 analytics: Files marked as used only if valid
- Basic unit test for minimum machine learning backends requirements
- Warning return messages now include not enough data
- Clear models when the predictions processor is changed
- Refined the name of a couple of constants / methods
2017-10-13 12:24:17 +02:00
Jake Dallimore 0ce9026307 Merge branch 'MDL-59106_master' of git://github.com/markn86/moodle 2017-10-12 10:53:20 +08:00
David Monllao dd13fc222c MDL-59694 analytics: Track processed analysables 2017-10-09 07:47:28 +02:00