Skip to content

Commit

Permalink
Fixed test
Browse files Browse the repository at this point in the history
  • Loading branch information
MatsMoll committed May 20, 2024
1 parent 5d434d8 commit f2dd225
Show file tree
Hide file tree
Showing 6 changed files with 106 additions and 106 deletions.
2 changes: 1 addition & 1 deletion aligned/feature_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -1608,7 +1608,7 @@ def between_dates(self, start_date: datetime, end_date: datetime) -> RetrivalJob
if self.feature_filter:
request = self.view.request_for(self.feature_filter)
return SelectColumnsJob(
self.feature_filter, self.source.all_between(start_date, end_date, request)
list(self.feature_filter), self.source.all_between(start_date, end_date, request)
)

request = self.view.request_all
Expand Down
2 changes: 1 addition & 1 deletion aligned/tests/test_train_test_validate_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ async def test_train_test_validate_set_new(titanic_feature_store: ContractStore)
validate_size = int(round(dataset_size * validation_fraction))

dataset_store = FileSource.json_at('test_data/titanic-sets.json')
dataset = (
dataset = await (
titanic_feature_store.feature_view('titanic')
.all(limit=dataset_size)
.train_test_validate(train_fraction, validation_fraction, target_column='survived')
Expand Down
2 changes: 1 addition & 1 deletion test_data/titanic-sets.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"raw_data": [], "train_test": [], "train_test_validation": [{"id": "titanic_test", "name": null, "request_result": {"entities": [{"name": "passenger_id", "dtype": {"name": "int32"}, "description": null, "tags": null, "constraints": null}], "features": [{"name": "name", "dtype": {"name": "string"}, "description": null, "tags": null, "constraints": [{"name": "optional"}]}, {"name": "sex", "dtype": {"name": "string"}, "description": null, "tags": null, "constraints": [{"name": "optional"}, {"name": "in_domain", "values": ["male", "female"]}]}, {"name": "sibsp", "dtype": {"name": "int32"}, "description": "Number of siblings on titanic", "tags": null, "constraints": [{"name": "optional"}, {"name": "lower_bound_inc", "value": 0.0}, {"name": "upper_bound_inc", "value": 20.0}]}, {"name": "is_female", "dtype": {"name": "bool"}, "description": null, "tags": null, "constraints": null, "depending_on": [{"name": "sex", "location": {"name": "titanic", "location": "feature_view"}, "dtype": {"name": "string"}}], "transformation": {"name": "equals", "dtype": {"name": "bool"}, "key": "sex", "value": {"name": "string", "value": "female"}}, "depth": 1}, {"name": "is_mr", "dtype": {"name": "bool"}, "description": null, "tags": null, "constraints": null, "depending_on": [{"name": "name", "location": {"name": "titanic", "location": "feature_view"}, "dtype": {"name": "string"}}], "transformation": {"name": "contains", "dtype": {"name": "bool"}, "key": "name", "value": "Mr."}, "depth": 1}, {"name": "age", "dtype": {"name": "float"}, "description": "A float as some have decimals", "tags": null, "constraints": [{"name": "lower_bound_inc", "value": 0.0}, {"name": "upper_bound_inc", "value": 100.0}]}, {"name": "survived", "dtype": {"name": "int8"}, "description": "If the passenger survived", "tags": null, "constraints": null}, {"name": "is_male", "dtype": {"name": "bool"}, "description": null, "tags": null, "constraints": null, "depending_on": [{"name": "sex", "location": {"name": "titanic", "location": "feature_view"}, "dtype": {"name": "string"}}], "transformation": {"name": "equals", "dtype": {"name": "bool"}, "key": "sex", "value": {"name": "string", "value": "male"}}, "depth": 1}, {"name": "cabin", "dtype": {"name": "string"}, "description": null, "tags": null, "constraints": [{"name": "optional"}]}, {"name": "has_siblings", "dtype": {"name": "bool"}, "description": null, "tags": null, "constraints": null, "depending_on": [{"name": "sibsp", "location": {"name": "titanic", "location": "feature_view"}, "dtype": {"name": "int32"}}], "transformation": {"name": "not-equals", "dtype": {"name": "bool"}, "key": "sibsp", "value": {"name": "int", "value": 0}}, "depth": 1}], "event_timestamp": null}, "train_dataset": {"mapping_keys": {}, "type_name": "csv", "path": "test_data/titanic-train.csv", "csv_config": {"seperator": ",", "compression": "infer", "should_write_index": false}, "formatter": {"date_format": "%Y-%m-%dT%H:%M:%S%.f+%Z", "time_unit": null, "time_zone": null, "name": "string_form"}, "expected_schema": null}, "test_dataset": {"mapping_keys": {}, "type_name": "csv", "path": "test_data/titanic-test.csv", "csv_config": {"seperator": ",", "compression": "infer", "should_write_index": false}, "formatter": {"date_format": "%Y-%m-%dT%H:%M:%S%.f+%Z", "time_unit": null, "time_zone": null, "name": "string_form"}, "expected_schema": null}, "validation_dataset": {"mapping_keys": {}, "type_name": "csv", "path": "test_data/titanic-validate.csv", "csv_config": {"seperator": ",", "compression": "infer", "should_write_index": false}, "formatter": {"date_format": "%Y-%m-%dT%H:%M:%S%.f+%Z", "time_unit": null, "time_zone": null, "name": "string_form"}, "expected_schema": null}, "train_size_fraction": 0.6, "test_size_fraction": 0.20000000000000007, "validate_size_fraction": 0.19999999999999996, "target": ["survived"], "description": null, "tags": null}], "active_learning": []}
{"raw_data": [], "train_test": [], "train_test_validation": [{"name": null, "request_result": {"entities": [{"name": "passenger_id", "dtype": {"name": "int32"}, "description": null, "tags": null, "constraints": null}], "features": [{"name": "is_mr", "dtype": {"name": "bool"}, "description": null, "tags": null, "constraints": null, "depending_on": [{"name": "name", "location": {"name": "titanic", "location": "feature_view"}, "dtype": {"name": "string"}}], "transformation": {"name": "contains", "dtype": {"name": "bool"}, "key": "name", "value": "Mr."}, "depth": 1}, {"name": "age", "dtype": {"name": "float"}, "description": "A float as some have decimals", "tags": null, "constraints": [{"name": "lower_bound_inc", "value": 0.0}, {"name": "upper_bound_inc", "value": 100.0}]}, {"name": "sex", "dtype": {"name": "string"}, "description": null, "tags": null, "constraints": [{"name": "in_domain", "values": ["male", "female"]}, {"name": "optional"}]}, {"name": "sibsp", "dtype": {"name": "int32"}, "description": "Number of siblings on titanic", "tags": null, "constraints": [{"name": "lower_bound_inc", "value": 0.0}, {"name": "upper_bound_inc", "value": 20.0}, {"name": "optional"}]}, {"name": "is_female", "dtype": {"name": "bool"}, "description": null, "tags": null, "constraints": null, "depending_on": [{"name": "sex", "location": {"name": "titanic", "location": "feature_view"}, "dtype": {"name": "string"}}], "transformation": {"name": "equals", "dtype": {"name": "bool"}, "key": "sex", "value": {"name": "string", "value": "female"}}, "depth": 1}, {"name": "has_siblings", "dtype": {"name": "bool"}, "description": null, "tags": null, "constraints": null, "depending_on": [{"name": "sibsp", "location": {"name": "titanic", "location": "feature_view"}, "dtype": {"name": "int32"}}], "transformation": {"name": "not-equals", "dtype": {"name": "bool"}, "key": "sibsp", "value": {"name": "int", "value": 0}}, "depth": 1}, {"name": "is_male", "dtype": {"name": "bool"}, "description": null, "tags": null, "constraints": null, "depending_on": [{"name": "sex", "location": {"name": "titanic", "location": "feature_view"}, "dtype": {"name": "string"}}], "transformation": {"name": "equals", "dtype": {"name": "bool"}, "key": "sex", "value": {"name": "string", "value": "male"}}, "depth": 1}, {"name": "survived", "dtype": {"name": "int8"}, "description": "If the passenger survived", "tags": null, "constraints": null}, {"name": "name", "dtype": {"name": "string"}, "description": null, "tags": null, "constraints": [{"name": "optional"}]}, {"name": "cabin", "dtype": {"name": "string"}, "description": null, "tags": null, "constraints": [{"name": "optional"}]}], "event_timestamp": null}, "train_dataset": {"mapping_keys": {}, "type_name": "csv", "path": "test_data/titanic-train.csv", "csv_config": {"seperator": ",", "compression": "infer", "should_write_index": false}, "formatter": {"date_format": "%Y-%m-%dT%H:%M:%S%.f+%Z", "time_unit": null, "time_zone": null, "name": "string_form"}, "expected_schema": null}, "test_dataset": {"mapping_keys": {}, "type_name": "csv", "path": "test_data/titanic-test.csv", "csv_config": {"seperator": ",", "compression": "infer", "should_write_index": false}, "formatter": {"date_format": "%Y-%m-%dT%H:%M:%S%.f+%Z", "time_unit": null, "time_zone": null, "name": "string_form"}, "expected_schema": null}, "validation_dataset": {"mapping_keys": {}, "type_name": "csv", "path": "test_data/titanic-validate.csv", "csv_config": {"seperator": ",", "compression": "infer", "should_write_index": false}, "formatter": {"date_format": "%Y-%m-%dT%H:%M:%S%.f+%Z", "time_unit": null, "time_zone": null, "name": "string_form"}, "expected_schema": null}, "id": "titanic_test", "created_at": "2024-05-20T20:29:29.180494", "train_size_fraction": 0.6, "test_size_fraction": 0.20000000000000007, "validate_size_fraction": 0.19999999999999996, "target": ["survived"], "description": null, "tags": null}]}
42 changes: 21 additions & 21 deletions test_data/titanic-test.csv
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
name,sex,sibsp,is_female,is_mr,passenger_id,age,survived,is_male,cabin,has_siblings
"Sirayanian, Mr. Orsen",male,0,False,True,61,22.0,0,True,,False
"Icard, Miss. Amelie",female,0,True,False,62,38.0,1,False,B28,False
"Harris, Mr. Henry Birkhardt",male,1,False,True,63,45.0,0,True,C83,True
"Skoog, Master. Harald",male,3,False,False,64,4.0,0,True,,True
"Stewart, Mr. Albert A",male,0,False,True,65,,0,True,,False
"Moubarek, Master. Gerios",male,1,False,False,66,,1,True,,True
"Nye, Mrs. (Elizabeth Ramell)",female,0,True,True,67,29.0,1,False,F33,False
"Crease, Mr. Ernest James",male,0,False,True,68,19.0,0,True,,False
"Andersson, Miss. Erna Alexandra",female,4,True,False,69,17.0,1,False,,True
"Kink, Mr. Vincenz",male,2,False,True,70,26.0,0,True,,True
"Jenkin, Mr. Stephen Curnow",male,0,False,True,71,32.0,0,True,,False
"Goodwin, Miss. Lillian Amy",female,5,True,False,72,16.0,0,False,,True
"Hood, Mr. Ambrose Jr",male,0,False,True,73,21.0,0,True,,False
"Chronopoulos, Mr. Apostolos",male,1,False,True,74,26.0,0,True,,True
"Bing, Mr. Lee",male,0,False,True,75,32.0,1,True,,False
"Moen, Mr. Sigurd Hansen",male,0,False,True,76,25.0,0,True,F G73,False
"Staneff, Mr. Ivan",male,0,False,True,77,,0,True,,False
"Moutal, Mr. Rahamin Haim",male,0,False,True,78,,0,True,,False
"Caldwell, Master. Alden Gates",male,0,False,False,79,0.83,1,True,,False
"Dowdell, Miss. Elizabeth",female,0,True,False,80,30.0,1,False,,False
is_mr,age,sex,sibsp,is_female,has_siblings,is_male,cabin,survived,name,passenger_id
True,22.0,male,0,False,False,True,,0,"Sirayanian, Mr. Orsen",61
False,38.0,female,0,True,False,False,B28,1,"Icard, Miss. Amelie",62
True,45.0,male,1,False,True,True,C83,0,"Harris, Mr. Henry Birkhardt",63
False,4.0,male,3,False,True,True,,0,"Skoog, Master. Harald",64
True,,male,0,False,False,True,,0,"Stewart, Mr. Albert A",65
False,,male,1,False,True,True,,1,"Moubarek, Master. Gerios",66
True,29.0,female,0,True,False,False,F33,1,"Nye, Mrs. (Elizabeth Ramell)",67
True,19.0,male,0,False,False,True,,0,"Crease, Mr. Ernest James",68
False,17.0,female,4,True,True,False,,1,"Andersson, Miss. Erna Alexandra",69
True,26.0,male,2,False,True,True,,0,"Kink, Mr. Vincenz",70
True,32.0,male,0,False,False,True,,0,"Jenkin, Mr. Stephen Curnow",71
False,16.0,female,5,True,True,False,,0,"Goodwin, Miss. Lillian Amy",72
True,21.0,male,0,False,False,True,,0,"Hood, Mr. Ambrose Jr",73
True,26.0,male,1,False,True,True,,0,"Chronopoulos, Mr. Apostolos",74
True,32.0,male,0,False,False,True,,1,"Bing, Mr. Lee",75
True,25.0,male,0,False,False,True,F G73,0,"Moen, Mr. Sigurd Hansen",76
True,,male,0,False,False,True,,0,"Staneff, Mr. Ivan",77
True,,male,0,False,False,True,,0,"Moutal, Mr. Rahamin Haim",78
False,0.83,male,0,False,False,True,,1,"Caldwell, Master. Alden Gates",79
False,30.0,female,0,True,False,False,,1,"Dowdell, Miss. Elizabeth",80
Loading

0 comments on commit f2dd225

Please sign in to comment.