This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
precision recall f1-score support | |
0 0.99 1.00 0.99 4995 | |
1 0.93 0.73 0.82 243 | |
accuracy 0.98 5238 | |
macro avg 0.96 0.86 0.91 5238 | |
weighted avg 0.98 0.98 0.98 5238 | |
[[4981 14] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
precision recall f1-score support | |
0 0.99 1.00 0.99 4995 | |
1 0.93 0.73 0.82 243 | |
accuracy 0.98 5238 | |
macro avg 0.96 0.86 0.91 5238 | |
weighted avg 0.98 0.98 0.98 5238 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
precision recall f1-score support | |
0 0.99 1.00 0.99 4444 | |
1 0.96 0.77 0.85 271 | |
accuracy 0.98 4715 | |
macro avg 0.97 0.88 0.92 4715 | |
weighted avg 0.98 0.98 0.98 4715 | |
[[4435 9] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
import dateparser | |
from scrapy.downloadermiddlewares.retry import RetryMiddleware | |
from scrapy.http import Request | |
# Defering requests might cause spider to be idle and close | |
# Workaround to keep spider open | |
class ImmortalSpiderMiddleware(object): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Shortcut for running emacsclient in the background | |
e() { emacsclient -c "$@" & disown} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import argparse | |
import json | |
from bugbug import bugzilla | |
from datetime import date, timedelta | |
def get_untriaged(args): | |
# Calculare daterange | |
today = date.today() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(bugbug) nemo@ip-172-31-8-187:~/workspace/bugbug$ python run.py --goal component --classifier nn --train --classify | |
Using TensorFlow backend. | |
144 components | |
Core::Graphics: 3646 | |
Firefox: 3448 | |
Core::Layout: 3248 | |
Core::JavaScript: 2779 | |
Core::DOM: 2715 | |
WebExtensions: 2507 | |
Core::CSS Parsing and Computation: 2167 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -110,6 +110,11 @@ class Model(): | |
if self.calculate_classification_metrics: | |
y_pred = self.clf.predict(X_test) | |
print(f'No confidence threshold - {len(y_test)} classified') | |
+ | |
+ # HACK | |
+ if y_test.ndim == 2: | |
+ y_test = np.argmax(y_test, axis=1) | |
+ | |
print(metrics.confusion_matrix(y_test, y_pred, labels=class_names)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from nameparser import HumanName | |
def get_access_information(obj): | |
from mozillians.groups.models import GroupMembership | |
memberships = GroupMembership.objects.filter(userprofile=obj, status=GroupMembership.MEMBER, group__is_access_group=True) | |
output = {} | |
for m in memberships: | |
output[m.group.url] = None | |
return output |