Element 1: AI Fundamentals

PC 1.1 - 1.4: History & Foundations

Core Theory
Smart Guide: The Evolution of Logic
  • 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.
Assignment: Local Impact Mapping

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.
Hot Quiz: Which 1950 conference is considered the official birth of Artificial Intelligence?

PC 1.5 - 1.6: Intelligent Agents

Logic Ops
Smart Guide: The PEAS Framework

To design an agent, you must define its environment using PEAS:

PerformanceWhat is the success metric? (e.g., Safety, Speed)
EnvironmentWhere does it act? (e.g., Kenyan roads, a server)
ActuatorsHow does it move? (e.g., Wheels, Screen display)
SensorsHow does it see? (e.g., Cameras, Keyboard input)
Assignment: Agent Architect

Design the PEAS for an Automated TTTI Security Drone. What are its sensors and performance metrics? Write this in your lab notebook.

Agent Interaction Tip: Open your **Gemini AI Study Agent** and type: "Analyze a self-driving taxi using the PEAS framework. Explain each part simply."
Hot Quiz: A "Model-Based" agent keeps track of the "World State." Why is this better than a "Simple Reflex" agent in a changing environment?

Element 2: Problem Solving Techniques

PC 2.1 - 2.3: Logic & Inferencing

Inference Engine
Smart Guide: The Logic Stack
  • 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).
Assignment: The TTTI Diagnostic Tree

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
Hot Quiz: In an Expert System, which part is responsible for "reasoning" based on the known facts? (Hint: The _________ Engine).

PC 2.4 - 2.6: Machine Learning Taxonomy

ML Deployment
Smart Guide: Choosing the Right Model
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.
Assignment: Case Study Selection

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.

Agent Interaction Tip: Prompt your study agent: "Contrast Forward Chaining and Backward Chaining using an example of a doctor diagnosing malaria."
Hot Quiz: What do we call the process of "Clustering" data points that have no pre-defined labels?

Element 3: Python Programming Environment

PC 3.1 - 3.5: Setup & Flow Control

Dev Ops
Smart Guide: Professional Environment Setup
  • Installation: Ensure pip is 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: while loops handle continuous data streams; for loops handle fixed datasets (like a list of 58k records).
Assignment: The TTTI Automated Grader

Write a script in VS Code that:

  1. Accepts a list of marks: [45, 78, 32, 90, 65].
  2. Uses a for loop to iterate.
  3. Applies TVETA logic: 80+ (Distinction), 60+ (Credit), 40+ (Pass), Below 40 (Referral).
  4. Prints the result for each student.
Hot Quiz: Which keyword is used to exit a loop prematurely when a certain condition is met?

PC 3.6 - 3.8: OOP & Data Science Stack

Data Engineering
Smart Guide: The Scientific Trinity
  • 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 DataFrames to clean and analyze CSV/JSON data.
Assignment: Rugedo Inventory Analysis

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())
Agent Interaction Tip: Challenge your AI Agent: "Explain Object-Oriented Programming (OOP) using the analogy of a mobile phone's hardware and software."
Hot Quiz: In Pandas, what do we call a single column of data? (Hint: A ________).

Element 4: AI Program Development

PC 4.1 - 4.3: The ML Pipeline (Scikit-Learn)

Production Ready
Smart Guide: The 5-Step Model Blueprint

To 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.
Assignment: The Iris Classification Project

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}%")
Hot Quiz: Why do we split data into "Train" and "Test" instead of using all of it to train the model? (Hint: To avoid __________).

Advanced Algorithms: KNN vs. Naive Bayes

The KNN Logic (Lazy Learning):

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.

The Naive Bayes Logic (Probability):

Uses the Bayes Theorem. It calculates the probability of an event based on prior knowledge. Perfect for text classification (Spam vs. Not Spam).

Assignment: Real-World Solution Draft

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.

Agent Interaction Tip: Command your Gemini Gem: "Show me a Python code snippet to implement a Naive Bayes classifier using Scikit-Learn for a text dataset."
Hot Quiz: What is the 'K' in K-Nearest Neighbors?

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
  • • Able to define PEAS for a given agent.
  • • Can differentiate Forward vs. Backward chaining.
1.4-1.5 Machine Learning Types & Python Setup
  • • Correct installation of Python/VS Code.
  • • Can explain Supervised vs. Unsupervised logic.
1.6-1.10 Core & Object Oriented Python
  • • Use of for/while loops and if logic.
  • • Creation of a class with methods.
1.11 Scientific Modules Data Handling
  • • Use of NumPy for array manipulation.
  • Pandas: Load CSV, clean data, and filter rows.
1.12 Full ML Program Implementation
  • • Implementation of KNN or Naive Bayes.
  • • Demonstrated Model Evaluation (Accuracy Score).

Submission Checklist (Portfolio of Evidence)

1. Terminal Proficiency

Screenshot of Python running in VS Code terminal with zero errors.

2. Data Analysis Lab

Colab link showing Pandas cleaning a local Kenyan dataset.

3. Logical Inference

A Python script or diagram illustrating a medical/technical diagnostic tree.

4. Predictive Model

Final .ipynb file with a trained Scikit-Learn classifier.

Final Requirement: Trainees must successfully present their "Sentinels"—a Python program that solves a real-world problem using at least one Machine Learning algorithm.

End of Unit Guide | TVETA Level 6 Artificial Intelligence | Curated for TTTI