public function trained_locally() : bool {
        global $DB;

        if (!$this->is_trained() || $this->is_static()) {
            // Early exit.
            return false;
        }

        if ($DB->record_exists('analytics_train_samples', ['modelid' => $this->model->id])) {
            return true;
        }

        return false;
    }
public function trained_locally() : bool {
        global $DB;

        if (!$this->is_trained() || $this->is_static()) {
            // Early exit.
            return false;
        }

        if ($DB->record_exists('analytics_train_samples', ['modelid' => $this->model->id])) {
            return true;
        }

        return false;
    }
public function trained_locally ( ) : bool { global $ DB ; if ( ! $ this -> is_trained ( ) || $ this -> is_static ( ) ) { // Early exit. return false ; } if ( $ DB -> record_exists ( 'analytics_train_samples' , [ 'modelid' => $ this -> model -> id ] ) ) { return true ; } return false ; }
Has the model been trained using data from this site?

This method is useful to determine if a trained model can be evaluated as
we can not use the same data for training and for evaluation.

@return bool
Has the model been trained using data from this site?