File size: 1,943 Bytes
9ebfd41
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# ============================================================================
# node_pattern_confirmation.py — Step 3 of Nelson's framework (PLACEHOLDER)
# ============================================================================
#
# PURPOSE (from Nelson 2020)
# --------------------------
# "The pattern confirmation step assesses the inductively identified
#  patterns using further computational and natural language processing
#  techniques."
#
# Traditional grounded theory mapping: SELECTIVE CODING — the researcher
# validates the coded categories against held-out data, typically by
# training a supervised classifier on the refined labels and testing
# whether it generalizes.
#
# STATUS
# ------
# This is a PLACEHOLDER. When built, this node will:
#   1. Read state.refinement_result (the researcher-refined labels)
#   2. Train a classifier on 80% of the refined data (using the existing
#      training.train_classifier function)
#   3. Evaluate on the held-out 20%
#   4. Report accuracy, per-class precision/recall, and confusion matrix
#   5. Write results to state.confirmation_result
#
# Cannot be built until Step 2 (Pattern Refinement) is real, because this
# step needs refined labels as input.
# ============================================================================


def pattern_confirmation_node(state):
    iteration = state.get("iteration", 0)

    return {
        "confirmation_result": {
            "status": "placeholder",
            "note": (
                "Step 3 of Nelson's framework (selective coding / Pattern "
                "Confirmation) is not yet implemented. Blocked on Step 2 "
                "which produces the refined labels this step validates."
            ),
        },
        "steps": [{
            "step": iteration,
            "node": "pattern_confirmation",
            "action": "placeholder",
            "detail": "Step 3 not yet implemented",
        }],
    }