Skip to content

Commit

Permalink
refactor: use standard library for inverse sqrt (VowpalWabbit#4665)
Browse files Browse the repository at this point in the history
* use standard library for inverse sqrt

* fix sklearn tests

* fix diff
  • Loading branch information
bassmang authored Nov 17, 2023
1 parent a541d85 commit 26b74fd
Show file tree
Hide file tree
Showing 9 changed files with 14,228 additions and 14,271 deletions.
12 changes: 6 additions & 6 deletions python/vowpalwabbit/sklearn.py
Original file line number Diff line number Diff line change
Expand Up @@ -738,12 +738,12 @@ class would be predicted.
>>> model = VWMultiClassifier(oaa=3, loss_function='logistic')
>>> _ = model.fit(X, y)
>>> model.predict_proba(X)
array([[0.38924146, 0.30537927, 0.30537927],
[0.40661219, 0.29669389, 0.29669389],
[0.52335149, 0.23832427, 0.23832427],
[0.52696788, 0.23651604, 0.23651604],
[0.65430814, 0.17284594, 0.17284594],
[0.61224216, 0.19387889, 0.19387889]])
array([[0.38926664, 0.30536669, 0.30536669],
[0.40663728, 0.2966814 , 0.2966814 ],
[0.52337217, 0.23831393, 0.23831393],
[0.52698863, 0.23650573, 0.23650573],
[0.6543135 , 0.17284323, 0.17284323],
[0.61224902, 0.19387549, 0.19387549]])
"""
return VW.predict(self, X=X)

Expand Down
198 changes: 99 additions & 99 deletions test/pred-sets/ref/poisson.train.predict
Original file line number Diff line number Diff line change
@@ -1,100 +1,100 @@
1
3.799717
1.758895
2.823944
3.418083
3.174116
4.399955
6.617443
9.925587
6.859698
9.062473
10.236777
4.409184
16.511784
13.219240
5.015990
8.376214
4.853359
4.775251
10.194923
3.586257
7.299780
3.085816
19.471279
6.456569
5.083687
5.718489
4.165322
4.801548
12.160492
11.505902
7.201016
8.249208
3.413971
11.563130
10.683638
8.653486
6.696140
7.353734
4.634882
20.726450
4.390856
6.037433
17.106670
5.407927
5.619127
8.686151
12.502230
3.594334
3.730500
15.105044
13.844496
16.222132
5.544982
3.611238
14.929321
23.313150
5.492814
4.416268
6.741525
8.565622
10.134159
21.189169
6.113652
12.738751
5.251778
8.007408
6.202647
22.053446
18.842344
10.703218
9.388963
6.564823
4.188909
6.913012
3.585745
11.230138
10.335607
9.245808
13.397093
10.333648
4.940864
16.954252
3.094200
13.083524
17.795330
14.321293
11.400364
21.311798
8.588335
8.495510
6.460412
12.288263
6.253819
8.273765
4.329605
3.374068
4.934896
4.281456
6.190218
3.800619
1.758935
2.824216
3.418108
3.174257
4.400357
6.617925
9.926342
6.860019
9.062867
10.237043
4.409323
16.512039
13.219710
5.016036
8.376304
4.853390
4.775280
10.194972
3.586254
7.299616
3.085841
19.471577
6.456658
5.083767
5.718542
4.165406
4.801608
12.160570
11.506034
7.201034
8.249253
3.414075
11.563263
10.683724
8.653652
6.696215
7.353841
4.634963
20.726303
4.390929
6.037502
17.106434
5.407959
5.619164
8.686163
12.502134
3.594335
3.730505
15.104943
13.844918
16.222507
5.545042
3.611302
14.929578
23.313255
5.492844
4.416314
6.741583
8.565572
10.134337
21.189093
6.113706
12.738770
5.251884
8.007589
6.202812
22.053951
18.843071
10.703443
9.389182
6.564854
4.188958
6.913089
3.585796
11.230267
10.335644
9.245924
13.396866
10.333596
4.940830
16.954107
3.094223
13.083464
17.795250
14.321327
11.400293
21.311584
8.588274
8.495458
6.460392
12.288342
6.253785
8.273701
4.329561
3.374042
4.934813
4.281405
6.190152
Loading

0 comments on commit 26b74fd

Please sign in to comment.