Skip to content

Commit

Permalink
Optimize code performance
Browse files Browse the repository at this point in the history
  • Loading branch information
miaohancheng committed Sep 19, 2024
1 parent 962ac7f commit 8572ae0
Show file tree
Hide file tree
Showing 8 changed files with 543 additions and 657 deletions.
486 changes: 228 additions & 258 deletions Example.ipynb

Large diffs are not rendered by default.

14 changes: 8 additions & 6 deletions Example.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,23 @@


# for reproducibility
np.random.seed(20170925)
np.random.seed(20240919)

m.fit_scores(balance=True, nmodels=10,n_jobs=3,model_type='tree')
m.fit_scores(balance=True, nmodels=10,n_jobs=3,model_type='linear')
# m.fit_scores(balance=True, nmodels=10,n_jobs=3,model_type='tree')


m.predict_scores()

m.plot_scores()
m.tune_threshold(method='random')
m.match(method="min", nmatches=1, threshold=0.0005)
m.match(method="min", nmatches=1, threshold=0.0001)

m.record_frequency()
m.assign_weight_vector()
m.matched_data.sort_values("match_id").head(6)
categorical_results = m.compare_categorical(return_table=True)
print("top 6 matched data")
print(m.matched_data.sort_values("match_id").head(6))
categorical_results = m.compare_categorical(return_table=True,plot_result=True)
print(categorical_results)
cc = m.compare_continuous(return_table=True)
cc = m.compare_continuous(return_table=True,plot_result=True)
print(cc)
Binary file modified catboost_info/learn/events.out.tfevents
Binary file not shown.
200 changes: 100 additions & 100 deletions catboost_info/learn_error.tsv
Original file line number Diff line number Diff line change
@@ -1,101 +1,101 @@
iter Logloss
0 0.6860339355
1 0.6793117676
2 0.6719605103
3 0.6662591553
4 0.6604979248
5 0.6564853516
6 0.6521936035
7 0.6470774536
8 0.6438172607
9 0.6417221069
10 0.638303833
11 0.6358477783
12 0.6319497681
13 0.629239502
14 0.6270506592
15 0.6237658691
16 0.622847229
17 0.6217990723
18 0.6188481445
19 0.617229126
20 0.615310791
21 0.6141380005
22 0.612633667
23 0.6099338379
24 0.6079963989
25 0.6060895386
26 0.6051459961
27 0.6039931641
28 0.6024761963
29 0.6013486328
30 0.6000162354
31 0.5989101562
32 0.5965554199
33 0.5950981445
34 0.5945324707
35 0.5931483154
36 0.5912705078
37 0.5901569824
38 0.5892490234
39 0.5883467407
40 0.5871303711
41 0.5852086182
42 0.5846987305
43 0.5836748657
44 0.5832843018
45 0.5825790405
46 0.581152832
47 0.579135376
48 0.5781837158
49 0.5773459473
50 0.576769104
51 0.5762745361
52 0.5759954834
53 0.5753961792
54 0.5739927368
55 0.5722527466
56 0.5716566162
57 0.5711035156
58 0.5702729492
59 0.5696401367
60 0.5691248169
61 0.56871698
62 0.5680968018
63 0.5676867676
64 0.5665188599
65 0.5655626221
66 0.5643121948
67 0.5639257202
68 0.5630357666
69 0.5618366699
70 0.5606151123
71 0.5599468994
72 0.5588881836
73 0.5577629395
74 0.5568980103
75 0.556286499
76 0.5554761963
77 0.5545211182
78 0.5535883179
79 0.5530195923
80 0.5520428467
81 0.5517469482
82 0.5512855835
83 0.550744873
84 0.5501694946
85 0.5498062744
86 0.5494074097
87 0.5484682617
88 0.5480986938
89 0.5477758789
90 0.5471382446
91 0.5454927368
92 0.5450218506
93 0.5444959717
94 0.5438290405
95 0.5432046509
96 0.5414328613
97 0.5410144653
98 0.5401860962
99 0.5391330566
0 0.6898436129
1 0.6866067364
2 0.68367803
3 0.6810237609
4 0.678237323
5 0.6754873811
6 0.6725127503
7 0.6696807072
8 0.6670089812
9 0.6646403495
10 0.6624498627
11 0.6601588291
12 0.6578551217
13 0.6560402765
14 0.6543410543
15 0.65227048
16 0.6503630072
17 0.6480629463
18 0.6462505614
19 0.6447754391
20 0.6432293827
21 0.6415947907
22 0.6397645899
23 0.6382946974
24 0.6368448744
25 0.6356910387
26 0.6341236671
27 0.6325919069
28 0.6312917997
29 0.6299907921
30 0.6287321632
31 0.6276005753
32 0.6261165329
33 0.6248845573
34 0.6238661652
35 0.6229098852
36 0.6216585476
37 0.6200600856
38 0.6190215175
39 0.6176280993
40 0.6165708879
41 0.6154169445
42 0.6144099411
43 0.6136239551
44 0.6127241017
45 0.6115466937
46 0.6108540474
47 0.6099583288
48 0.6089160687
49 0.6080244778
50 0.6072035247
51 0.6063910223
52 0.6054369286
53 0.6046599699
54 0.6036734044
55 0.6028371936
56 0.6020923298
57 0.6014557316
58 0.6004762273
59 0.5997872878
60 0.599063142
61 0.5978535788
62 0.5971596732
63 0.5965502677
64 0.5958384615
65 0.5950384992
66 0.5943805379
67 0.5934463087
68 0.5927613174
69 0.5919319031
70 0.5911521936
71 0.5905110816
72 0.5900454666
73 0.5893650325
74 0.5888609676
75 0.58810042
76 0.5873504981
77 0.5867293906
78 0.5863017951
79 0.5856087136
80 0.584768032
81 0.5843725607
82 0.5838055977
83 0.583500797
84 0.5827138536
85 0.5821745753
86 0.581087886
87 0.5807264777
88 0.5801221541
89 0.5797372208
90 0.5789359288
91 0.5782544419
92 0.5778428999
93 0.5772284707
94 0.576600707
95 0.5761930174
96 0.5758104707
97 0.5754176143
98 0.5747088356
99 0.5742526543
Loading

0 comments on commit 8572ae0

Please sign in to comment.