Element 1: AI Fundamentals
PC 1.1 - 1.4: History & Foundations
Core Theory- • The Turing Era (1950s): Can machines think? The birth of the "Imitation Game."
- • The AI Winters: Periods where progress stalled because compute power couldn't match the math.
- • Connectionism (Now): Shifting from "If-Then" rules to Neural Networks that learn from raw data.
Research 3 Kenyan AI case studies. Present how they use AI to solve local problems:
- Finance: M-Pesa's overdraft (Fuliza) limit algorithms.
- Agri-Tech: AI-driven soil analysis for maize farmers in Rift Valley.
- Health: Chatbots for mental health support in Nairobi clinics.
PC 1.5 - 1.6: Intelligent Agents
Logic OpsTo design an agent, you must define its environment using PEAS:
| Performance | What is the success metric? (e.g., Safety, Speed) |
| Environment | Where does it act? (e.g., Kenyan roads, a server) |
| Actuators | How does it move? (e.g., Wheels, Screen display) |
| Sensors | How does it see? (e.g., Cameras, Keyboard input) |
Design the PEAS for an Automated TTTI Security Drone. What are its sensors and performance metrics? Write this in your lab notebook.
"Analyze a self-driving taxi using the PEAS framework. Explain each part simply."
Element 2: Problem Solving Techniques
PC 2.1 - 2.3: Logic & Inferencing
Inference Engine- • Propositional Logic: Simple True/False statements (e.g., "The Power is On").
- • Predicate Logic: Logic with objects and relations (e.g., "HasPower(Laptop)").
- • Forward Chaining: Starting with facts to reach a conclusion (Data-driven).
- • Backward Chaining: Starting with a goal and working back to find supporting facts (Goal-driven).
Sketch a logic flowchart for an AI that decides if a student is eligible for an exam. Criteria:
- 1. Has paid 75% fees? (P)
- 2. Has 80% attendance? (Q)
- 3. Conclusion: Issue Exam Card (R). Represent this as
(P ∧ Q) → R
PC 2.4 - 2.6: Machine Learning Taxonomy
ML Deployment| Type | Input | Local Example |
|---|---|---|
| Supervised | Labeled Data | Predicting rent prices in Thika based on square footage. |
| Unsupervised | Unlabeled Data | Grouping M-Pesa users by spending habits (Clustering). |
| Reinforcement | Rewards/Penalty | Training a drone to fly through a TTTI corridor without hitting walls. |
If you wanted to build an AI that detects "Spam" SMS messages based on past examples you flagged, which Machine Learning type would you use? Explain why to your seatmate.
"Contrast Forward Chaining and Backward Chaining using an example of a doctor diagnosing malaria."
Element 3: Python Programming Environment
PC 3.1 - 3.5: Setup & Flow Control
Dev Ops- • Installation: Ensure
pipis updated:python -m pip install --upgrade pip. - • Virtual Envs: Create a sandbox:
python -m venv ai_env. Activate it to keep your OS clean. - • Logic Control:
whileloops handle continuous data streams;forloops handle fixed datasets (like a list of 58k records).
Write a script in VS Code that:
- Accepts a list of marks:
[45, 78, 32, 90, 65]. - Uses a
forloop to iterate. - Applies TVETA logic: 80+ (Distinction), 60+ (Credit), 40+ (Pass), Below 40 (Referral).
- Prints the result for each student.
PC 3.6 - 3.8: OOP & Data Science Stack
Data Engineering- • OOP: Use Classes to build "blueprints" for AI models. (e.g.,
class HerbShopAgent:). - • NumPy: The math engine. Handles multi-dimensional arrays (tensors) 100x faster than standard lists.
- • Pandas: The "Excel of Python." Uses
DataFramesto clean and analyze CSV/JSON data.
Launch Google Colab and perform the following:
import pandas as pd
# 1. Load a CSV of local market prices
df = pd.read_csv('market_data.csv')
# 2. Filter products where price > 500 KES
expensive_items = df[df['price'] > 500]
# 3. Print the average price per category
print(df.groupby('category')['price'].mean())
"Explain Object-Oriented Programming (OOP) using the analogy of a mobile phone's hardware and software."
Element 4: AI Program Development
PC 4.1 - 4.3: The ML Pipeline (Scikit-Learn)
Production ReadyTo build any AI program in Python, follow this immutable sequence:
- • 1. Preprocessing: Clean data and handle missing values (Pandas).
- • 2. Splitting: Separate data into Train (to learn) and Test (to verify).
- • 3. Selection: Choose an algorithm (e.g.,
KNeighborsClassifier). - • 4. Fitting: Feed the training data to the model:
model.fit(X_train, y_train). - • 5. Evaluation: Check the accuracy score on the test data.
Deploy this exact code in Google Colab. This is a foundational project for your portfolio:
from sklearn.datasets import load_iris
from sklearn.model_selection import train_test_split
from sklearn.neighbors import KNeighborsClassifier
from sklearn.metrics import accuracy_score
# 1. Load Data
data = load_iris()
X_train, X_test, y_train, y_test = train_test_split(data.data, data.target, test_size=0.2)
# 2. Initialize and Train
knn = KNeighborsClassifier(n_neighbors=3)
knn.fit(X_train, y_train)
# 3. Predict & Score
predictions = knn.predict(X_test)
print(f"Model Accuracy: {accuracy_score(y_test, predictions) * 100}%")
Advanced Algorithms: KNN vs. Naive Bayes
Classifies a point based on how many of its neighbors belong to a certain group. If 3 neighbors are "Apples" and 1 is "Orange," the point is an Apple.
Uses the Bayes Theorem. It calculates the probability of an event based on prior knowledge. Perfect for text classification (Spam vs. Not Spam).
Suppose TTTI wants an AI to predict which department a support ticket should go to (IT, Accounts, or Registrar) based on the keywords in the message. Which algorithm would be better: KNN or Naive Bayes? Explain your choice.
"Show me a Python code snippet to implement a Naive Bayes classifier using Scikit-Learn for a text dataset."
Critical Skills Assessment
In accordance with CDACC Occupational Standard: ICT/OS/CS/CC/04/6/MA
Candidate Performance Log
Final Audit| ID | Critical Aspect of Competency | Required Evidence for "Pass" |
|---|---|---|
| 1.1-1.3 | Theory of AI, Agents & Inferencing |
|
| 1.4-1.5 | Machine Learning Types & Python Setup |
|
| 1.6-1.10 | Core & Object Oriented Python |
|
| 1.11 | Scientific Modules Data Handling |
|
| 1.12 | Full ML Program Implementation |
|
Submission Checklist (Portfolio of Evidence)
Screenshot of Python running in VS Code terminal with zero errors.
Colab link showing Pandas cleaning a local Kenyan dataset.
A Python script or diagram illustrating a medical/technical diagnostic tree.
Final .ipynb file with a trained Scikit-Learn classifier.
End of Unit Guide | TVETA Level 6 Artificial Intelligence | Curated for TTTI