-
Notifications
You must be signed in to change notification settings - Fork 481
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
141 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
src/main/python/systemds/operator/algorithm/builtin/ses.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# ------------------------------------------------------------- | ||
# | ||
# 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/ses.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 ses(x: Matrix, | ||
**kwargs: Dict[str, VALID_INPUT_TYPES]): | ||
""" | ||
Builtin function for simple exponential smoothing (SES). | ||
:param x: Time series vector [shape: n-by-1] | ||
:param h: Forecasting horizon | ||
:param alpha: Smoothing parameter yhat_t = alpha * x_y + (1-alpha) * yhat_t-1 | ||
:return: Forecasts [shape: h-by-1] | ||
""" | ||
|
||
params_dict = {'x': x} | ||
params_dict.update(kwargs) | ||
return Matrix(x.sds_context, | ||
'ses', | ||
named_input_nodes=params_dict) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
src/main/python/systemds/operator/algorithm/builtin/sliceLineExtract.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# ------------------------------------------------------------- | ||
# | ||
# 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/sliceLineExtract.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 sliceLineExtract(X: Matrix, | ||
e: Matrix, | ||
TK: Matrix, | ||
TKC: Matrix, | ||
**kwargs: Dict[str, VALID_INPUT_TYPES]): | ||
""" | ||
This builtin function takes the outputs of SliceLine and allows | ||
:param X: Feature matrix in recoded/binned representation | ||
:param e: Error vector of trained model | ||
:param TK: top-k slices (k x ncol(X) if successful) | ||
:param TKC: score, total/max error, size of slices (k x 4) | ||
:param k2: fist k2 slices to extract with k2 <= k | ||
:return: Selected rows from X which belong to k2 top slices | ||
:return: Selected rows from e which belong to k2 top slices | ||
""" | ||
|
||
params_dict = {'X': X, 'e': e, 'TK': TK, 'TKC': TKC} | ||
params_dict.update(kwargs) | ||
|
||
vX_0 = Matrix(X.sds_context, '') | ||
vX_1 = Matrix(X.sds_context, '') | ||
output_nodes = [vX_0, vX_1, ] | ||
|
||
op = MultiReturn(X.sds_context, 'sliceLineExtract', output_nodes, named_input_nodes=params_dict) | ||
|
||
vX_0._unnamed_input_nodes = [op] | ||
vX_1._unnamed_input_nodes = [op] | ||
|
||
return op |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters