Skip to content

Commit

Permalink
Minor fix in transform.py, remove obsolete todo
Browse files Browse the repository at this point in the history
  • Loading branch information
EgorKraevTransferwise committed May 7, 2024
1 parent 56fd3ad commit 89175bf
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 0 additions & 1 deletion wise_pizza/solve/tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@ def get_best_subtree_result(


def build_tree(root: ModelNode, num_leaves: int, max_depth: Optional[int] = 1000):
# TODO: modify this to also accept max_depth
for _ in range(num_leaves - 1):
best_node = get_best_subtree_result(root, max_depth)
if best_node.error_improvement > 0:
Expand Down
2 changes: 1 addition & 1 deletion wise_pizza/transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def inverse_transform_mean(self, x: np.ndarray) -> np.ndarray:
0.0, np.exp(np.minimum(x, np.log(self.max_inverse))) - self.offset
)
else:
np.maximum(0.0, np.exp(x) - self.offset)
return np.maximum(0.0, np.exp(x) - self.offset)

def transform_weight(self, w: np.ndarray, mean: np.ndarray) -> np.ndarray:
# pure math would give weight_pow_sc = 1, but then
Expand Down

0 comments on commit 89175bf

Please sign in to comment.