Skip to content

Commit

Permalink
fix: tests and updated poetry
Browse files Browse the repository at this point in the history
  • Loading branch information
MatsMoll committed Jan 25, 2022
1 parent e8d7f0a commit dbf659b
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
3 changes: 1 addition & 2 deletions bender/evaluator/predict_probability.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,13 @@ async def evaluate(self, model: TrainedModel, data_set: TrainingDataSet) -> None
# Scores compared to true labels
fig, ax = plt.subplots(1, 1, figsize=(20, 10))
n_bins = 50 if self.num_bins is None else self.num_bins
bin_width = 1 / n_bins
plt.xlim(0, 1)
sns.histplot(
data=pred_result,
x=self.classification_of_interest,
hue=true_results,
multiple='stack',
binwidth=bin_width,
bins=n_bins,
legend=False,
ax=ax,
)
Expand Down
3 changes: 1 addition & 2 deletions bender/pipeline/tests/test_cross_validation.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import pytest
from pandas import DataFrame

from bender.evaluators import Evaluators
from bender.importers import DataImporters
from bender.model_trainer.xgboosted_tree import XGBoostTrainer

Expand All @@ -17,7 +16,7 @@ async def test_cross_validation(date_df: DataFrame) -> None:
3,
lambda pipeline: pipeline.train(
XGBoostTrainer(), input_features=['y_values', 'x_values'], target_feature='bool_classification'
).evaluate([Evaluators.confusion_matrix()]),
),
)
.run()
)
4 changes: 2 additions & 2 deletions conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ def date_df() -> DataFrame:
],
'lat': values,
'long': values,
'expected_day': [20, 21, 22, 24, 25, 27, 28, 2, 9, 3],
'expected_month': [1, 2, 3, 4, 5, 6, 7, 8, 9, 9],
'expected_day': [20, 21, 22, 24, 25, 27, 28, 2, 9, 9],
'expected_month': [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
'classification': [0, 0, 1, 3, 2, 2, 1, 3, 3, 3],
'bool_classification': [True, True, True, False, False, True, False, False, True, False],
}
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "benderml"
version = "0.1.10"
version = "0.1.11"
description = "A Python package that makes ML processes easier, faster and less error prone"
authors = ["Mats E. Mollestad <[email protected]>"]
license = "Apache-2.0"
Expand Down

0 comments on commit dbf659b

Please sign in to comment.