Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/monitoring script integration #32

Merged
merged 19 commits into from
Aug 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 38 additions & 8 deletions core/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,16 @@ class EntryAdmin(admin.ModelAdmin):
"original_entry_id",
"lead",
"excerpt",
"original_af_tags"
"original_af_tags",
"nlp_tags",
"deep_entry_created_at",
]


class AllProjectMetricsAdmin(admin.ModelAdmin):
list_display = [
"id",
"categories",
"category",
"precision",
"recall",
"support",
Expand Down Expand Up @@ -135,11 +137,40 @@ class ProjectWisePerfMetricsAdmin(admin.ModelAdmin):
"sectors_f1score",
"sectors_precision",
"sectors_recall",
"sectors_support",
"pillars_1d_f1score",
"pillars_1d_precision",
"pillars_1d_recall",
"pillars_2d_f1score",
"pillars_2d_precision",
"pillars_2d_recall",
"subpillars_1d_f1score",
"subpillars_1d_precision",
"subpillars_1d_recall",
"subpillars_1d_support",
"subpillars_2d_f1score",
"subpillars_2d_precision",
"subpillars_2d_recall",
"age_f1score",
"age_precision",
"age_recall",
"displaced_f1score",
"displaced_precision",
"displaced_recall",
"gender_f1score",
"gender_precision",
"gender_recall",
"non_displaced_f1score",
"non_displaced_precision",
"non_displaced_recall",
"severity_f1score",
"severity_precision",
"severity_recall",
"specific_needs_groups_f1score",
"specific_needs_groups_precision",
"specific_needs_groups_recall",
"affected_f1score",
"affected_precision",
"affected_recall",
"generated_at",
]


Expand All @@ -157,17 +188,16 @@ class CategoryWiseMatchRatiosAdmin(admin.ModelAdmin):
"subpillars_2d_completely_matched",
"subpillars_2d_missing",
"subpillars_2d_wrong",
"generated_at",
]


class TagWisePerfMetricsAdmin(admin.ModelAdmin):
list_display = [
"id",
"tags",
"precision",
"recall",
"f1score",
"support",
"score",
"metric",
"generated_at",
]

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Generated by Django 4.2.3 on 2023-08-09 04:42

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('core', '0014_auto_20230721_0607'),
]

operations = [
migrations.RemoveField(
model_name='allprojectperfmetrics',
name='categories',
),
migrations.RemoveField(
model_name='projectwiseperfmetrics',
name='sectors_support',
),
migrations.RemoveField(
model_name='projectwiseperfmetrics',
name='subpillars_1d_support',
),
migrations.RemoveField(
model_name='projectwiseperfmetrics',
name='subpillars_2d_support',
),
migrations.RemoveField(
model_name='tagwiseperfmetrics',
name='f1score',
),
migrations.RemoveField(
model_name='tagwiseperfmetrics',
name='precision',
),
migrations.RemoveField(
model_name='tagwiseperfmetrics',
name='recall',
),
migrations.RemoveField(
model_name='tagwiseperfmetrics',
name='support',
),
]
163 changes: 163 additions & 0 deletions core/migrations/0016_allprojectperfmetrics_category_and_more.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
# Generated by Django 4.2.3 on 2023-08-09 04:45

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('core', '0015_remove_allprojectperfmetrics_categories_and_more'),
]

operations = [
migrations.AddField(
model_name='allprojectperfmetrics',
name='category',
field=models.CharField(blank=True, max_length=250),
),
migrations.AddField(
model_name='projectwiseperfmetrics',
name='affected_f1score',
field=models.FloatField(blank=True, null=True),
),
migrations.AddField(
model_name='projectwiseperfmetrics',
name='affected_precision',
field=models.FloatField(blank=True, null=True),
),
migrations.AddField(
model_name='projectwiseperfmetrics',
name='affected_recall',
field=models.FloatField(blank=True, null=True),
),
migrations.AddField(
model_name='projectwiseperfmetrics',
name='age_f1score',
field=models.FloatField(blank=True, null=True),
),
migrations.AddField(
model_name='projectwiseperfmetrics',
name='age_precision',
field=models.FloatField(blank=True, null=True),
),
migrations.AddField(
model_name='projectwiseperfmetrics',
name='age_recall',
field=models.FloatField(blank=True, null=True),
),
migrations.AddField(
model_name='projectwiseperfmetrics',
name='displaced_f1score',
field=models.FloatField(blank=True, null=True),
),
migrations.AddField(
model_name='projectwiseperfmetrics',
name='displaced_precision',
field=models.FloatField(blank=True, null=True),
),
migrations.AddField(
model_name='projectwiseperfmetrics',
name='displaced_recall',
field=models.FloatField(blank=True, null=True),
),
migrations.AddField(
model_name='projectwiseperfmetrics',
name='gender_f1score',
field=models.FloatField(blank=True, null=True),
),
migrations.AddField(
model_name='projectwiseperfmetrics',
name='gender_precision',
field=models.FloatField(blank=True, null=True),
),
migrations.AddField(
model_name='projectwiseperfmetrics',
name='gender_recall',
field=models.FloatField(blank=True, null=True),
),
migrations.AddField(
model_name='projectwiseperfmetrics',
name='non_displaced_f1score',
field=models.FloatField(blank=True, null=True),
),
migrations.AddField(
model_name='projectwiseperfmetrics',
name='non_displaced_precision',
field=models.FloatField(blank=True, null=True),
),
migrations.AddField(
model_name='projectwiseperfmetrics',
name='non_displaced_recall',
field=models.FloatField(blank=True, null=True),
),
migrations.AddField(
model_name='projectwiseperfmetrics',
name='pillars_1d_f1score',
field=models.FloatField(blank=True, null=True),
),
migrations.AddField(
model_name='projectwiseperfmetrics',
name='pillars_1d_precision',
field=models.FloatField(blank=True, null=True),
),
migrations.AddField(
model_name='projectwiseperfmetrics',
name='pillars_1d_recall',
field=models.FloatField(blank=True, null=True),
),
migrations.AddField(
model_name='projectwiseperfmetrics',
name='pillars_2d_f1score',
field=models.FloatField(blank=True, null=True),
),
migrations.AddField(
model_name='projectwiseperfmetrics',
name='pillars_2d_precision',
field=models.FloatField(blank=True, null=True),
),
migrations.AddField(
model_name='projectwiseperfmetrics',
name='pillars_2d_recall',
field=models.FloatField(blank=True, null=True),
),
migrations.AddField(
model_name='projectwiseperfmetrics',
name='severity_f1score',
field=models.FloatField(blank=True, null=True),
),
migrations.AddField(
model_name='projectwiseperfmetrics',
name='severity_precision',
field=models.FloatField(blank=True, null=True),
),
migrations.AddField(
model_name='projectwiseperfmetrics',
name='severity_recall',
field=models.FloatField(blank=True, null=True),
),
migrations.AddField(
model_name='projectwiseperfmetrics',
name='specific_needs_groups_f1score',
field=models.FloatField(blank=True, null=True),
),
migrations.AddField(
model_name='projectwiseperfmetrics',
name='specific_needs_groups_precision',
field=models.FloatField(blank=True, null=True),
),
migrations.AddField(
model_name='projectwiseperfmetrics',
name='specific_needs_groups_recall',
field=models.FloatField(blank=True, null=True),
),
migrations.AddField(
model_name='tagwiseperfmetrics',
name='metric',
field=models.CharField(blank=True, max_length=250, null=True),
),
migrations.AddField(
model_name='tagwiseperfmetrics',
name='score',
field=models.FloatField(blank=True, null=True),
),
]
39 changes: 31 additions & 8 deletions core/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,15 +266,40 @@ class ProjectWisePerfMetrics(models.Model):
sectors_f1score = models.FloatField(blank=True, null=True)
sectors_precision = models.FloatField(blank=True, null=True)
sectors_recall = models.FloatField(blank=True, null=True)
sectors_support = models.FloatField(blank=True, null=True)
subpillars_1d_f1score = models.FloatField(blank=True, null=True)
subpillars_1d_precision = models.FloatField(blank=True, null=True)
subpillars_1d_recall = models.FloatField(blank=True, null=True)
subpillars_1d_support = models.FloatField(blank=True, null=True)
subpillars_2d_f1score = models.FloatField(blank=True, null=True)
subpillars_2d_precision = models.FloatField(blank=True, null=True)
subpillars_2d_recall = models.FloatField(blank=True, null=True)
subpillars_2d_support = models.FloatField(blank=True, null=True)
pillars_1d_f1score = models.FloatField(blank=True, null=True)
pillars_1d_precision = models.FloatField(blank=True, null=True)
pillars_1d_recall = models.FloatField(blank=True, null=True)
pillars_2d_f1score = models.FloatField(blank=True, null=True)
pillars_2d_precision = models.FloatField(blank=True, null=True)
pillars_2d_recall = models.FloatField(blank=True, null=True)
age_f1score = models.FloatField(blank=True, null=True)
age_precision = models.FloatField(blank=True, null=True)
age_recall = models.FloatField(blank=True, null=True)
displaced_f1score = models.FloatField(blank=True, null=True)
displaced_precision = models.FloatField(blank=True, null=True)
displaced_recall = models.FloatField(blank=True, null=True)
gender_f1score = models.FloatField(blank=True, null=True)
gender_precision = models.FloatField(blank=True, null=True)
gender_recall = models.FloatField(blank=True, null=True)
non_displaced_f1score = models.FloatField(blank=True, null=True)
non_displaced_precision = models.FloatField(blank=True, null=True)
non_displaced_recall = models.FloatField(blank=True, null=True)
severity_f1score = models.FloatField(blank=True, null=True)
severity_precision = models.FloatField(blank=True, null=True)
severity_recall = models.FloatField(blank=True, null=True)
specific_needs_groups_f1score = models.FloatField(blank=True, null=True)
specific_needs_groups_precision = models.FloatField(blank=True, null=True)
specific_needs_groups_recall = models.FloatField(blank=True, null=True)
affected_f1score = models.FloatField(blank=True, null=True)
affected_precision = models.FloatField(blank=True, null=True)
affected_recall = models.FloatField(blank=True, null=True)

generated_at = models.DateTimeField()

def __str__(self):
Expand All @@ -283,18 +308,16 @@ def __str__(self):

class TagWisePerfMetrics(models.Model):
tags = models.CharField(max_length=250, blank=True)
precision = models.FloatField(blank=True, null=True)
recall = models.FloatField(blank=True, null=True)
f1score = models.FloatField(blank=True, null=True)
support = models.IntegerField(blank=True, null=True)
generated_at = models.DateTimeField()
score = models.FloatField(blank=True, null=True)
metric = models.CharField(max_length=250, blank=True, null=True)

def __str__(self):
return self.tags


class AllProjectPerfMetrics(models.Model):
categories = models.CharField(max_length=250, blank=True)
category = models.CharField(max_length=250, blank=True)
precision = models.FloatField(blank=True, null=True)
recall = models.FloatField(blank=True, null=True)
f1score = models.FloatField(blank=True, null=True)
Expand Down
Loading
Loading