Sign in to save

Bookmark this page so you can find it later.

Sign in to save

Bookmark this page so you can find it later.

Artificial intelligence is the field of making computers perform tasks that usually require human thinking, such as recognizing patterns, making predictions, or understanding language. Machine learning is a major part of AI where a program improves by learning from data instead of following only hand-written rules. Students need this cheat sheet to connect common AI terms with the basic math, data steps, and model ideas used in real systems.

It also helps separate useful AI tools from common misconceptions about how they work.

The core idea of machine learning is to train a model on examples, test it on new data, and measure how well it performs. Important formulas include accuracy = correct predictions / total predictions, mean squared error = sum of squared errors / n, and precision = TP / (TP + FP). Classification predicts categories, regression predicts numbers, and clustering finds groups without given labels.

Good AI work also requires clean data, fair evaluation, privacy awareness, and attention to bias.

Key Facts

  • Artificial intelligence is the broader field, and machine learning is one way to build AI systems that learn patterns from data.
  • Supervised learning uses labeled examples, where each input has a known correct output, such as image = cat or price = 250000.
  • Unsupervised learning uses unlabeled data to find patterns, such as grouping customers with similar behavior.
  • Classification predicts a category, while regression predicts a numerical value.
  • Accuracy = correct predictions / total predictions, and it is most useful when classes are balanced.
  • Mean squared error = sum of (actual value - predicted value)^2 / n, and lower values mean better regression predictions.
  • Precision = TP / (TP + FP), and recall = TP / (TP + FN), where TP is true positives, FP is false positives, and FN is false negatives.
  • A basic gradient descent update is new weight = old weight - learning rate × slope of loss, which moves the model toward lower error.

Vocabulary

Artificial Intelligence
Artificial intelligence is the field of computer science focused on systems that can perform tasks associated with human reasoning, learning, or decision-making.
Machine Learning
Machine learning is a method where a computer program learns patterns from data to make predictions or decisions.
Training Data
Training data is the set of examples used to teach a machine learning model how inputs relate to outputs.
Model
A model is the learned rule, equation, or algorithm that maps inputs to predicted outputs.
Feature
A feature is an input variable used by a model, such as age, height, color, word count, or pixel brightness.
Bias
Bias is a systematic unfairness or error in data, design, or predictions that can cause a model to treat groups differently.

Common Mistakes to Avoid

  • Confusing AI with machine learning is wrong because AI is the broad field, while machine learning is only one approach within it.
  • Testing a model on the same data used for training is wrong because it can make performance look better than it really is on new examples.
  • Using accuracy alone on an imbalanced dataset is wrong because a model can score high by mostly predicting the majority class.
  • Assuming correlation proves causation is wrong because two variables can move together without one directly causing the other.
  • Ignoring biased or incomplete data is wrong because a model can learn unfair patterns and repeat them in future predictions.

Practice Questions

  1. 1 A classifier makes 80 correct predictions out of 100 total predictions. What is its accuracy?
  2. 2 A regression model has errors of 2, -1, and 3. Compute the mean squared error using mean squared error = sum of errors^2 / n.
  3. 3 A spam filter has TP = 30, FP = 10, and FN = 5. Compute precision and recall.
  4. 4 A school wants to use an AI model to predict which students need extra support. Explain two reasons why the training data and evaluation method must be checked carefully before using the model.

Understanding AI & Machine Learning Basics

A machine learning project begins long before training. People must decide what the input data represents and what result the system should produce. Each measurable piece of information is called a feature.

For a model that estimates house prices, features might include floor area, location, age, and nearby schools. The target is the value the model should predict.

Features need careful preparation because computers do not understand context by themselves. Missing values, duplicate records, wrong labels, or measurements in inconsistent units can distort the pattern that a model learns.

Data is usually divided into training, validation, and test sets. The training set is used to adjust the model. The validation set helps people choose settings, such as model size or learning rate.

The test set is kept separate until the end to estimate performance on genuinely unseen examples. This separation matters because a model can appear excellent when it has effectively memorized familiar data. This problem is called overfitting.

A model that is too simple can miss an important pattern. This is called underfitting. Good performance comes from finding a useful middle ground, not from making a model as complicated as possible.

Loss gives the training process a direction. It measures how far predictions are from the desired answers. During gradient descent, the model changes its internal weights in the direction that reduces loss.

The learning rate controls the size of each change. If it is too large, training may jump past a good solution. If it is too small, training can take a very long time.

Classification systems often produce a confidence score before making a final category choice. A threshold turns that score into a decision.

Raising the threshold may reduce false alarms, though it can cause the system to miss real cases. This tradeoff matters in spam filters, disease screening, fraud detection, and content moderation.

Scores must be interpreted in context. Suppose only one in a hundred transactions is fraudulent. A system that predicts not fraud every time can have high accuracy while being useless.

Precision shows how often a positive prediction was right. Recall shows how many real positive cases were found. A confusion matrix lists correct and incorrect results by category, making these mistakes easier to inspect.

Students should look beyond one final score and examine which groups or cases receive errors. Biased training data can lead to unfair results, especially in hiring, lending, policing, and facial recognition. Personal data needs protection, and people should be able to question important automated decisions.

AI systems make predictions from patterns in past data. They do not automatically know what is fair, safe, or true.