|
| 1 | +import unittest |
| 2 | + |
1 | 3 | from django.test import TestCase |
2 | 4 |
|
3 | 5 | from core.core import calculate |
4 | | -from core.tests.test_prepare import split_double, add_default_config |
| 6 | +from core.tests.test_prepare import split_double, add_default_config, split_single |
5 | 7 | from encoders.encoding_container import EncodingContainer, SIMPLE_INDEX, ZERO_PADDING, BOOLEAN, COMPLEX, LAST_PAYLOAD |
6 | | -from encoders.label_container import LabelContainer |
| 8 | +from encoders.label_container import LabelContainer, REMAINING_TIME |
7 | 9 |
|
8 | 10 |
|
9 | 11 | class TestRegression(TestCase): |
@@ -74,3 +76,31 @@ def test_reg_lasso_last_payload(self): |
74 | 76 | job['encoding'] = EncodingContainer(LAST_PAYLOAD, padding=ZERO_PADDING) |
75 | 77 | add_default_config(job) |
76 | 78 | calculate(job) |
| 79 | + |
| 80 | + |
| 81 | +@unittest.skip("evaluation test not needed normally") |
| 82 | +class TestEvaluation(TestCase): |
| 83 | + @property |
| 84 | + def get_job(self): |
| 85 | + json = dict() |
| 86 | + json["clustering"] = "noCluster" |
| 87 | + json["split"] = split_single() |
| 88 | + json['split']['original_log_path'] = 'log_cache/Sepsis Cases - Event Log.xes' |
| 89 | + json["method"] = "lasso" |
| 90 | + json["encoding"] = EncodingContainer(COMPLEX, padding=ZERO_PADDING, prefix_length=16) |
| 91 | + json["label"] = LabelContainer(REMAINING_TIME) |
| 92 | + json["type"] = "regression" |
| 93 | + return json |
| 94 | + |
| 95 | + def test_reg_lasso(self): |
| 96 | + job = self.get_job |
| 97 | + add_default_config(job) |
| 98 | + calculate(job) |
| 99 | + |
| 100 | + def test_reg_intercase(self): |
| 101 | + print('interace') |
| 102 | + job = self.get_job |
| 103 | + job["label"] = LabelContainer(REMAINING_TIME, add_resources_used=True, add_new_traces=True, |
| 104 | + add_executed_events=True) |
| 105 | + add_default_config(job) |
| 106 | + calculate(job) |
0 commit comments