def run_extra_tree(self):
     self.log.info(
         "Running prediction for patient {} using algorithm '{}'".format(
             self.patientId, 'Extremely Random Forest Regression'))
     if not self.batch:
         results = CLFManager.factory(self.patientId, model="et").predict()
         return results
     else:
         clf = CLFManager.factory(self.patientId, model="et")
         return clf.batch_predict(), clf._allFeatureDesp
 def run_incremental_random_forest(self):
     self.log.info(
         "Running prediction for patient {} using algorithm '{}'".format(
             self.patientId, 'Random Forest Regression'))
     results = CLFManager.factory(self.patientId,
                                  model="incremental").predict()
     return results
 def run_global(self):
     '''
     Run global model
     :return:
     '''
     self.log.info(
         "Running global classification using algorithm '{}'".format(
             self.patientId, 'Naive Bayes'))
     return CLFManager.factory(model="global").predict()
 def run_nb(self):
     '''
     Run Naive Bayes
     :return:
     '''
     self.log.info(
         "Running classification for patient {} using algorithm '{}'".
         format(self.patientId, 'Naive Bayes'))
     return CLFManager.factory(self.patientId, model="nb").predict()
 def run_svm(self):
     '''
     Run SVM
     :return:
     '''
     self.log.info(
         "Running classification for patient {} using algorithm '{}'".
         format(self.patientId, 'SVM'))
     return CLFManager.factory(self.patientId, model="svm").predict()
 def run_dummy(self):
     '''
     Run Dummy classifier
     :return:
     '''
     self.log.info(
         "Running classification for patient {} using algorithm '{}'".
         format(self.patientId, 'Dummy'))
     return CLFManager.factory(self.patientId, model="dummy").predict()
 def run_extra_tree_classifier(self):
     '''
     Run Extr TRee Classifier
     :return:
     '''
     self.log.info(
         "Running classification for patient {} using algorithm '{}'".
         format(self.patientId, 'Extremely Random Forest'))
     return CLFManager.factory(self.patientId, model="etc").predict()
 def run_random_forest_classifier(self):
     '''
     Run Random Forest Classifier
     :return:
     '''
     self.log.info(
         "Running classification for patient {} using algorithm '{}'".
         format(self.patientId, 'Random Forest'))
     return CLFManager.factory(self.patientId, model="rfc").predict()
    def run_fixed_model(self):
        """
        Runs RNN prediction.
        :return:
        """
        self.log.info(
            "Running prediction for patient {} using algorithm '{}'".format(
                self.patientId, 'FixedModel'))
        fixed_model = CLFManager.factory(self.patientId, model="fm")

        return fixed_model.predict()
    def run_rnn(self):
        """
        Runs RNN prediction.
        :return:
        """
        self.log.info(
            "Running prediction for patient {} using algorithm '{}'".format(
                self.patientId, 'Recurrent Neural Networks'))
        rnn = CLFManager.factory(self.patientId, model="rnn")

        return rnn.predict()
    def run_lstm(self):
        """
        Runs LSTM prediction.
        :return:
        """
        self.log.info(
            "Running prediction for patient {} using algorithm '{}'".format(
                self.patientId, 'LSTM-Recurrent Neural Networks'))
        lstm = CLFManager.factory(self.patientId, model="lstm")

        return lstm.predict()
    def run_arima(self):
        """
        Runs ARIMA prediction.
        :return:
        """
        self.log.info(
            "Running prediction for patient {} using algorithm '{}'".format(
                self.patientId, 'ARIMA'))
        arima = CLFManager.factory(self.patientId, model="arima")

        return arima.predict()
 def run_avg(self):
     self.log.info(
         "Running prediction for patient {} using algorithm '{}'".format(
             self.patientId, 'Avg training value'))
     return CLFManager.factory(self.patientId, model="avg").predict()
 def run_linear_regression(self):
     self.log.info(
         "Running prediction for patient {} using algorithm '{}'".format(
             self.patientId, 'Linear Regression'))
     return CLFManager.factory(self.patientId, model="lr").predict()
 def run_context_avg(self):
     self.log.info(
         "Running prediction for patient {} using algorithm '{}'".format(
             self.patientId, 'Weigted AVG in similar context'))
     return CLFManager.factory(self.patientId, model="contextavg").predict()
 def run_last_value(self):
     self.log.info(
         "Running prediction for patient {} using algorithm '{}'".format(
             self.patientId, 'Last value'))
     return CLFManager.factory(self.patientId, model="last").predict()