Datasets manager.  
 More...
|  | 
|  | __construct ($modelid, $analysableid, $timesplittingid, $filearea, $evaluation=false) | 
|  | Constructor method. 
 | 
|  | 
|  | store ($data) | 
|  | Store the dataset in the internal file system. 
 | 
|  | 
|  | 
| static | clear_model_files ($modelid) | 
|  | Delete all files of a model. 
 | 
|  | 
| static | delete_previous_evaluation_file ($modelid, $timesplittingid) | 
|  | Deletes previous evaluation files of this model. 
 | 
|  | 
| static | export_training_data ($modelid, $timesplittingid) | 
|  | Exports the model training data. 
 | 
|  | 
| static | get_evaluation_analysable_file ($modelid, $analysableid, $timesplittingid) | 
|  | Returns this (model + analysable + time splitting) file. 
 | 
|  | 
| static | get_pending_files ($modelid, $includetarget, $timesplittingids) | 
|  | Gets the list of files that couldn't be previously used for training and prediction. 
 | 
|  | 
| static | get_previous_evaluation_file ($modelid, $timesplittingid) | 
|  | Returns the previous evaluation file. 
 | 
|  | 
| static | get_structured_data (\stored_file $dataset) | 
|  | Returns the dataset file data structured by sampleids using the indicators and target column names. 
 | 
|  | 
| static | merge_datasets (array $files, $modelid, $timesplittingid, $filearea, $evaluation=false) | 
|  | Merge multiple files into one. 
 | 
|  | 
|  | 
| const | EVALUATION_FILENAME = 'evaluation.csv' | 
|  | Evaluation file file name. 
 | 
|  | 
| const | EXPORT_FILEAREA = 'export' | 
|  | File area for exported datasets. 
 | 
|  | 
| const | LABELLED_FILEAREA = 'labelled' | 
|  | File area for labelled datasets. 
 | 
|  | 
| const | UNLABELLED_FILEAREA = 'unlabelled' | 
|  | File area for unlabelled datasets. 
 | 
|  | 
|  | 
| static | get_filename ($evaluation) | 
|  | Returns the file name to be used. 
 | 
|  | 
|  | 
| int | $analysableid | 
|  | 
| bool | $evaluation | 
|  | Whether this is a dataset for evaluation or not. 
 | 
|  | 
| string | $filearea | 
|  | The dataset filearea. 
 | 
|  | 
| int | $modelid | 
|  | The model id. 
 | 
|  | 
| string | $timesplittingid | 
|  | Range processor in use. 
 | 
|  | 
Datasets manager. 
- Copyright
- 2016 David Monllao  
- License
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 
◆ __construct()
      
        
          | core_analytics\dataset_manager::__construct | ( |  | $modelid, | 
        
          |  |  |  | $analysableid, | 
        
          |  |  |  | $timesplittingid, | 
        
          |  |  |  | $filearea, | 
        
          |  |  |  | $evaluation = false ) | 
      
 
Constructor method. 
- Exceptions
- 
  
  
- Parameters
- 
  
    | int | $modelid |  |  | int | $analysableid |  |  | string | $timesplittingid |  |  | string | $filearea |  |  | bool | $evaluation |  |  
 
- Return values
- 
  
  
 
 
◆ clear_model_files()
  
  | 
        
          | static core_analytics\dataset_manager::clear_model_files | ( |  | $modelid | ) |  |  | static | 
 
Delete all files of a model. 
- Parameters
- 
  
  
- Return values
- 
  
  
 
 
◆ delete_previous_evaluation_file()
  
  | 
        
          | static core_analytics\dataset_manager::delete_previous_evaluation_file | ( |  | $modelid, |  
          |  |  |  | $timesplittingid ) |  | static | 
 
Deletes previous evaluation files of this model. 
- Parameters
- 
  
    | int | $modelid |  |  | string | $timesplittingid |  |  
 
- Return values
- 
  
  
 
 
◆ export_training_data()
  
  | 
        
          | static core_analytics\dataset_manager::export_training_data | ( |  | $modelid, |  
          |  |  |  | $timesplittingid ) |  | static | 
 
Exports the model training data. 
- Parameters
- 
  
    | int | $modelid |  |  | string | $timesplittingid |  |  
 
- Return values
- 
  
  
 
 
◆ get_evaluation_analysable_file()
  
  | 
        
          | static core_analytics\dataset_manager::get_evaluation_analysable_file | ( |  | $modelid, |  
          |  |  |  | $analysableid, |  
          |  |  |  | $timesplittingid ) |  | static | 
 
Returns this (model + analysable + time splitting) file. 
- Parameters
- 
  
    | int | $modelid |  |  | int | $analysableid |  |  | string | $timesplittingid |  |  
 
- Return values
- 
  
  
 
 
◆ get_filename()
  
  | 
        
          | static core_analytics\dataset_manager::get_filename | ( |  | $evaluation | ) |  |  | staticprotected | 
 
Returns the file name to be used. 
- Parameters
- 
  
  
- Return values
- 
  
  
 
 
◆ get_pending_files()
  
  | 
        
          | static core_analytics\dataset_manager::get_pending_files | ( |  | $modelid, |  
          |  |  |  | $includetarget, |  
          |  |  |  | $timesplittingids ) |  | static | 
 
Gets the list of files that couldn't be previously used for training and prediction. 
- Parameters
- 
  
    | int | $modelid |  |  | bool | $includetarget |  |  | string[] | $timesplittingids |  |  
 
- Return values
- 
  
  
 
 
◆ get_previous_evaluation_file()
  
  | 
        
          | static core_analytics\dataset_manager::get_previous_evaluation_file | ( |  | $modelid, |  
          |  |  |  | $timesplittingid ) |  | static | 
 
Returns the previous evaluation file. 
Important to note that this is per modelid + timesplittingid, when dealing with multiple analysables this is the merged file. Do not confuse with self\get_evaluation_analysable_file
- Parameters
- 
  
    | int | $modelid |  |  | string | $timesplittingid |  |  
 
- Return values
- 
  
  
 
 
◆ get_structured_data()
  
  | 
        
          | static core_analytics\dataset_manager::get_structured_data | ( | \stored_file | $dataset | ) |  |  | static | 
 
Returns the dataset file data structured by sampleids using the indicators and target column names. 
- Parameters
- 
  
  
- Return values
- 
  
  
 
 
◆ merge_datasets()
  
  | 
        
          | static core_analytics\dataset_manager::merge_datasets | ( | array | $files, |  
          |  |  |  | $modelid, |  
          |  |  |  | $timesplittingid, |  
          |  |  |  | $filearea, |  
          |  |  |  | $evaluation = false ) |  | static | 
 
Merge multiple files into one. 
Important! It is the caller responsability to ensure that the datasets are compatible.
- Parameters
- 
  
    | array | $files |  |  | int | $modelid |  |  | string | $timesplittingid |  |  | string | $filearea |  |  | bool | $evaluation |  |  
 
- Return values
- 
  
  
 
 
◆ store()
      
        
          | core_analytics\dataset_manager::store | ( |  | $data | ) |  | 
      
 
Store the dataset in the internal file system. 
- Parameters
- 
  
  
- Return values
- 
  
  
 
 
◆ $filearea
  
  | 
        
          | string core_analytics\dataset_manager::$filearea |  | protected | 
 
The dataset filearea. 
Must be one of the self::*_FILEAREA options. 
 
 
The documentation for this class was generated from the following file: