[FEAT] Quality-Filter f�r Charts & KI-Pipeline #24

Closed
opened 2026-03-23 18:04:35 +01:00 by Lars · 0 comments
Owner

Bezug: Issue #15 (Teilaufgabe)
Priorit�t: High
Aufwand: ~3h

Problem

Charts und KI nutzen ALLE Aktivit�ten, auch minderwertige (5-Min-Spazierg�nge als "Lauf").

L�sung

1. KI-Pipeline Quality-Filter

# backend/routers/insights.py
cur.execute("""
    SELECT * FROM activity_log 
    WHERE profile_id = %s 
      AND (quality_label IS NULL OR quality_label IN ('acceptable', 'good', 'excellent'))
    ORDER BY date DESC LIMIT 90
""", (pid,))

2. Charts Quality-Toggle

// frontend/src/pages/History.jsx
const [filterQuality, setFilterQuality] = useState(true)
const filtered = activities.filter(a => 
    !filterQuality || !a.quality_label || 
    ['acceptable', 'good', 'excellent'].includes(a.quality_label)
)

3. Auto-Evaluation nach Import

# backend/routers/activity.py - nach CSV Import
from evaluation import evaluate_single_activity
for activity_id in newly_imported:
    evaluate_single_activity(cur, activity_id)

Betroffene Dateien

  • backend/routers/insights.py
  • frontend/src/pages/History.jsx
  • backend/routers/activity.py

Akzeptanzkriterien

  • KI-Variablen nutzen nur quality >= acceptable
  • History Charts haben Toggle
  • Import evaluiert automatisch
**Bezug:** Issue #15 (Teilaufgabe) **Priorit�t:** High **Aufwand:** ~3h ## Problem Charts und KI nutzen ALLE Aktivit�ten, auch minderwertige (5-Min-Spazierg�nge als "Lauf"). ## L�sung ### 1. KI-Pipeline Quality-Filter ```python # backend/routers/insights.py cur.execute(""" SELECT * FROM activity_log WHERE profile_id = %s AND (quality_label IS NULL OR quality_label IN ('acceptable', 'good', 'excellent')) ORDER BY date DESC LIMIT 90 """, (pid,)) ``` ### 2. Charts Quality-Toggle ```javascript // frontend/src/pages/History.jsx const [filterQuality, setFilterQuality] = useState(true) const filtered = activities.filter(a => !filterQuality || !a.quality_label || ['acceptable', 'good', 'excellent'].includes(a.quality_label) ) ``` ### 3. Auto-Evaluation nach Import ```python # backend/routers/activity.py - nach CSV Import from evaluation import evaluate_single_activity for activity_id in newly_imported: evaluate_single_activity(cur, activity_id) ``` ## Betroffene Dateien - backend/routers/insights.py - frontend/src/pages/History.jsx - backend/routers/activity.py ## Akzeptanzkriterien - KI-Variablen nutzen nur quality >= acceptable - History Charts haben Toggle - Import evaluiert automatisch
Lars added the
feature
high
develop
labels 2026-03-23 18:04:35 +01:00
Lars closed this issue 2026-03-23 21:59:14 +01:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Lars/mitai-jinkendo#24
No description provided.