You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@systemds.apache.org by GitBox <gi...@apache.org> on 2021/07/16 10:00:35 UTC

[GitHub] [systemds] dkerschbaumer commented on a change in pull request #1334: [WIP] [AMLS] XGBoost

dkerschbaumer commented on a change in pull request #1334:
URL: https://github.com/apache/systemds/pull/1334#discussion_r671123785



##########
File path: scripts/builtin/xgboostPredict.dml
##########
@@ -0,0 +1,147 @@
+# INPUT PARAMETERS:
+# ----------------------------------------------------------------------------
+# NAME                              TYPE      DEFAULT  MEANING
+# ----------------------------------------------------------------------------
+# X                                 Matrix    ---      Matrix of feature vectors we want to predict (X_test)
+# M                                 Matrix    ---      The model created at xgboost
+# sml_type                          Integer   1        Supervised machine learning type: 1 = Regression(default), 2 = Classification
+# learning_rate                     Double    0.3     the learning rate used in the model
+
+# RETURN VALUES
+# ----------------------------------------------------------------------------
+# NAME     TYPE      DEFAULT  MEANING
+# ----------------------------------------------------------------------------
+# P        Matrix    ---     The predictions of the samples using the given xgboost model. (y_prediction)
+# ----------------------------------------------------------------------------
+
+m_xgboostPredict = function(Matrix[Double] X, Matrix[Double] M, Integer sml_type = 1, Double learning_rate = 0.3
+) return (Matrix[Double] P) {
+
+  nr_trees = max(M[2,])
+  P = matrix(0, rows=nrow(X), cols=1)
+  initial_prediction = M[6,1]
+  trees_M_offset = calculateTreesOffset(M)
+  if(sml_type == 1) # Regression

Review comment:
       Done in https://github.com/apache/systemds/pull/1334/commits/c750df72571574b0c59d2cec7a732d5d6a558ef2




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@systemds.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org