Skip to content

Commit

Permalink
Merge pull request #14 from gmoivan/develop
Browse files Browse the repository at this point in the history
Agrega funcion get_target_max
  • Loading branch information
mvillasante authored Feb 6, 2025
2 parents ed4e475 + ada42fd commit d3e7fcd
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pollos_petrel/dummy_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ def get_target_mean(dataset: pd.DataFrame) -> float:
return mean_target


# O)bten el maximo de target
def get_target_max(dataset: pd.DataFrame) -> float:
max_target = dataset["target"].max()
return max_target


# Lee test.csv
def read_testing_dataset() -> pd.DataFrame:
testing_dataset_path = "/workdir/data/raw/test.csv"
Expand Down
10 changes: 10 additions & 0 deletions tests/test_dummy_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
add_mean_as_target,
drop_all_but_id,
get_target_mean,
get_target_max,
read_testing_dataset,
read_training_dataset,
write_submission,
Expand All @@ -27,6 +28,15 @@ def test_get_target_mean():
assert expected_mean == obtained_mean


# Obten el maximo de target
def test_get_target_max():
data = {"id": [1, 2], "target": [3, 4]}
dataset = pd.DataFrame(data=data)
obtained_max = get_target_max(dataset)
expected_max = 4
assert expected_max == obtained_max


# Lee test.csv
def test_read_testing_dataset():
testing_dataset = read_testing_dataset()
Expand Down

0 comments on commit d3e7fcd

Please sign in to comment.