File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -1365,12 +1365,16 @@ pub(crate) fn target_n_trees(
13651365 // In the case we never made any tree we can roughly guess how many trees we want to build in total
13661366 None => {
13671367 // See https://github.com/meilisearch/guess-right-number-of-trees for more details on how we got this formula.
1368-
1368+
13691369 let nb_vec = item_indices. len ( ) as f64 ;
13701370 let nb_trees = if nb_vec < 10_000. {
13711371 2.0_f64 . powf ( nb_vec. log2 ( ) - 6.0 )
13721372 } else {
1373- 2.0_f64 . powf ( nb_vec. log10 ( ) + ( dimensions as f64 ) . log10 ( ) + ( 768.0 / dimensions as f64 ) . powf ( 4.0 ) )
1373+ 2.0_f64 . powf (
1374+ nb_vec. log10 ( )
1375+ + ( dimensions as f64 ) . log10 ( )
1376+ + ( 768.0 / dimensions as f64 ) . powf ( 4.0 ) ,
1377+ )
13741378 } ;
13751379 let mut nb_trees = nb_trees. ceil ( ) as u64 ;
13761380
You can’t perform that action at this time.
0 commit comments