You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@systemds.apache.org by ba...@apache.org on 2021/12/03 14:11:30 UTC
[systemds] 01/02: [MINOR] Set default gmmPredict model type
This is an automated email from the ASF dual-hosted git repository.
baunsgaard pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/systemds.git
commit f4d9c2af97a6e2d1ea205d63d83e7734ae3d0edd
Author: baunsgaard <ba...@tugraz.at>
AuthorDate: Fri Dec 3 14:35:26 2021 +0100
[MINOR] Set default gmmPredict model type
Also build python gmm based on it.
---
scripts/builtin/gmmPredict.dml | 2 +-
src/main/python/systemds/operator/algorithm/builtin/gmmPredict.py | 5 +++--
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/scripts/builtin/gmmPredict.dml b/scripts/builtin/gmmPredict.dml
index e054902..21a897b 100644
--- a/scripts/builtin/gmmPredict.dml
+++ b/scripts/builtin/gmmPredict.dml
@@ -44,7 +44,7 @@
# compute posterior probabilities for new instances given the variance and mean of fitted data
m_gmmPredict = function(Matrix[Double] X, Matrix[Double] weight,
- Matrix[Double] mu, Matrix[Double] precisions_cholesky, String model)
+ Matrix[Double] mu, Matrix[Double] precisions_cholesky, String model = "VVV")
return(Matrix[Double] predict, Matrix[Double] posterior_prob)
{
# compute the posterior probabilities for new instances
diff --git a/src/main/python/systemds/operator/algorithm/builtin/gmmPredict.py b/src/main/python/systemds/operator/algorithm/builtin/gmmPredict.py
index 23a6397..e4e556a 100644
--- a/src/main/python/systemds/operator/algorithm/builtin/gmmPredict.py
+++ b/src/main/python/systemds/operator/algorithm/builtin/gmmPredict.py
@@ -33,7 +33,7 @@ def gmmPredict(X: Matrix,
weight: Matrix,
mu: Matrix,
precisions_cholesky: Matrix,
- model: str):
+ **kwargs: Dict[str, VALID_INPUT_TYPES]):
"""
:param X: Matrix X (instances to be clustered)
:param weight: Weight of learned model
@@ -42,7 +42,8 @@ def gmmPredict(X: Matrix,
:param model: fitted model
:return: 'OperationNode' containing predicted cluster labels & probabilities of belongingness & for new instances given the variance and mean of fitted data
"""
- params_dict = {'X': X, 'weight': weight, 'mu': mu, 'precisions_cholesky': precisions_cholesky, 'model': model}
+ params_dict = {'X': X, 'weight': weight, 'mu': mu, 'precisions_cholesky': precisions_cholesky}
+ params_dict.update(kwargs)
vX_0 = Matrix(X.sds_context, '')
vX_1 = Matrix(X.sds_context, '')