-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkeywords_guide.html
More file actions
1438 lines (1390 loc) · 75 KB
/
keywords_guide.html
File metadata and controls
1438 lines (1390 loc) · 75 KB
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>SmartWatt – Keywords Guide</title>
<style>
:root {
--bg: #0d1117;
--card: #161b22;
--card2: #1c2128;
--accent: #58a6ff;
--green: #3fb950;
--yellow: #d29922;
--red: #f85149;
--purple: #bc8cff;
--text: #e6edf3;
--muted: #8b949e;
--border: #30363d
}
* {
margin: 0;
padding: 0;
box-sizing: border-box
}
body {
font-family: 'Segoe UI', system-ui, sans-serif;
background: var(--bg);
color: var(--text);
line-height: 1.7
}
.wrap {
max-width: 1050px;
margin: 0 auto;
padding: 20px
}
header {
background: linear-gradient(135deg, #1f2d3d, #0d1117);
border-bottom: 1px solid var(--border);
padding: 32px 20px;
text-align: center
}
header h1 {
font-size: 2rem;
background: linear-gradient(90deg, var(--accent), var(--purple));
-webkit-background-clip: text;
background-clip: text;
-webkit-text-fill-color: transparent;
margin-bottom: 6px
}
header p {
color: var(--muted);
font-size: .93rem
}
nav {
background: var(--card);
border-bottom: 1px solid var(--border);
padding: 10px 20px;
position: sticky;
top: 0;
z-index: 99;
display: flex;
flex-wrap: wrap;
gap: 8px
}
nav a {
color: var(--muted);
font-size: .82rem;
padding: 4px 10px;
border-radius: 6px;
transition: all .2s;
text-decoration: none
}
nav a:hover {
background: var(--card2);
color: var(--accent)
}
section {
margin: 28px 0
}
.card {
background: var(--card);
border: 1px solid var(--border);
border-radius: 10px;
padding: 24px;
margin: 14px 0
}
.card h2 {
font-size: 1.3rem;
color: var(--accent);
margin-bottom: 14px;
padding-bottom: 8px;
border-bottom: 1px solid var(--border)
}
table {
width: 100%;
border-collapse: collapse;
margin: 6px 0;
font-size: .9rem
}
th {
background: var(--card2);
color: var(--accent);
padding: 10px 14px;
text-align: left;
border: 1px solid var(--border);
font-weight: 600
}
td {
padding: 10px 14px;
border: 1px solid var(--border);
color: #c9d1d9;
vertical-align: top
}
td:first-child {
color: var(--yellow);
font-weight: 600;
white-space: nowrap;
min-width: 190px;
font-family: 'Courier New', monospace;
font-size: .88rem
}
tr:nth-child(even) td {
background: #1a1f27
}
code {
background: #1e2a3a;
padding: 2px 7px;
border-radius: 4px;
font-size: .87rem;
color: #79c0ff;
font-family: 'Courier New', monospace
}
.note {
background: #0d1f2d;
border-left: 4px solid var(--accent);
border-radius: 0 8px 8px 0;
padding: 12px 16px;
margin: 12px 0;
color: #a8d4f5;
font-size: .93rem
}
.tip {
background: #1a1a2e;
border-left: 4px solid var(--purple);
border-radius: 0 8px 8px 0;
padding: 14px 18px;
margin: 16px 0;
color: #d0b8ff;
font-size: .95rem
}
.warn {
background: #2a1f00;
border-left: 4px solid var(--yellow);
border-radius: 0 8px 8px 0;
padding: 12px 16px;
margin: 12px 0;
color: #e4c072;
font-size: .93rem
}
.hl {
color: var(--accent);
font-weight: 600
}
.cat {
display: inline-block;
padding: 1px 8px;
border-radius: 10px;
font-size: .72rem;
font-weight: 700;
margin-left: 6px;
vertical-align: middle
}
.c-ai {
background: #1a1a3a;
color: var(--purple)
}
.c-py {
background: #1a3a2a;
color: var(--green)
}
.c-fe {
background: #1f3a5f;
color: var(--accent)
}
.c-db {
background: #3a1a2a;
color: #ff79c6
}
.c-ph {
background: #3a2e00;
color: var(--yellow)
}
.c-sp {
background: #1a2a1a;
color: #a8ff78
}
</style>
</head>
<body>
<header>
<h1>🔑 SmartWatt — Keywords & Terms Guide</h1>
<p>Every important keyword, term, function, and concept — explained in 1–2 simple lines · For Viva Preparation
</p>
<div style="margin-top:10px;font-size:.82rem;color:var(--muted)">
<span style="background:#1a1a3a;color:var(--purple);padding:2px 8px;border-radius:8px;margin:2px">🤖
AI/ML</span>
<span style="background:#1a3a2a;color:var(--green);padding:2px 8px;border-radius:8px;margin:2px">🐍
Python/Backend</span>
<span style="background:#1f3a5f;color:var(--accent);padding:2px 8px;border-radius:8px;margin:2px">⚛️
Frontend</span>
<span style="background:#3a1a2a;color:#ff79c6;padding:2px 8px;border-radius:8px;margin:2px">🗄️
Database</span>
<span style="background:#3a2e00;color:var(--yellow);padding:2px 8px;border-radius:8px;margin:2px">⚡
Physics/Electrical</span>
<span style="background:#1a2a1a;color:#a8ff78;padding:2px 8px;border-radius:8px;margin:2px">🎯
Project-Specific</span>
</div>
</header>
<nav>
<a href="#aiml">AI & ML</a>
<a href="#nn">Neural Network</a>
<a href="#training">Training Terms</a>
<a href="#project">Project-Specific</a>
<a href="#backend">Backend / Python</a>
<a href="#api">API Terms</a>
<a href="#electrical">Electrical / Physics</a>
<a href="#kseb">KSEB & Billing</a>
<a href="#database">Database</a>
<a href="#frontend">Frontend / Web</a>
<a href="#general">General CS</a>
</nav>
<div class="wrap">
<div class="tip">💡 <strong>How to use this guide:</strong> Find the keyword the mentor asks, read the "What It
Is" and "In SmartWatt" columns. Always try to connect the term back to SmartWatt — that's what impresses
examiners.</div>
<!-- ══════════════════════════════════════════════════ -->
<section id="aiml">
<div class="card">
<h2>🤖 Artificial Intelligence & Machine Learning Terms</h2>
<table>
<tr>
<th>Term</th>
<th>What It Is — What It Does in SmartWatt</th>
</tr>
<tr>
<td>Artificial Intelligence (AI)</td>
<td>Technology that makes computers learn and make decisions like humans. In SmartWatt, AI
learns household electricity usage patterns from data and predicts how much each appliance
consumes.</td>
</tr>
<tr>
<td>Machine Learning (ML)</td>
<td>A branch of AI where a program learns from data without being explicitly programmed.
SmartWatt uses ML to train 22 neural network models that predict appliance consumption.</td>
</tr>
<tr>
<td>Neural Network</td>
<td>An AI model inspired by the human brain — made of connected layers of "neurons". SmartWatt
uses one neural network per appliance (22 total) to predict efficiency factor and effective
hours.</td>
</tr>
<tr>
<td>Deep Learning</td>
<td>A type of ML that uses neural networks with multiple hidden layers. SmartWatt's multi-layer
network (128→64 neurons) is a deep learning model.</td>
</tr>
<tr>
<td>Supervised Learning</td>
<td>Training a model using labelled input-output pairs. SmartWatt trains with synthetic data
where inputs = appliance specs and outputs = efficiency factor + usage hours.</td>
</tr>
<tr>
<td>Multi-output Neural Network</td>
<td>A neural network that predicts two values at the same time from one input. SmartWatt uses
this to predict both <em>efficiency factor</em> (0.5–1.5) and <em>effective hours</em>
(0–24) in a single forward pass.</td>
</tr>
<tr>
<td>Hybrid AI–Physics Model</td>
<td>SmartWatt's most important concept — combines AI (learns patterns) with physics formulas
(sets real-world limits). This prevents unrealistic predictions while still capturing
complex usage patterns.</td>
</tr>
<tr>
<td>Prediction / Inference</td>
<td>Using a trained AI model on new, unseen data to get outputs. Every time a user submits
appliances in SmartWatt, the system runs inference on each appliance's neural network.</td>
</tr>
<tr>
<td>Overfitting</td>
<td>When a model memorises training data instead of learning general patterns — performs well on
training data but badly on new data. SmartWatt prevents this using Dropout and Early
Stopping.</td>
</tr>
<tr>
<td>Generalisation</td>
<td>A model's ability to perform well on new, unseen data. SmartWatt generalises by training on
diverse 12,000-household data with varied seasons, locations, and appliance specs.</td>
</tr>
<tr>
<td>Monte Carlo Simulation</td>
<td>A technique that randomly samples from defined probability distributions many times to
generate large, realistic datasets. SmartWatt uses it to generate 12,000 Kerala household
electricity profiles for training.</td>
</tr>
<tr>
<td>Synthetic Dataset</td>
<td>A dataset generated by computer simulation rather than collected from real measurements.
SmartWatt uses a synthetic dataset because real KSEB meter data is not publicly available.
</td>
</tr>
<tr>
<td>Feature</td>
<td>A single measurable input variable given to a machine learning model. SmartWatt features
include: <code>ac_tonnage</code>, <code>star_rating</code>, <code>n_occupants</code>,
<code>season</code>, <code>location_type</code>.
</td>
</tr>
<tr>
<td>Label / Target</td>
<td>The output value a model is trained to predict. In SmartWatt, the labels are
<code>real_efficiency_factor</code> and <code>real_effective_hours</code> for each
appliance.
</td>
</tr>
<tr>
<td>Confidence Score</td>
<td>A percentage showing how much the system trusts its own prediction. SmartWatt starts at
98.2% and reduces it if anomalies are detected, fallback mode is used, or input features are
missing.</td>
</tr>
<tr>
<td>Anomaly Detection</td>
<td>Identifying data points that deviate significantly from normal. SmartWatt has two types:
<strong>Usage Anomaly</strong> (hours exceed limits) and <strong>Efficiency Anomaly</strong>
(appliance consuming 15%+ more than rated).
</td>
</tr>
<tr>
<td>Bias (in AI)</td>
<td>A systematic error in predictions. SmartWatt's <code>BiasAdjuster</code> service detects
when predictions are consistently off for a user and applies a correction multiplier.</td>
</tr>
<tr>
<td>Self-Learning System</td>
<td>A system that automatically improves using real production data over time. SmartWatt
retrains its models every 6 hours using actual user data from Supabase.</td>
</tr>
<tr>
<td>Model Deployment</td>
<td>Making a trained AI model available for live use. SmartWatt deploys updated models only if
they pass MAE and R² validation — preventing regressions.</td>
</tr>
</table>
</div>
</section>
<!-- ══════════════════════════════════════════════════ -->
<section id="nn">
<div class="card">
<h2>🧠 Neural Network Architecture Terms</h2>
<table>
<tr>
<th>Term</th>
<th>What It Is — What It Does in SmartWatt</th>
</tr>
<tr>
<td>Neuron / Node</td>
<td>The basic unit of a neural network — takes inputs, multiplies by weights, adds bias, and
passes through activation function. SmartWatt's hidden layers have 128 and 64 neurons.</td>
</tr>
<tr>
<td>Layer</td>
<td>A group of neurons at the same level in the network. SmartWatt has: Input Layer → Hidden
Layer 1 (128) → Hidden Layer 2 (64) → Two Output Heads.</td>
</tr>
<tr>
<td>Input Layer</td>
<td>The first layer that receives raw data. SmartWatt's input is appliance specs + household
features (tonnage, star rating, season, occupants, etc.).</td>
</tr>
<tr>
<td>Hidden Layer</td>
<td>Intermediate layers between input and output — learn complex patterns. SmartWatt has two:
128 neurons then 64 neurons, both with ReLU activation.</td>
</tr>
<tr>
<td>Output Layer / Head</td>
<td>The final layer giving the prediction. SmartWatt has two output heads — one for efficiency
factor, one for effective hours (multi-output design).</td>
</tr>
<tr>
<td>Shared Layers</td>
<td>Hidden layers whose learned representations feed into multiple output branches. SmartWatt's
128→64 layers are shared between the efficiency and hours output heads.</td>
</tr>
<tr>
<td>Activation Function (ReLU)</td>
<td>A function applied to each neuron's output — ReLU outputs 0 for negative values and the
value itself for positives. Used in SmartWatt's hidden layers to add non-linearity and learn
complex patterns.</td>
</tr>
<tr>
<td>Weight / Parameter</td>
<td>Numbers inside a neural network that are adjusted during training to minimise error.
SmartWatt's models update hundreds of weights per training step.</td>
</tr>
<tr>
<td>Dropout</td>
<td>A regularization technique that randomly turns off 20% of neurons during each training step
— prevents overfitting. SmartWatt applies <code>Dropout(0.2)</code> between hidden layers.
</td>
</tr>
<tr>
<td>Forward Pass</td>
<td>The process of feeding input data through the network to get an output/prediction. Every
SmartWatt prediction is a forward pass through the appliance's neural network.</td>
</tr>
<tr>
<td>Backpropagation</td>
<td>The process of sending error backwards through the network to update weights during
training. Used in SmartWatt's training loop.</td>
</tr>
<tr>
<td>Loss Function (MSE)</td>
<td>A formula that measures how wrong the model's predictions are. SmartWatt uses Mean Squared
Error (MSE) — penalises larger errors more heavily.</td>
</tr>
<tr>
<td>Loss Weight</td>
<td>A multiplier applied to individual output losses in a multi-output model. SmartWatt weighs
efficiency loss 10× higher than hours loss because efficiency is harder to predict
accurately.</td>
</tr>
<tr>
<td>Optimizer (Adam)</td>
<td>An algorithm that adjusts weights to reduce loss. Adam (Adaptive Moment Estimation) is used
in SmartWatt — it automatically adjusts the learning rate per parameter.</td>
</tr>
<tr>
<td>Learning Rate</td>
<td>Controls how big each weight update step is during training. Too high = unstable, too low =
slow. Adam handles this automatically in SmartWatt.</td>
</tr>
</table>
</div>
</section>
<!-- ══════════════════════════════════════════════════ -->
<section id="training">
<div class="card">
<h2>📊 Training & Evaluation Terms</h2>
<table>
<tr>
<th>Term</th>
<th>What It Is — What It Does in SmartWatt</th>
</tr>
<tr>
<td>Epoch</td>
<td>One complete pass through the entire training dataset. SmartWatt trains for up to 120
epochs, but Early Stopping usually stops it earlier when validation loss plateaus.</td>
</tr>
<tr>
<td>Batch Size</td>
<td>Number of training samples processed in one step before weights are updated. SmartWatt uses
batch size 32 — a balance between speed and stable learning.</td>
</tr>
<tr>
<td>Training Set</td>
<td>Data used to train/learn model weights. SmartWatt uses 80% of the 12,000-household dataset
for training.</td>
</tr>
<tr>
<td>Validation Set</td>
<td>Data not seen during training, used to monitor performance after each epoch. SmartWatt uses
the remaining 20% as the validation set.</td>
</tr>
<tr>
<td>Early Stopping</td>
<td>A technique that stops training when validation loss doesn't improve for a set number of
epochs. SmartWatt uses patience=10 — stops if no improvement for 10 consecutive epochs, then
restores the best weights.</td>
</tr>
<tr>
<td>MAE (Mean Absolute Error)</td>
<td>Average of absolute differences between predicted and actual values. SmartWatt's
LearningPipeline uses MAE to judge if a newly trained model is better than the current one.
</td>
</tr>
<tr>
<td>R² Score</td>
<td>Measures how well the model explains variance in the data — 1.0 is perfect, 0 means no
better than mean. SmartWatt requires a higher R² for the new model to replace the old one in
production.</td>
</tr>
<tr>
<td>StandardScaler</td>
<td>A scikit-learn tool that normalises numerical features to have mean=0 and standard
deviation=1. SmartWatt scales numeric features like tonnage, capacity, occupants before
feeding to the neural network.</td>
</tr>
<tr>
<td>OneHotEncoding</td>
<td>Converts categorical variables into binary columns. SmartWatt encodes features like
<code>season</code> (summer/monsoon/winter) and <code>location_type</code> (urban/rural)
this way.
</td>
</tr>
<tr>
<td>ColumnTransformer</td>
<td>A scikit-learn pipeline tool that applies different preprocessing steps to different
columns. SmartWatt uses it to apply StandardScaler to numerics and OneHotEncoder to
categoricals simultaneously.</td>
</tr>
<tr>
<td>Preprocessor (.pkl)</td>
<td>The saved scikit-learn ColumnTransformer fitted during training. Saved as a
<code>.pkl</code> file alongside each model and used at inference time to transform new
inputs identically.
</td>
</tr>
<tr>
<td>Train-Test Split</td>
<td>Dividing dataset into separate training and evaluation portions. SmartWatt uses 80/20 split
— 9,600 for training, 2,400 for validation.</td>
</tr>
<tr>
<td>model.save() / .keras</td>
<td>TensorFlow function to save a trained model to disk. SmartWatt saves each of the 22 models
as <code>appliance_model.keras</code> files in the <code>models/</code> folder.</td>
</tr>
<tr>
<td>joblib (.pkl)</td>
<td>A Python library for efficiently saving and loading scikit-learn objects (like the
preprocessor pipelines). Each appliance preprocessor is saved as
<code>appliance_preprocessor.pkl</code>.
</td>
</tr>
<tr>
<td>ThreadPoolExecutor</td>
<td>A Python library for running tasks in parallel threads. SmartWatt uses it in
<code>BatchPredictor</code> to predict all 22 appliances simultaneously — 3–5× faster than
sequential.
</td>
</tr>
</table>
</div>
</section>
<!-- ══════════════════════════════════════════════════ -->
<section id="project">
<div class="card">
<h2>🎯 SmartWatt Project-Specific Terms</h2>
<table>
<tr>
<th>Term</th>
<th>What It Is — What It Does in SmartWatt</th>
</tr>
<tr>
<td>Efficiency Factor</td>
<td>AI output 1 — ranges 0.5 to 1.5. Represents appliance degradation: 1.0 = rated performance,
1.2 = 20% more power (degraded), 0.8 = efficient. Used in the final kWh formula.</td>
</tr>
<tr>
<td>Effective Hours</td>
<td>AI output 2 — ranges 0 to 24 hours/day. The model's learned estimate of how many hours this
appliance actually operates daily given the household context.</td>
</tr>
<tr>
<td>Base Watts</td>
<td>The rated electrical power of an appliance calculated by the Physics Engine from specs.
e.g., 1.5T 3-star AC → 2160W. Multiplied with efficiency factor and hours to get kWh.</td>
</tr>
<tr>
<td>monthly_kWh formula</td>
<td>The core calculation:
<code>(Base Watts × Efficiency Factor × Effective Hours × 30) / 1000</code>. Dividing by
1000 converts Wh to kWh, multiplying by 30 gives monthly total.
</td>
</tr>
<tr>
<td>System Load</td>
<td>Unaccounted electricity from standby devices, phone chargers, routers, wiring losses —
things the user didn't list. SmartWatt caps this at 15% of total consumption.</td>
</tr>
<tr>
<td>System Load Cap (15%)</td>
<td>The maximum allowed unaccounted consumption. Based on electrical engineering studies. If
System Load exceeds 15%, the excess is redistributed proportionally to major appliances.
</td>
</tr>
<tr>
<td>Usage Anomaly</td>
<td>First type of anomaly — triggered when usage hours exceed realistic limits (e.g., geyser >
3h/day, AC > 16h/day). Indicates unusual behaviour that the user should verify.</td>
</tr>
<tr>
<td>Efficiency Anomaly</td>
<td>Second type — triggered when efficiency factor > 1.15 (Warning) or > 1.25 (Critical).
Indicates the appliance is consuming significantly more than rated → may need servicing or
replacement.</td>
</tr>
<tr>
<td>Hybrid Prediction</td>
<td>SmartWatt's core approach — AI predicts the efficiency factor and hours, while Physics
provides the base wattage. The final kWh is computed from both together.</td>
</tr>
<tr>
<td>Physics-Only Fallback</td>
<td>If AI model fails to load or transform fails, SmartWatt falls back to pure physics
calculation using rated specs. Confidence score is reduced when this happens.</td>
</tr>
<tr>
<td>Smart Feature Inference</td>
<td>When a required input feature is missing, SmartWatt's predictor estimates it from other
available data (e.g., estimates <code>n_occupants</code> from number of fans or AC units the
user listed).</td>
</tr>
<tr>
<td>BiasAdjuster</td>
<td>A service that applies a learned per-user correction multiplier to predictions. If a user's
past predictions were consistently 10% too high, it applies a 0.9× factor next time.</td>
</tr>
<tr>
<td>What-If Simulation</td>
<td>A feature that shows predicted kWh savings for 8 upgrade scenarios — upgrade AC star rating,
switch to BLDC fans, replace old fridge, reduce geyser time, switch to LED lights, etc.</td>
</tr>
<tr>
<td>Appliance Preloading</td>
<td>On server startup, all 22 models and 22 preprocessors are loaded into RAM so prediction
requests are answered instantly without file loading delay.</td>
</tr>
<tr>
<td>distributeEnergyGap()</td>
<td>Frontend function in <code>energyUtils.ts</code>. Intelligently distributes the difference
between physics-calculated total and the user's actual bill kWh — scales appliances up or
down to match the real bill.</td>
</tr>
</table>
</div>
</section>
<!-- ══════════════════════════════════════════════════ -->
<section id="backend">
<div class="card">
<h2>🐍 Python & Backend Terms</h2>
<table>
<tr>
<th>Term</th>
<th>What It Is — What It Does in SmartWatt</th>
</tr>
<tr>
<td>Python</td>
<td>Primary programming language for SmartWatt's backend — chosen for its rich AI/ML library
ecosystem (TensorFlow, scikit-learn, Pandas, NumPy).</td>
</tr>
<tr>
<td>TensorFlow</td>
<td>Google's open-source ML framework for building and running neural networks. SmartWatt uses
it to define model architecture, train models, save them, and run inference.</td>
</tr>
<tr>
<td>Keras</td>
<td>High-level API built on top of TensorFlow that makes building neural networks simpler.
SmartWatt uses <code>keras.Model</code>, <code>keras.layers.Dense</code>, and
<code>keras.layers.Dropout</code>.
</td>
</tr>
<tr>
<td>scikit-learn</td>
<td>Python ML library for data preprocessing and evaluation. SmartWatt uses it for
<code>StandardScaler</code>, <code>OneHotEncoder</code>, and <code>ColumnTransformer</code>.
</td>
</tr>
<tr>
<td>Pandas (pd)</td>
<td>Python library for data manipulation using DataFrames (tables). SmartWatt uses it to load
and process the training CSV dataset and prepare input data for AI models.</td>
</tr>
<tr>
<td>NumPy (np)</td>
<td>Python library for fast numerical computation using arrays. SmartWatt uses it for matrix
operations, clipping values (e.g., capping efficiency between 0.5–1.5), and averaging
training curves.</td>
</tr>
<tr>
<td>Pydantic</td>
<td>Python library for data validation using type annotations. SmartWatt uses Pydantic models in
<code>schemas.py</code> to validate all API inputs — invalid data is rejected before AI
runs.
</td>
</tr>
<tr>
<td>@validator</td>
<td>Pydantic decorator for custom validation logic. SmartWatt uses it to enforce
appliance-specific rules like "AC tonnage must be between 0.5 and 5.0 tons".</td>
</tr>
<tr>
<td>uvicorn</td>
<td>A fast Python ASGI web server. SmartWatt runs <code>uvicorn main:app --reload</code> to
start the backend — it handles incoming HTTP requests and routes them to FastAPI.</td>
</tr>
<tr>
<td>@app.on_event("startup")</td>
<td>FastAPI decorator that runs a function when the server starts. SmartWatt uses it to call
<code>get_predictor().preload_all_models()</code> — loads all 22 models into memory before
any request arrives.
</td>
</tr>
<tr>
<td>Singleton Pattern</td>
<td>A design pattern ensuring only one instance of a class exists. SmartWatt's predictor uses
<code>get_predictor()</code> which returns the same <code>AppliancePredictor</code> instance
across all requests.
</td>
</tr>
<tr>
<td>CORS Middleware</td>
<td>Cross-Origin Resource Sharing — allows the frontend (on a different domain/port) to make API
calls to the backend. SmartWatt configures CORS with <code>allow_origins=["*"]</code> for
open access.</td>
</tr>
<tr>
<td>Joblib</td>
<td>Python library for saving/loading Python objects efficiently. SmartWatt uses
<code>joblib.dump()</code> to save preprocessors as <code>.pkl</code> files and
<code>joblib.load()</code> to restore them.
</td>
</tr>
<tr>
<td>python-dotenv</td>
<td>Library that loads environment variables from a <code>.env</code> file into Python's
environment. SmartWatt uses it to load Supabase URL and API key without hardcoding secrets.
</td>
</tr>
<tr>
<td>EarlyStopping callback</td>
<td>A Keras callback that monitors validation loss during training and stops when no improvement
is seen for <code>patience</code> epochs. SmartWatt uses
<code>patience=10, restore_best_weights=True</code>.
</td>
</tr>
</table>
</div>
</section>
<!-- ══════════════════════════════════════════════════ -->
<section id="api">
<div class="card">
<h2>🌐 FastAPI & API Terms</h2>
<table>
<tr>
<th>Term</th>
<th>What It Is — What It Does in SmartWatt</th>
</tr>
<tr>
<td>FastAPI</td>
<td>Modern Python web framework for building REST APIs — fast, automatic documentation, built-in
validation. SmartWatt's entire backend is built on FastAPI.</td>
</tr>
<tr>
<td>REST API</td>
<td>Representational State Transfer — a standard for web APIs using HTTP methods (GET, POST).
SmartWatt's backend exposes REST endpoints that the Next.js frontend calls.</td>
</tr>
<tr>
<td>Endpoint</td>
<td>A specific URL in the API that performs an action. SmartWatt endpoints:
<code>/predict-appliance</code>, <code>/predict-all</code>, <code>/calculate-bill</code>,
<code>/simulate-savings</code>, <code>/health</code>.
</td>
</tr>
<tr>
<td>HTTP POST</td>
<td>An HTTP method that sends data to the server in the request body. SmartWatt's prediction and
bill calculation endpoints all use POST requests with JSON body.</td>
</tr>
<tr>
<td>HTTP GET</td>
<td>An HTTP method that retrieves data from the server. SmartWatt's <code>/health</code> and
<code>/</code> (root) endpoints use GET.
</td>
</tr>
<tr>
<td>JSON (JavaScript Object Notation)</td>
<td>Lightweight data format used for sending data between frontend and backend. All SmartWatt
API requests and responses use JSON format.</td>
</tr>
<tr>
<td>Request Body</td>
<td>Data sent along with a POST request. SmartWatt sends appliance details, household info, and
usage data as JSON in the request body to <code>/predict-all</code>.</td>
</tr>
<tr>
<td>Response</td>
<td>What the server sends back after processing a request. SmartWatt responses include:
<code>prediction</code> (kWh), <code>insights</code> (efficiency, hours),
<code>confidence</code>, and <code>anomalies</code>.
</td>
</tr>
<tr>
<td>Router</td>
<td>A FastAPI component that groups related endpoints together. SmartWatt has a
<code>routers/appliances.py</code> router that handles all prediction and simulation
endpoints.
</td>
</tr>
<tr>
<td>Axios</td>
<td>A JavaScript HTTP client library used in the frontend to make API calls. SmartWatt's
<code>api/client.ts</code> configures Axios with the backend URL and timeout.
</td>
</tr>
<tr>
<td>/health endpoint</td>
<td>An API endpoint that confirms the server is running and models are loaded. SmartWatt returns
<code>{"status":"healthy", "models_loaded":22}</code> — useful for deployment monitoring.
</td>
</tr>
<tr>
<td>Status Code 200</td>
<td>HTTP success code — means the request was processed correctly. SmartWatt returns 200 for
successful predictions.</td>
</tr>
<tr>
<td>Status Code 422</td>
<td>HTTP Unprocessable Entity — returned by FastAPI/Pydantic when input validation fails.
SmartWatt returns 422 with error details if AC tonnage is out of range, for example.</td>
</tr>
</table>
</div>
</section>
<!-- ══════════════════════════════════════════════════ -->
<section id="electrical">
<div class="card">
<h2>⚡ Electrical & Physics Terms</h2>
<table>
<tr>
<th>Term</th>
<th>What It Is — What It Does in SmartWatt</th>
</tr>
<tr>
<td>Watt (W)</td>
<td>The unit of electrical power — how fast energy is consumed. SmartWatt's Physics Engine
converts appliance specs into watts (e.g., 1.5T AC = 2160W).</td>
</tr>
<tr>
<td>Kilowatt (kW)</td>
<td>1 kilowatt = 1000 watts. Used to express larger power values. A 2kW geyser = 2000W.</td>
</tr>
<tr>
<td>kWh (Kilowatt-hour)</td>
<td>The unit of energy on your KSEB electricity bill — 1 kWh = using 1000W for 1 hour. SmartWatt
predicts monthly kWh consumption for each appliance individually.</td>
</tr>
<tr>
<td>Power Rating</td>
<td>The maximum electrical power an appliance is designed to consume, printed on the label
(e.g., "750W"). SmartWatt's Physics Engine uses power ratings as the baseline for
calculations.</td>
</tr>
<tr>
<td>Star Rating</td>
<td>Energy efficiency rating given by BEE (Bureau of Energy Efficiency) — 1 star (least
efficient) to 5 stars (most efficient). Higher star = lower electricity consumption.
SmartWatt uses star rating to adjust base watts.</td>
</tr>
<tr>
<td>BEE (Bureau of Energy Efficiency)</td>
<td>Government body that assigns star ratings to appliances in India. SmartWatt's physics
formulas are based on BEE efficiency standards.</td>
</tr>
<tr>
<td>Tonnage (AC)</td>
<td>Measure of an AC's cooling capacity — 1 ton cools approximately 100 sq ft. SmartWatt
supports 1.0T, 1.5T, and 2.0T ACs — higher tonnage = higher watts.</td>
</tr>
<tr>
<td>HP (Horsepower)</td>
<td>Unit of power for motors like water pumps — 1 HP = 746 Watts. SmartWatt uses
<code>HP × 746</code> to calculate water pump wattage.</td>
</tr>
<tr>
<td>BLDC (Brushless DC) Fan</td>
<td>An energy-efficient fan type using brushless DC motor — consumes only 30W vs 75W for
standard fans. SmartWatt's simulation shows users the savings of switching to BLDC.</td>
</tr>
<tr>
<td>Voltage Fluctuation</td>
<td>Variation in electrical supply voltage — common in rural Kerala. Causes appliances to
consume more power or degrade faster. SmartWatt's synthetic dataset includes rural voltage
fluctuation as a factor.</td>
</tr>
<tr>
<td>Standby Power</td>
<td>Electricity consumed by devices when switched off but still plugged in (e.g., TV on
standby). Part of SmartWatt's System Load which is capped at 15%.</td>
</tr>
<tr>
<td>Efficiency Degradation</td>
<td>Over time, appliances become less efficient and consume more electricity than their rated
value. SmartWatt models this via the efficiency factor — older appliances get higher
factors.</td>
</tr>
<tr>
<td>Inverter AC</td>
<td>An AC with variable-speed compressor — more efficient at partial loads. In SmartWatt, 5-star
ACs are treated as inverter-type with lower effective wattage.</td>
</tr>
<tr>
<td>Wiring Loss / Transmission Loss</td>
<td>Electricity lost as heat in the home's wiring — typically 2–5% of total consumption. Part of
SmartWatt's system load accounting.</td>
</tr>
<tr>
<td>FSM (Fuel Surcharge Mechanism)</td>
<td>An additional charge on every unit of electricity to cover fuel cost variations. KSEB
charges ₹0.13 per unit as FSM — included in SmartWatt's bill calculation.</td>
</tr>
</table>
</div>
</section>
<!-- ══════════════════════════════════════════════════ -->
<section id="kseb">
<div class="card">
<h2>🏛️ KSEB & Billing Terms</h2>
<table>
<tr>
<th>Term</th>
<th>What It Is — What It Does in SmartWatt</th>
</tr>
<tr>
<td>KSEB</td>
<td>Kerala State Electricity Board — the organisation that generates, distributes, and bills
electricity in Kerala. SmartWatt is specifically designed around KSEB's tariff structure.
</td>
</tr>
<tr>
<td>Tariff</td>
<td>The pricing structure for electricity — how much each unit costs. KSEB uses different
tariffs for domestic, commercial, and industrial consumers. SmartWatt uses the Domestic
LT-1A tariff.</td>
</tr>
<tr>
<td>Telescopic Tariff</td>
<td>A slab-based pricing where different units are charged at different rates that increase with
consumption. SmartWatt implements all 5 slabs for ≤250 units: ₹3.25, ₹4.05, ₹5.10, ₹6.95,
₹8.20 per unit.</td>
</tr>
<tr>
<td>Slab (Tariff Slab)</td>
<td>A range of units charged at the same rate. KSEB slabs are each 50 units wide (0–50, 51–100,
etc.). In SmartWatt for ≤250 units: first 50 units @ ₹3.25, next 50 @ ₹4.05, and so on.</td>
</tr>
<tr>
<td>Flat Rate Tariff</td>
<td>When consumption exceeds 250 units/month, KSEB charges a single flat rate on the entire
consumption. SmartWatt's <code>tariff_config.py</code> stores these flat rates (₹6.40 for
≤300 units, higher above that).</td>
</tr>
<tr>
<td>Bi-Monthly Billing</td>