This is an automated email from the ASF dual-hosted git repository. baunsgaard pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/systemds.git
commit 15c2e812d9c1c113bb05392ea4ab32e518b6e859 Author: baunsgaard <[email protected]> AuthorDate: Wed Apr 28 13:04:39 2021 +0200 [SYSTEMDS-2882] Cleanup - Move homes data to resources folder. - generate algorithms again, to fix merge issue. --- .../python/systemds/operator/algorithm/__init__.py | 3 +++ src/main/python/tests/frame/__init__.py | 20 ++++++++++++++++++++ src/main/python/tests/frame/data/homes.csv | 21 --------------------- src/main/python/tests/frame/test_transform_apply.py | 8 ++++---- .../python/tests/frame/test_transform_encode.py | 8 ++++---- .../datasets/homes}/homes.tfspec_bin2.json | 0 .../datasets/homes}/homes.tfspec_recode2.json | 0 7 files changed, 31 insertions(+), 29 deletions(-) diff --git a/src/main/python/systemds/operator/algorithm/__init__.py b/src/main/python/systemds/operator/algorithm/__init__.py index 25d4602..b3bcd3d 100644 --- a/src/main/python/systemds/operator/algorithm/__init__.py +++ b/src/main/python/systemds/operator/algorithm/__init__.py @@ -41,6 +41,7 @@ from .builtin.dbscan import dbscan from .builtin.decisionTree import decisionTree from .builtin.discoverFD import discoverFD from .builtin.dist import dist +from .builtin.gaussianClassifier import gaussianClassifier from .builtin.getAccuracy import getAccuracy from .builtin.glm import glm from .builtin.gmm import gmm @@ -61,6 +62,7 @@ from .builtin.kmeans import kmeans from .builtin.kmeansPredict import kmeansPredict from .builtin.knnbf import knnbf from .builtin.l2svm import l2svm +from .builtin.l2svmPredict import l2svmPredict from .builtin.lasso import lasso from .builtin.lm import lm from .builtin.lmCG import lmCG @@ -93,6 +95,7 @@ from .builtin.splitBalanced import splitBalanced from .builtin.statsNA import statsNA from .builtin.steplm import steplm from .builtin.toOneHot import toOneHot +from .builtin.tomeklink import tomeklink from .builtin.univar import univar from .builtin.vectorToCsv import vectorToCsv from .builtin.winsorize import winsorize diff --git a/src/main/python/tests/frame/__init__.py b/src/main/python/tests/frame/__init__.py new file mode 100644 index 0000000..e66abb4 --- /dev/null +++ b/src/main/python/tests/frame/__init__.py @@ -0,0 +1,20 @@ +# ------------------------------------------------------------- +# +# 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. +# +# ------------------------------------------------------------- diff --git a/src/main/python/tests/frame/data/homes.csv b/src/main/python/tests/frame/data/homes.csv deleted file mode 100644 index a8d6fab..0000000 --- a/src/main/python/tests/frame/data/homes.csv +++ /dev/null @@ -1,21 +0,0 @@ -zipcode,district,sqft,numbedrooms,numbathrooms,floors,view,saleprice,askingprice -95141,west,1373,7,1,3,FALSE,695,698 -91312,south,3261,6,2,2,FALSE,902,906 -94555,north,1835,3,3,3,TRUE,888,892 -95141,east,2833,6,2.5,2,TRUE,927,932 -96334,south,2742,6,2.5,2,FALSE,872,876 -96334,north,2195,5,2.5,2,FALSE,799,803 -98755,north,3469,7,2.5,2,FALSE,958,963 -96334,west,1685,7,1.5,2,TRUE,757,760 -95141,west,2238,4,3,3,FALSE,894,899 -91312,west,1245,4,1,1,FALSE,547,549 -98755,south,3702,7,3,1,FALSE,959,964 -98755,north,1865,7,1,2,TRUE,742,745 -94555,north,3837,3,1,1,FALSE,839,842 -91312,west,2139,3,1,3,TRUE,820,824 -95141,north,3824,4,3,1,FALSE,954,958 -98755,east,2858,5,1.5,1,FALSE,759,762 -91312,south,1827,7,3,1,FALSE,735,738 -91312,south,3557,2,2.5,1,FALSE,888,892 -91312,south,2553,2,2.5,2,TRUE,884,889 -96334,west,1682,3,1.5,1,FALSE,625,628 \ No newline at end of file diff --git a/src/main/python/tests/frame/test_transform_apply.py b/src/main/python/tests/frame/test_transform_apply.py index 8b41efa..a85c83d 100644 --- a/src/main/python/tests/frame/test_transform_apply.py +++ b/src/main/python/tests/frame/test_transform_apply.py @@ -35,8 +35,9 @@ from systemds.matrix import Matrix class TestTransformApply(unittest.TestCase): sds: SystemDSContext = None - HOMES_PATH = "tests/frame/data/homes.csv" + HOMES_PATH = "../../test/resources/datasets/homes/homes.csv" HOMES_SCHEMA = '"int,string,int,int,double,int,boolean,int,int"' + JSPEC_PATH = "../../test/resources/datasets/homes/homes.tfspec_bin2.json" @classmethod def setUpClass(cls): @@ -50,8 +51,7 @@ class TestTransformApply(unittest.TestCase): pass def test_apply_recode_bin(self): - JSPEC_PATH = "tests/frame/data/homes.tfspec_bin2.json" - with open(JSPEC_PATH) as jspec_file: + with open(self.JSPEC_PATH) as jspec_file: JSPEC = json.load(jspec_file) F1 = self.sds.read( self.HOMES_PATH, @@ -61,7 +61,7 @@ class TestTransformApply(unittest.TestCase): header=True, ) pd_F1 = F1.compute() - jspec = self.sds.read(JSPEC_PATH, data_type="scalar", value_type="string") + jspec = self.sds.read(self.JSPEC_PATH, data_type="scalar", value_type="string") X, M = F1.transform_encode(spec=jspec).compute() self.assertTrue(isinstance(X, np.ndarray)) self.assertTrue(isinstance(M, pd.DataFrame)) diff --git a/src/main/python/tests/frame/test_transform_encode.py b/src/main/python/tests/frame/test_transform_encode.py index 4e88190..ef800b0 100644 --- a/src/main/python/tests/frame/test_transform_encode.py +++ b/src/main/python/tests/frame/test_transform_encode.py @@ -35,8 +35,9 @@ from systemds.matrix import Matrix class TestTransformEncode(unittest.TestCase): sds: SystemDSContext = None - HOMES_PATH = "tests/frame/data/homes.csv" + HOMES_PATH = "../../test/resources/datasets/homes/homes.csv" HOMES_SCHEMA = '"int,string,int,int,double,int,boolean,int,int"' + JSPEC_PATH = "../../test/resources/datasets/homes/homes.tfspec_recode2.json" @classmethod def setUpClass(cls): @@ -50,8 +51,7 @@ class TestTransformEncode(unittest.TestCase): pass def test_encode_recode(self): - JSPEC_PATH = "tests/frame/data/homes.tfspec_recode2.json" - with open(JSPEC_PATH) as jspec_file: + with open(self.JSPEC_PATH) as jspec_file: JSPEC = json.load(jspec_file) F1 = self.sds.read( self.HOMES_PATH, @@ -61,7 +61,7 @@ class TestTransformEncode(unittest.TestCase): header=True, ) pd_F1 = F1.compute() - jspec = self.sds.read(JSPEC_PATH, data_type="scalar", value_type="string") + jspec = self.sds.read(self.JSPEC_PATH, data_type="scalar", value_type="string") X, M = F1.transform_encode(spec=jspec).compute() self.assertTrue(isinstance(X, np.ndarray)) self.assertTrue(isinstance(M, pd.DataFrame)) diff --git a/src/main/python/tests/frame/data/homes.tfspec_bin2.json b/src/test/resources/datasets/homes/homes.tfspec_bin2.json similarity index 100% rename from src/main/python/tests/frame/data/homes.tfspec_bin2.json rename to src/test/resources/datasets/homes/homes.tfspec_bin2.json diff --git a/src/main/python/tests/frame/data/homes.tfspec_recode2.json b/src/test/resources/datasets/homes/homes.tfspec_recode2.json similarity index 100% rename from src/main/python/tests/frame/data/homes.tfspec_recode2.json rename to src/test/resources/datasets/homes/homes.tfspec_recode2.json
