Skip to content

Commit

Permalink
change the defaut optimizer to l2 cddual in EUR-lex config
Browse files Browse the repository at this point in the history
  • Loading branch information
ericliu8168 committed Oct 5, 2024
1 parent 6e955f7 commit 1db376a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion example_config/EUR-Lex/tree_l2svm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ data_name: EUR-Lex
# train
seed: 1337
linear: true
liblinear_options: "-s 2 -B 1 -e 0.0001 -q"
liblinear_options: "-s 1 -B 1 -e 0.0001 -q"
linear_technique: tree

# eval
Expand Down
3 changes: 2 additions & 1 deletion libmultilabel/linear/tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,8 @@ def collect_stat(node: Node):
root.dfs(collect_stat)

# 16 is because when storing sparse matrices, indices (int64) require 8 bytes and floats require 8 bytes
return total_num_weights * 16
# 2/3 is because that dual coordinate descent method can further get a sparse model vector to save space
return total_num_weights * 16 * 2/3


def _train_node(y: sparse.csr_matrix, x: sparse.csr_matrix, options: str, node: Node):
Expand Down

0 comments on commit 1db376a

Please sign in to comment.