mrshravan commited on
Commit
c7c5e29
·
verified ·
1 Parent(s): de095ba

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +30 -2
README.md CHANGED
@@ -32,16 +32,44 @@ A causal reasoning foundation model — predicts effects, judges trustworthiness
32
  - Curriculum: Phase 1 CATE-only → Phase 2 +Null → Phase 3 Full judgment
33
 
34
  ## Usage
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
  ```python
36
  from tcpfn import TemporalCausalAnalyzer
37
 
38
  analyzer = TemporalCausalAnalyzer(
39
  temporal_model="models/temporal/final.pt",
40
  )
 
 
41
  report = analyzer.run("sensor_data.csv")
42
  print(report.edges) # causal graph
43
- print(report.judgments) # null prob, regime, identifiability per edge
44
- print(report.root_causes) # ranked root causes
 
 
 
 
 
 
45
  ```
46
 
47
  ## Training Metrics (mean over steps 150K-200K)
 
32
  - Curriculum: Phase 1 CATE-only → Phase 2 +Null → Phase 3 Full judgment
33
 
34
  ## Usage
35
+
36
+ ### CLI (recommended)
37
+ ```bash
38
+ # Full analysis + root cause analysis in one shot
39
+ tcpfn infer sensor_data.csv \
40
+ --target "temperature_sensor" \
41
+ --event-time "2025-11-15 14:15" \
42
+ -o results.json
43
+
44
+ # Discovery only (no specific event)
45
+ tcpfn analyze sensor_data.csv -o analysis.json
46
+
47
+ # RCA only (reuse previous analysis)
48
+ tcpfn explain sensor_data.csv \
49
+ --target "temperature_sensor" \
50
+ --event-time "2025-11-15 14:15" \
51
+ --analysis analysis.json
52
+ ```
53
+
54
+ ### Python SDK
55
  ```python
56
  from tcpfn import TemporalCausalAnalyzer
57
 
58
  analyzer = TemporalCausalAnalyzer(
59
  temporal_model="models/temporal/final.pt",
60
  )
61
+
62
+ # Causal discovery + effects
63
  report = analyzer.run("sensor_data.csv")
64
  print(report.edges) # causal graph
65
+
66
+ # Root cause analysis
67
+ result = analyzer.explain_event(
68
+ data_path="sensor_data.csv",
69
+ target_var="temperature_sensor",
70
+ event_time="2025-11-15 14:15",
71
+ )
72
+ print(result.summary()) # ranked root causes + causal chains
73
  ```
74
 
75
  ## Training Metrics (mean over steps 150K-200K)