From 405ea96a047eec1436858128665005f5e00109fa Mon Sep 17 00:00:00 2001 From: e-strauss Date: Thu, 29 Jan 2026 18:50:16 +0100 Subject: [PATCH] [MINOR] Latest auto-generated python builtins + documentation --- .../operator/algorithms/scaleRobustApply.rst | 25 ++++++++++ .../systemds/operator/algorithm/__init__.py | 2 + .../algorithm/builtin/scaleRobustApply.py | 50 +++++++++++++++++++ 3 files changed, 77 insertions(+) create mode 100644 src/main/python/docs/source/api/operator/algorithms/scaleRobustApply.rst create mode 100644 src/main/python/systemds/operator/algorithm/builtin/scaleRobustApply.py diff --git a/src/main/python/docs/source/api/operator/algorithms/scaleRobustApply.rst b/src/main/python/docs/source/api/operator/algorithms/scaleRobustApply.rst new file mode 100644 index 00000000000..282c68c5aaf --- /dev/null +++ b/src/main/python/docs/source/api/operator/algorithms/scaleRobustApply.rst @@ -0,0 +1,25 @@ +.. ------------------------------------------------------------- +.. +.. Licensed to the Apache Software Foundation (ASF) under one +.. or more contributor license agreements. See the NOTICE file +.. distributed with this work for additional information +.. regarding copyright ownership. The ASF licenses this file +.. to you under the Apache License, Version 2.0 (the +.. "License"); you may not use this file except in compliance +.. with the License. You may obtain a copy of the License at +.. +.. http://www.apache.org/licenses/LICENSE-2.0 +.. +.. Unless required by applicable law or agreed to in writing, +.. software distributed under the License is distributed on an +.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +.. KIND, either express or implied. See the License for the +.. specific language governing permissions and limitations +.. under the License. +.. +.. ------------------------------------------------------------ + +scaleRobustApply +================ + +.. autofunction:: systemds.operator.algorithm.scaleRobustApply \ No newline at end of file diff --git a/src/main/python/systemds/operator/algorithm/__init__.py b/src/main/python/systemds/operator/algorithm/__init__.py index e8cb4c04e95..9996c017f6b 100644 --- a/src/main/python/systemds/operator/algorithm/__init__.py +++ b/src/main/python/systemds/operator/algorithm/__init__.py @@ -178,6 +178,7 @@ from .builtin.scale import scale from .builtin.scaleApply import scaleApply from .builtin.scaleMinMax import scaleMinMax +from .builtin.scaleRobustApply import scaleRobustApply from .builtin.selectByVarThresh import selectByVarThresh from .builtin.ses import ses from .builtin.setdiff import setdiff @@ -377,6 +378,7 @@ 'scale', 'scaleApply', 'scaleMinMax', + 'scaleRobustApply', 'selectByVarThresh', 'ses', 'setdiff', diff --git a/src/main/python/systemds/operator/algorithm/builtin/scaleRobustApply.py b/src/main/python/systemds/operator/algorithm/builtin/scaleRobustApply.py new file mode 100644 index 00000000000..21fd3c7434d --- /dev/null +++ b/src/main/python/systemds/operator/algorithm/builtin/scaleRobustApply.py @@ -0,0 +1,50 @@ +# ------------------------------------------------------------- +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +# ------------------------------------------------------------- + +# Autogenerated By : src/main/python/generator/generator.py +# Autogenerated From : scripts/builtin/scaleRobustApply.dml + +from typing import Dict, Iterable + +from systemds.operator import OperationNode, Matrix, Frame, List, MultiReturn, Scalar +from systemds.utils.consts import VALID_INPUT_TYPES + + +def scaleRobustApply(X: Matrix, + med: Matrix, + q1: Matrix, + q3: Matrix): + """ + Apply robust scaling using precomputed medians and IQRs + + + + :param X: Input feature matrix of shape n-by-m + :param med: Column medians (Q2) of shape 1-by-m + :param q1: Column first quantiles (Q1) of shape 1-by-m + :param q3: Column first quantiles (Q3) of shape 1-by-m + :return: Scaled output matrix of shape n-by-m + """ + + params_dict = {'X': X, 'med': med, 'q1': q1, 'q3': q3} + return Matrix(X.sds_context, + 'scaleRobustApply', + named_input_nodes=params_dict)