Sonzaschool
Rudi

Sekondari ya Juu · Kidato cha Sita

Sayansi ya Kompyuta

Demonstrate practical understanding of building blocks and components of artificial intelligence: basics algorithms, machine learning, and neural networks

takriban dakika 11 kusoma

Mada za sehemu hiiDemonstrate understanding of Automated and Emerging technologies [Automated systems, Artificial Intelligence, Machine learning, 3D and holographic imaging, Virtual Reality (VR), Augmented Reality (AR), etc.]Mada 6

Building Blocks and Components of Artificial Intelligence

Artificial Intelligence (AI) enables machines to perform tasks that typically require human intelligence, such as learning, reasoning, problem-solving, and decision-making. The building blocks of AI include algorithms, machine learning models, and neural networks, which work together to process data, identify patterns, and make predictions. This study note covers the fundamental components that make AI systems work, focusing on machine learning algorithms, neural network structures, and their practical applications.

Machine Learning (ML) is a method that gives computers the ability to learn from data and improve automatically through experience, rather than following fixed instructions written by humans. In simple terms, ML allows computers to analyze large amounts of data, identify patterns, and make decisions or predictions, similar to how people learn from past experiences.

Why Machine Learning is Important

Machine Learning has become essential because:

  1. Data Generation: Every day, people create huge amounts of data through mobile phones, social media, banking, and online services. ML helps process and make sense of this growing data. For example, mobile money companies use ML to analyze transaction data and detect fraud automatically.

  2. Improved Decision-Making: ML assists humans in making faster and more accurate decisions by analyzing data patterns and providing recommendations. In healthcare, ML can help doctors predict diseases early by studying patient records and symptoms.

  3. Discovering Patterns: ML can find hidden patterns and relationships that humans might miss. Online shops like Jumia use ML to study customer behavior and suggest products customers are likely to buy next.

  4. Solving Complex Problems: Some problems such as weather prediction, image recognition, or language translation are too difficult for traditional programming. ML can learn from examples to solve such challenges effectively.

Key Terms in Machine Learning

Understanding these terms is essential for grasping how machines learn:

  • Data: Raw facts used by the computer to learn, including numbers, text, images, or any measurable value.

  • Dataset: A collection of data arranged in a structured format, often in tables or files.

  • Features (Inputs): The characteristics or variables used by a model to make decisions or predictions. For example, in predicting fruit type, features could be color, weight, and shape.

  • Label (Output or Target): The result or answer that the model tries to predict. For example, if you give the model a picture of a fruit as input, the label could be "apple," "banana," or "mango."

  • Model: A mathematical or computational representation that the machine builds after learning from data. It maps inputs to outputs.

  • Algorithm: A set of step-by-step instructions used to find patterns in data and train the model. Examples include Linear Regression, Decision Tree, or Neural Network.

  • Training: The process of feeding the machine with data so it can learn patterns or relationships.

  • Testing: Evaluating the model with new data that it has not seen before, to check accuracy and reliability.

  • Prediction: The model's output when it receives new, unseen data.

  • Accuracy: A measure of how often the model's predictions are correct, usually expressed as a percentage.

  • Bias: A tendency of the model to make unfair or one-sided predictions due to poor or unbalanced training data.

  • Overfitting: When a model learns the training data too well, including errors, and fails to perform well on new data.

  • Underfitting: When a model is too simple and fails to capture the patterns in data, resulting in poor performance.

Types of Machine Learning

There are three main types of machine learning:

1. Supervised Learning

Supervised learning uses labeled data—data with correct answers provided. The model studies example pairs of inputs and their matching outputs to learn how to connect them. The main aim is for the model to understand the relationship between the input and output so it can correctly predict results for new, unseen data.

Examples:

  • Predicting house prices based on size and location
  • Email spam detection (spam or not spam)
  • Predicting exam scores based on study hours

2. Unsupervised Learning

Unsupervised learning works with unlabeled data, allowing the computer to find patterns or groups on its own. The algorithm examines the data on its own and tries to uncover hidden patterns or structures without any direct instructions.

Examples:

  • Customer segmentation in supermarkets (grouping buying patterns)
  • Discovering news topics from social media posts
  • Clustering students by performance trends

3. Reinforcement Learning

Reinforcement learning teaches a computer through trial and error, where it learns by receiving rewards for good actions and penalties for mistakes. The agent improves through trial and error, taking actions and receiving feedback in the form of rewards or penalties.

Examples:

  • Games like chess or checkers
  • Robots learning to walk
  • Self-driving cars improving through simulation

Regression Techniques in Machine Learning

Regression helps computers learn patterns in numerical data and make predictions, such as forecasting salary, house prices, or student scores.

Simple Linear Regression involves one independent variable predicting one dependent variable. The formula is:

y=mX+cy = mX + c

Where:

  • mm = slope (how much y changes when X changes)
  • cc = intercept (value of y when X = 0)
  • XX = independent variable (input feature)
  • yy = dependent variable (predicted output)

Example: Predicting salary based on years of experience:

Years of Experience (X)Salary in TZS (y)
1500,000
2700,000
3900,000
41,100,000
51,300,000

Using linear regression, if X = 6 years, we can predict salary. The slope shows that each additional year of experience adds approximately 200,000 TZS to the salary.

Multiple Linear Regression uses two or more independent variables:

y=b0+b1X1+b2X2+...+bnXny = b_0 + b_1X_1 + b_2X_2 + ... + b_nX_n

For example, predicting salary using:

  • X1X_1 = experience
  • X2X_2 = education level
  • X3X_3 = age

Bias and Variance

Bias is the error caused by oversimplifying a model. A high-bias model assumes too much and learns too little. It cannot capture important patterns in the data. Characteristics include:

  • Model is too simple
  • Underfits the data
  • Low accuracy on training and testing data

Variance is the error caused by a model being too sensitive to training data noise. A high-variance model learns noise and unnecessary details. It performs very well on training data but poorly on new data. Characteristics include:

  • Model is too complex
  • Overfits the data
  • High accuracy on training data, low accuracy on testing data

To avoid underfitting, use more features, a more complex model, and train longer. To avoid overfitting, use more data, use regularization (Ridge, Lasso), remove noise, and use cross-validation.

Swali

Which type of machine learning is used when the computer learns from labeled data to make predictions?

Ingia ili kuwasilisha jibu lako na lihesabiwe katika umahiri wako.

Ingia ili kufanya mazoezi

Mwalimu

Umekwama? Niulize chochote kuhusu mada hii.

Ingia ili kumuuliza Mwalimu wa AI wa Sonza kuhusu swali hili.

Ingia ili kuuliza