bdpedigo commited on
Commit
82817f7
·
verified ·
1 Parent(s): 9710c03

Upload folder using huggingface_hub

Browse files
Files changed (2) hide show
  1. README.md +270 -295
  2. train.py +3 -2
README.md CHANGED
@@ -2,246 +2,246 @@
2
  license: mit
3
  library_name: sklearn
4
  tags:
5
- - sklearn
6
- - skops
7
- - tabular-classification
8
  model_format: skops
9
  model_file: local_compartment_classifier_bd_boxes.skops
10
  widget:
11
- - structuredData:
12
- area_nm2:
13
- - 693824.0
14
- - 4852608.0
15
- - 17088896.0
16
- area_nm2_neighbor_mean:
17
- - 10181485.714285716
18
- - 9884429.714285716
19
- - 9010409.142857144
20
- area_nm2_neighbor_std:
21
- - 8312409.263207569
22
- - 8587259.418816902
23
- - 8418630.640116522
24
- max_dt_nm:
25
- - 69.0
26
- - 543.0
27
- - 1287.0
28
- max_dt_nm_neighbor_mean:
29
- - 664.7142857142857
30
- - 630.8571428571429
31
- - 577.7142857142857
32
- max_dt_nm_neighbor_std:
33
- - 479.64240342658945
34
- - 504.9563358340017
35
- - 468.41868657651344
36
- mean_dt_nm:
37
- - 24.4375
38
- - 156.5
39
- - 416.0
40
- mean_dt_nm_neighbor_mean:
41
- - 198.62946428571428
42
- - 189.19642857142856
43
- - 170.66071428571428
44
- mean_dt_nm_neighbor_std:
45
- - 150.614304054458
46
- - 157.4368957825056
47
- - 143.32375093543624
48
- pca_ratio_01:
49
- - 1.3849340770961909
50
- - 1.181656878273399
51
- - 1.128046800200765
52
- pca_ratio_01_neighbor_mean:
53
- - 1.8575624906424115
54
- - 1.8760422359899387
55
- - 1.880915879451087
56
- pca_ratio_01_neighbor_std:
57
- - 0.641580757345606
58
- - 0.6228187048854344
59
- - 0.6165585104590592
60
- pca_unwrapped_0:
61
- - -0.0046539306640625
62
- - -0.497314453125
63
- - -0.258544921875
64
- pca_unwrapped_0_neighbor_mean:
65
- - 0.039224624633789
66
- - 0.0840119448575106
67
- - 0.0623056238347833
68
- pca_unwrapped_0_neighbor_std:
69
- - 0.3114910605258688
70
- - 0.2573427692683507
71
- - 0.296254177168357
72
- pca_unwrapped_1:
73
- - 0.7392578125
74
- - -0.11553955078125
75
- - 0.2169189453125
76
- pca_unwrapped_1_neighbor_mean:
77
- - 0.0941687497225674
78
- - 0.1718776009299538
79
- - 0.1416541012850674
80
- pca_unwrapped_1_neighbor_std:
81
- - 0.3179467337379631
82
- - 0.3628551035117971
83
- - 0.372447324946889
84
- pca_unwrapped_2:
85
- - -0.673828125
86
- - -0.85986328125
87
- - 0.94140625
88
- pca_unwrapped_2_neighbor_mean:
89
- - 0.2258744673295454
90
- - 0.2427867542613636
91
- - 0.0790349786931818
92
- pca_unwrapped_2_neighbor_std:
93
- - 0.9134250264562896
94
- - 0.8928014788058292
95
- - 0.9167197839332804
96
- pca_unwrapped_3:
97
- - -0.0302886962890625
98
- - -0.86572265625
99
- - 0.57177734375
100
- pca_unwrapped_3_neighbor_mean:
101
- - -0.2933238636363636
102
- - -0.2173753218217329
103
- - -0.3480571400035511
104
- pca_unwrapped_3_neighbor_std:
105
- - 0.6203425764161097
106
- - 0.5938304683645145
107
- - 0.5600074530240728
108
- pca_unwrapped_4:
109
- - 0.67333984375
110
- - -0.0005474090576171
111
- - 0.81982421875
112
- pca_unwrapped_4_neighbor_mean:
113
- - 0.2915762121027166
114
- - 0.3528386896306818
115
- - 0.2782594507390802
116
- pca_unwrapped_4_neighbor_std:
117
- - 0.6415192812587974
118
- - 0.6430080201673403
119
- - 0.6308895861182334
120
- pca_unwrapped_5:
121
- - 0.73876953125
122
- - 0.50048828125
123
- - -0.03192138671875
124
- pca_unwrapped_5_neighbor_mean:
125
- - 0.2028697620738636
126
- - 0.2245316938920454
127
- - 0.2729325727982954
128
- pca_unwrapped_5_neighbor_std:
129
- - 0.265173781606759
130
- - 0.2994363858938455
131
- - 0.2968562365279343
132
- pca_unwrapped_6:
133
- - 0.99951171875
134
- - 0.05828857421875
135
- - -0.77880859375
136
- pca_unwrapped_6_neighbor_mean:
137
- - -0.2386505820534446
138
- - -0.1530848416415128
139
- - -0.0769850990988991
140
- pca_unwrapped_6_neighbor_std:
141
- - 0.6776577717043619
142
- - 0.7717860533115238
143
- - 0.7447135522384378
144
- pca_unwrapped_7:
145
- - 0.023834228515625
146
- - -0.9931640625
147
- - 0.52978515625
148
- pca_unwrapped_7_neighbor_mean:
149
- - -0.4803272594105113
150
- - -0.3878728693181818
151
- - -0.5263227982954546
152
- pca_unwrapped_7_neighbor_std:
153
- - 0.4799926318285017
154
- - 0.4691567465869561
155
- - 0.3891669942534205
156
- pca_unwrapped_8:
157
- - 0.0192413330078125
158
- - 0.0997314453125
159
- - -0.3359375
160
- pca_unwrapped_8_neighbor_mean:
161
- - -0.0384375832297585
162
- - -0.0457548661665482
163
- - -0.0061485984108664
164
- pca_unwrapped_8_neighbor_std:
165
- - 0.3037878488292577
166
- - 0.3010843368506175
167
- - 0.2874409267860334
168
- pca_val_unwrapped_0:
169
- - 15657.09765625
170
- - 40668.40625
171
- - 66863.0
172
- pca_val_unwrapped_0_neighbor_mean:
173
- - 69378.52059659091
174
- - 67104.76526988637
175
- - 64723.43856534091
176
- pca_val_unwrapped_0_neighbor_std:
177
- - 20242.245019019712
178
- - 24702.906417865197
179
- - 25959.16138296664
180
- pca_val_unwrapped_1:
181
- - 11305.3017578125
182
- - 34416.42578125
183
- - 59273.25
184
- pca_val_unwrapped_1_neighbor_mean:
185
- - 41190.40261008523
186
- - 39089.39133522727
187
- - 36829.68004261364
188
- pca_val_unwrapped_1_neighbor_std:
189
- - 16625.870141811894
190
- - 18875.56976212627
191
- - 17666.778281657556
192
- pca_val_unwrapped_2:
193
- - 1270.4095458984375
194
- - 13551.6748046875
195
- - 47764.625
196
- pca_val_unwrapped_2_neighbor_mean:
197
- - 28717.50048828125
198
- - 27601.021828391335
199
- - 24490.75362881747
200
- pca_val_unwrapped_2_neighbor_std:
201
- - 14988.204981576571
202
- - 16601.48080038032
203
- - 15622.078784778376
204
- post_synapse_count:
205
- - 0.0
206
- - 0.0
207
- - 0.0
208
- post_synapse_count_neighbor_mean:
209
- - 0.0
210
- - 0.0
211
- - 0.0
212
- post_synapse_count_neighbor_std:
213
- - 0.0
214
- - 0.0
215
- - 0.0
216
- pre_synapse_count:
217
- - 0.0
218
- - 0.0
219
- - 0.0
220
- pre_synapse_count_neighbor_mean:
221
- - 0.0
222
- - 0.0
223
- - 0.0
224
- pre_synapse_count_neighbor_std:
225
- - 0.0
226
- - 0.0
227
- - 0.0
228
- size_nm3:
229
- - 12771840.0
230
- - 697943040.0
231
- - 7550330880.0
232
- size_nm3_neighbor_mean:
233
- - 3233702034.285714
234
- - 3184761234.285714
235
- - 2695304960.0
236
- size_nm3_neighbor_std:
237
- - 3650678969.7909584
238
- - 3691650923.5639486
239
- - 3518520747.0511127
240
  ---
241
 
242
  # Model description
243
 
244
- [More Information Needed]
245
 
246
  ## Intended uses & limitations
247
 
@@ -256,26 +256,26 @@ widget:
256
  <details>
257
  <summary> Click to expand </summary>
258
 
259
- | Hyperparameter | Value |
260
- |------------------------------------|---------------------------------------------------------------------------------------------------------------------------|
261
- | memory | |
262
- | steps | [('transformer', QuantileTransformer(output_distribution='normal')), ('lda', LinearDiscriminantAnalysis(n_components=3))] |
263
- | verbose | False |
264
- | transformer | QuantileTransformer(output_distribution='normal') |
265
- | lda | LinearDiscriminantAnalysis(n_components=3) |
266
- | transformer__copy | True |
267
- | transformer__ignore_implicit_zeros | False |
268
- | transformer__n_quantiles | 1000 |
269
- | transformer__output_distribution | normal |
270
- | transformer__random_state | |
271
- | transformer__subsample | 10000 |
272
- | lda__covariance_estimator | |
273
- | lda__n_components | 3 |
274
- | lda__priors | |
275
- | lda__shrinkage | |
276
- | lda__solver | svd |
277
- | lda__store_covariance | False |
278
- | lda__tol | 0.0001 |
279
 
280
  </details>
281
 
@@ -361,53 +361,28 @@ div.sk-label-container:hover .sk-estimator-doc-link.fitted:hover,
361
 
362
  ## Evaluation Results
363
 
364
- [More Information Needed]
365
-
366
- # How to Get Started with the Model
367
-
368
- [More Information Needed]
369
-
370
- # Model Card Authors
371
-
372
- This model card is written by following authors:
373
-
374
- [More Information Needed]
375
 
376
- # Model Card Contact
 
 
 
 
377
 
378
- You can contact the model card authors through following channels:
379
- [More Information Needed]
380
 
381
- # Citation
 
 
 
 
 
382
 
383
- Below you can find information related to citation.
384
 
385
- **BibTeX:**
386
- ```
387
  [More Information Needed]
388
- ```
389
-
390
- # model_card_authors
391
-
392
- bdpedigo
393
-
394
- # model_description
395
 
396
- This is a model trained to classify pieces of neuron as axon, dendrite, soma, orglia, based only on their local shape and synapse features.The model is a linear discriminant classifier which was trained on compartment labels generated by Bethanny Danskin for 3 6x6x6 um boxes in the Minnie65 Phase3 dataset.
397
-
398
- # Classification Report (overall)
399
-
400
- | type | precision | recall | f1-score | support |
401
- |--------------|-------------|----------|------------|--------------|
402
- | accuracy | 0.944357 | 0.944357 | 0.944357 | 0.944357 |
403
- | macro avg | 0.854825 | 0.917289 | 0.878753 | 31307 |
404
- | weighted avg | 0.946879 | 0.944357 | 0.945155 | 31307 |
405
-
406
- # Classification Report (by class)
407
 
408
- | class | precision | recall | f1-score | support |
409
- |----------|-------------|----------|------------|-----------|
410
- | axon | 0.956309 | 0.964704 | 0.960488 | 16404 |
411
- | dendrite | 0.928038 | 0.911341 | 0.919614 | 6948 |
412
- | glia | 0.964442 | 0.935279 | 0.949636 | 7540 |
413
- | soma | 0.570513 | 0.857831 | 0.685274 | 415 |
 
2
  license: mit
3
  library_name: sklearn
4
  tags:
5
+ - sklearn
6
+ - skops
7
+ - tabular-classification
8
  model_format: skops
9
  model_file: local_compartment_classifier_bd_boxes.skops
10
  widget:
11
+ - structuredData:
12
+ area_nm2:
13
+ - 693824.0
14
+ - 4852608.0
15
+ - 17088896.0
16
+ area_nm2_neighbor_mean:
17
+ - 10181485.714285716
18
+ - 9884429.714285716
19
+ - 9010409.142857144
20
+ area_nm2_neighbor_std:
21
+ - 8312409.263207569
22
+ - 8587259.418816902
23
+ - 8418630.640116522
24
+ max_dt_nm:
25
+ - 69.0
26
+ - 543.0
27
+ - 1287.0
28
+ max_dt_nm_neighbor_mean:
29
+ - 664.7142857142857
30
+ - 630.8571428571429
31
+ - 577.7142857142857
32
+ max_dt_nm_neighbor_std:
33
+ - 479.64240342658945
34
+ - 504.9563358340017
35
+ - 468.41868657651344
36
+ mean_dt_nm:
37
+ - 24.4375
38
+ - 156.5
39
+ - 416.0
40
+ mean_dt_nm_neighbor_mean:
41
+ - 198.62946428571428
42
+ - 189.19642857142856
43
+ - 170.66071428571428
44
+ mean_dt_nm_neighbor_std:
45
+ - 150.614304054458
46
+ - 157.4368957825056
47
+ - 143.32375093543624
48
+ pca_ratio_01:
49
+ - 1.3849340770961909
50
+ - 1.181656878273399
51
+ - 1.128046800200765
52
+ pca_ratio_01_neighbor_mean:
53
+ - 1.8575624906424115
54
+ - 1.8760422359899387
55
+ - 1.880915879451087
56
+ pca_ratio_01_neighbor_std:
57
+ - 0.641580757345606
58
+ - 0.6228187048854344
59
+ - 0.6165585104590592
60
+ pca_unwrapped_0:
61
+ - -0.0046539306640625
62
+ - -0.497314453125
63
+ - -0.258544921875
64
+ pca_unwrapped_0_neighbor_mean:
65
+ - 0.039224624633789
66
+ - 0.0840119448575106
67
+ - 0.0623056238347833
68
+ pca_unwrapped_0_neighbor_std:
69
+ - 0.3114910605258688
70
+ - 0.2573427692683507
71
+ - 0.296254177168357
72
+ pca_unwrapped_1:
73
+ - 0.7392578125
74
+ - -0.11553955078125
75
+ - 0.2169189453125
76
+ pca_unwrapped_1_neighbor_mean:
77
+ - 0.0941687497225674
78
+ - 0.1718776009299538
79
+ - 0.1416541012850674
80
+ pca_unwrapped_1_neighbor_std:
81
+ - 0.3179467337379631
82
+ - 0.3628551035117971
83
+ - 0.372447324946889
84
+ pca_unwrapped_2:
85
+ - -0.673828125
86
+ - -0.85986328125
87
+ - 0.94140625
88
+ pca_unwrapped_2_neighbor_mean:
89
+ - 0.2258744673295454
90
+ - 0.2427867542613636
91
+ - 0.0790349786931818
92
+ pca_unwrapped_2_neighbor_std:
93
+ - 0.9134250264562896
94
+ - 0.8928014788058292
95
+ - 0.9167197839332804
96
+ pca_unwrapped_3:
97
+ - -0.0302886962890625
98
+ - -0.86572265625
99
+ - 0.57177734375
100
+ pca_unwrapped_3_neighbor_mean:
101
+ - -0.2933238636363636
102
+ - -0.2173753218217329
103
+ - -0.3480571400035511
104
+ pca_unwrapped_3_neighbor_std:
105
+ - 0.6203425764161097
106
+ - 0.5938304683645145
107
+ - 0.5600074530240728
108
+ pca_unwrapped_4:
109
+ - 0.67333984375
110
+ - -0.0005474090576171
111
+ - 0.81982421875
112
+ pca_unwrapped_4_neighbor_mean:
113
+ - 0.2915762121027166
114
+ - 0.3528386896306818
115
+ - 0.2782594507390802
116
+ pca_unwrapped_4_neighbor_std:
117
+ - 0.6415192812587974
118
+ - 0.6430080201673403
119
+ - 0.6308895861182334
120
+ pca_unwrapped_5:
121
+ - 0.73876953125
122
+ - 0.50048828125
123
+ - -0.03192138671875
124
+ pca_unwrapped_5_neighbor_mean:
125
+ - 0.2028697620738636
126
+ - 0.2245316938920454
127
+ - 0.2729325727982954
128
+ pca_unwrapped_5_neighbor_std:
129
+ - 0.265173781606759
130
+ - 0.2994363858938455
131
+ - 0.2968562365279343
132
+ pca_unwrapped_6:
133
+ - 0.99951171875
134
+ - 0.05828857421875
135
+ - -0.77880859375
136
+ pca_unwrapped_6_neighbor_mean:
137
+ - -0.2386505820534446
138
+ - -0.1530848416415128
139
+ - -0.0769850990988991
140
+ pca_unwrapped_6_neighbor_std:
141
+ - 0.6776577717043619
142
+ - 0.7717860533115238
143
+ - 0.7447135522384378
144
+ pca_unwrapped_7:
145
+ - 0.023834228515625
146
+ - -0.9931640625
147
+ - 0.52978515625
148
+ pca_unwrapped_7_neighbor_mean:
149
+ - -0.4803272594105113
150
+ - -0.3878728693181818
151
+ - -0.5263227982954546
152
+ pca_unwrapped_7_neighbor_std:
153
+ - 0.4799926318285017
154
+ - 0.4691567465869561
155
+ - 0.3891669942534205
156
+ pca_unwrapped_8:
157
+ - 0.0192413330078125
158
+ - 0.0997314453125
159
+ - -0.3359375
160
+ pca_unwrapped_8_neighbor_mean:
161
+ - -0.0384375832297585
162
+ - -0.0457548661665482
163
+ - -0.0061485984108664
164
+ pca_unwrapped_8_neighbor_std:
165
+ - 0.3037878488292577
166
+ - 0.3010843368506175
167
+ - 0.2874409267860334
168
+ pca_val_unwrapped_0:
169
+ - 15657.09765625
170
+ - 40668.40625
171
+ - 66863.0
172
+ pca_val_unwrapped_0_neighbor_mean:
173
+ - 69378.52059659091
174
+ - 67104.76526988637
175
+ - 64723.43856534091
176
+ pca_val_unwrapped_0_neighbor_std:
177
+ - 20242.245019019712
178
+ - 24702.906417865197
179
+ - 25959.16138296664
180
+ pca_val_unwrapped_1:
181
+ - 11305.3017578125
182
+ - 34416.42578125
183
+ - 59273.25
184
+ pca_val_unwrapped_1_neighbor_mean:
185
+ - 41190.40261008523
186
+ - 39089.39133522727
187
+ - 36829.68004261364
188
+ pca_val_unwrapped_1_neighbor_std:
189
+ - 16625.870141811894
190
+ - 18875.56976212627
191
+ - 17666.778281657556
192
+ pca_val_unwrapped_2:
193
+ - 1270.4095458984375
194
+ - 13551.6748046875
195
+ - 47764.625
196
+ pca_val_unwrapped_2_neighbor_mean:
197
+ - 28717.50048828125
198
+ - 27601.021828391335
199
+ - 24490.75362881747
200
+ pca_val_unwrapped_2_neighbor_std:
201
+ - 14988.204981576571
202
+ - 16601.48080038032
203
+ - 15622.078784778376
204
+ post_synapse_count:
205
+ - 0.0
206
+ - 0.0
207
+ - 0.0
208
+ post_synapse_count_neighbor_mean:
209
+ - 0.0
210
+ - 0.0
211
+ - 0.0
212
+ post_synapse_count_neighbor_std:
213
+ - 0.0
214
+ - 0.0
215
+ - 0.0
216
+ pre_synapse_count:
217
+ - 0.0
218
+ - 0.0
219
+ - 0.0
220
+ pre_synapse_count_neighbor_mean:
221
+ - 0.0
222
+ - 0.0
223
+ - 0.0
224
+ pre_synapse_count_neighbor_std:
225
+ - 0.0
226
+ - 0.0
227
+ - 0.0
228
+ size_nm3:
229
+ - 12771840.0
230
+ - 697943040.0
231
+ - 7550330880.0
232
+ size_nm3_neighbor_mean:
233
+ - 3233702034.285714
234
+ - 3184761234.285714
235
+ - 2695304960.0
236
+ size_nm3_neighbor_std:
237
+ - 3650678969.7909584
238
+ - 3691650923.5639486
239
+ - 3518520747.0511127
240
  ---
241
 
242
  # Model description
243
 
244
+ This is a model trained to classify pieces of neuron as axon, dendrite, soma, orglia, based only on their local shape and synapse features.The model is a linear discriminant classifier which was trained on compartment labels generated by Bethanny Danskin for 3 6x6x6 um boxes in the Minnie65 Phase3 dataset.
245
 
246
  ## Intended uses & limitations
247
 
 
256
  <details>
257
  <summary> Click to expand </summary>
258
 
259
+ | Hyperparameter | Value |
260
+ | ------------------------------------ | ------------------------------------------------------------------------------------------------------------------------- |
261
+ | memory | |
262
+ | steps | [('transformer', QuantileTransformer(output_distribution='normal')), ('lda', LinearDiscriminantAnalysis(n_components=3))] |
263
+ | verbose | False |
264
+ | transformer | QuantileTransformer(output_distribution='normal') |
265
+ | lda | LinearDiscriminantAnalysis(n_components=3) |
266
+ | transformer\_\_copy | True |
267
+ | transformer\_\_ignore_implicit_zeros | False |
268
+ | transformer\_\_n_quantiles | 1000 |
269
+ | transformer\_\_output_distribution | normal |
270
+ | transformer\_\_random_state | |
271
+ | transformer\_\_subsample | 10000 |
272
+ | lda\_\_covariance_estimator | |
273
+ | lda\_\_n_components | 3 |
274
+ | lda\_\_priors | |
275
+ | lda\_\_shrinkage | |
276
+ | lda\_\_solver | svd |
277
+ | lda\_\_store_covariance | False |
278
+ | lda\_\_tol | 0.0001 |
279
 
280
  </details>
281
 
 
361
 
362
  ## Evaluation Results
363
 
364
+ ### Classification Report (overall)
 
 
 
 
 
 
 
 
 
 
365
 
366
+ | type | precision | recall | f1-score | support |
367
+ | ------------ | --------- | -------- | -------- | -------- |
368
+ | accuracy | 0.944357 | 0.944357 | 0.944357 | 0.944357 |
369
+ | macro avg | 0.854825 | 0.917289 | 0.878753 | 31307 |
370
+ | weighted avg | 0.946879 | 0.944357 | 0.945155 | 31307 |
371
 
372
+ ### Classification Report (by class)
 
373
 
374
+ | class | precision | recall | f1-score | support |
375
+ | -------- | --------- | -------- | -------- | ------- |
376
+ | axon | 0.956309 | 0.964704 | 0.960488 | 16404 |
377
+ | dendrite | 0.928038 | 0.911341 | 0.919614 | 6948 |
378
+ | glia | 0.964442 | 0.935279 | 0.949636 | 7540 |
379
+ | soma | 0.570513 | 0.857831 | 0.685274 | 415 |
380
 
381
+ # How to Get Started with the Model
382
 
 
 
383
  [More Information Needed]
 
 
 
 
 
 
 
384
 
385
+ # Model Card Authors
 
 
 
 
 
 
 
 
 
 
386
 
387
+ Ben Pedigo
388
+ Bethanny Danskin
 
 
 
 
train.py CHANGED
@@ -305,6 +305,7 @@ with open(model_pickle_file, mode="bw") as f:
305
  dump(final_lda, file=f)
306
 
307
  # %%
 
308
  from pathlib import Path
309
 
310
  from skops import card, hub_utils
@@ -323,8 +324,8 @@ if not hub_out_path.exists():
323
 
324
  hub_utils.add_files(__file__, dst=hub_out_path, exist_ok=True)
325
 
326
- # if not os.exists(hub_out_path / "README.md"):
327
- if True:
328
  model_card = card.Card(model, metadata=card.metadata_from_config(hub_out_path))
329
  model_card.metadata.license = "mit"
330
  model_description = (
 
305
  dump(final_lda, file=f)
306
 
307
  # %%
308
+ import os
309
  from pathlib import Path
310
 
311
  from skops import card, hub_utils
 
324
 
325
  hub_utils.add_files(__file__, dst=hub_out_path, exist_ok=True)
326
 
327
+ # if True:
328
+ if not os.path.exists(hub_out_path / "README.md"):
329
  model_card = card.Card(model, metadata=card.metadata_from_config(hub_out_path))
330
  model_card.metadata.license = "mit"
331
  model_description = (