top of page

Unit 2 - Deeper Understanding

Lesson 1: Basics - Machine Learning

Machine Learning is a type of artificial intelligence that enables computers to learn from data, identify patterns, and make decisions or predictions without being explicitly programmed for every scenario. At our current level of technological advancement, machine learning is essentially a combination of algorithms--a program--and typically have algorithms that account for the range of possible inputs it would have. 

In this unit, we will explore the basics of machine learning, and its applicability to student life---uses in academia and relevant implications for the immediate workforce.

The most widespread mechanics of Machine Learning foundations is through neural networks. Discussed more in depth in future lessons, these are large programs that contain the algorithms needed to process input (training data) and output the practical algorithms and knowledge base that AI applications use today. These foundations were programmed in Python, so most AI applications work in Python.

Aside from the foundational basis of machine learning in neural networks, these public-source algorithms can be modified and tweaked for anyone's usages. Python libraries such as tensorflow and scikit-learn supply the methods and tools for everyday programmers to use and learn about machine learning models.

So how can you get started with learning how to program with machine-learning libraries? Below is a notebook that goes through a hands-on guide on the fundamentals of using the sci-kit library to program machine-learning. Make a copy! (Students will need to first download anaconda and are expected to be familiar with matplotlib libraries)

Lesson 2: Representation, Inference, and Reasoning in AI

Machine learning is rather complex and possesses many facets of consideration, but we can simplify its features down to three primary concepts: representation(encoding and structuring of logic within an AI system), inference(determining new information using derived logic/rules), and reasoning(forming a judgment on provided information to make decisions). This lesson will cover the concepts and how they are applied in various machine learning circumstances.

We will begin by covering the ways AI can be classified. This is rather important, as all machine learning algorithms can be categorized in certain ways, starting with their method of learning. Learning can be categorized into supervised, unsupervised, and reinforcement. Supervised learning occurs when an algorithm learns from a labeled dataset, and the bulk of the learning model's training consists of teaching it to infer the mapping of corresponding input features with their output labels. For example, a computer vision model capable of distinguishing single-digit numbers would likely be trained on a dataset(such as the MNIST dataset) with images of digits possessing corresponding labels. Throughout training, the machine learning model will predict what the number should be labelled as before being provided the correct label and learning from it.

image.png

Sample images from the MNIST dataset, https://en.wikipedia.org/wiki/MNIST_database

Unsupervised learning is similar, except that no output labels are provided. Instead of being used for allocating a certain label to a certain input, unsupervised learning aims to find semantic patterns and relationships within data. The learning model will utilize unlabeled data to visualize relationships and anomalies within the data. The goal is still to find patterns, but in this scenario, the focus is to learn from the data's inherent structure instead of being instructed on what exactly to learn and predict. For example, semantic clustering models will take the unlabelled dataset and organize(or "cluster") it based on features(individual and measurable properties/characteristics) of the data. This can be seen very commonly in more convoluted computer vision models requiring recognition of more complex objects. Semantically similar objects (for example, a train and a car versus a dog and a cat) tend to be clustered together more often, as their similarity metric based on their features is quite high. One thing to note is that semisupervised learning is a combination of both supervised and unsupervised learning, where a small amount of labelled data is used in conjunction with a large amount of unlabelled data to train the model. The model then generates its own "pseudo-labels" for the unlabelled data, removing the need to spend the resources and time required to label all the data. One example of this is the spam filter in email applications.

image.png

Lastly, we will cover reinforcement learning, which takes an entirely different approach to machine learning. Instead of being a model that is provided with a dataset, reinforcement learning makes use of an agent that is placed in a software environment, where its paramount goal is to optimize an action-taking policy as best as possible to maximize rewards and minimize penalties. As an example for explanation, let's say that one is attempting to train a race car in a virtual game environment to finish a track as fast as possible. We will begin by covering software environments: a software environment is a virtual, simulated environment that provides many facets of input to the learning model. In this case, the virtual race track and its inputs(local wind speed, current wheel positions of the car, current velocity of the car, etc.) are all fed into an agent, which is a word to refer to the learning model. A policy is the quantifiable strategy(although, to a human, it appears to be nothing more than arbitrary numbers) used by the agent. The agent will receive rewards(positive feedback) when something positive occurs in the environment, such as a quick track completion or a high velocity maintained for a long period of time. Conversely, a penalty(negative feedback) will be given when something negative happens, such as if the car veers off the track or the speed is consistently too low. Multiple simultaneous iterations will typically be executed repeatedly to maximize the learning rate, but in the end, the agent will eventually create a policy optimized to complete tracks as fast as possible. The agent's goal is not to get the largest immediate reward, but rather, to optimize the cumulative reward over time through trial and error.

image.png

Recurrent neural network(a type of reinforcement learning algorithm) racing cars around a track, https://www.youtube.com/watch?v=wL7tSgUpy8w

With methods of learning covered, we will now very quickly deliberate on the two other metrics used for classifying machine learning algorithms, which are sampling methods and generalizations. Sampling can occur as batch learning or online learning, both of which are rather intuitive. In batch learning, the entire model is trained using all the available data(or a large portion of it) in one instance, typically offline, which is referred to as offline learning. This method can be time-consuming, thus the existence of online learning. Online learning is a process where a rudimentary model is uploaded and trained incrementally by feeding data to it, either individually or in mini-batches (small groups).

Generalizations are essential for machine learning models to apply learned patterns to unseen data, preventing memorization and enabling real-world utility. Instance-based learning achieves this by storing all training examples and generalizing at inference through similarity based on the features of the data, providing flexibility for complex, nonlinear boundaries, but suffering from high memory use, slow prediction, and sensitivity to noise or high dimensions. Model-based learning, on the other hand, generalizes by fitting a model during training(that also allows parameterized customization), discarding raw data and using global inductive biases to map inputs directly to outputs, which delivers fast inference and scalability, yet risks poor performance if the assumed model form mismatches reality or data is scarce.

image.png

Visual example of instance-based versus model-based learning, https://medium.com/unlocking-ai/instance-based-vs-model-based-learning-19c5c64cf75d

Lesson 3: AI, Decision Making, and Society

AI is now part of everyday life, helping make choices that used to be made exclusively by people. It looks at huge amounts of information quickly and gives answers, whether it’s approving a loan, suggesting a medical treatment, or deciding if someone should stay in jail before trial. This can be helpful because machines do not get tired or allow personal feelings to cloud their judgment, but the question is: are these decisions fair, and who is really in charge?

For example, AI usage in the courtroom. Some places use AI to guess if a person might commit another crime, where the idea is to be more consistent than human judges, who might be stricter on a Monday morning than on a Friday afternoon. However, studies show these tools can be unfair. For example, one system was more likely to label black people as “high risk” even when they had the same background as white people labeled “low risk", where the problem was that the AI learned from old court records that already had unfair patterns, so instead of fixing bias, it repeated it.

image.png

There are two main ways AI learns to make decisions. One method is akin to remembering old examples, where, when a new case comes up, the system looks for similar past cases and copies what happened before. This can adhere more personally, but all old data must be kept, which raises privacy worries. The other method consists of a simple rule: the system studies all the examples once, makes a shortcut formula, and then uses that formula forever. This is fast and works on millions of cases, but if the rule is too simple, it can miss important differences between people.

In the end, AI doesn’t decide alone. AI works inside rules made by people, companies, and governments. Some countries are making laws to control risky AI, like banning systems that score people, similar to a video game. But laws move slowly, and consensus is difficult to achieve. Most importantly, regular people need to understand how AI affects them, so they can advocate for themselves if something is amiss. If we want AI to help society, not hurt it, we all need a say in how it’s used.

AI should be used to help everyone make better choices together. Schools could use it to spot when a student needs extra help instead of dismissing their struggles, and doctors could procure quick medical suggestions, but still talk to patients like humans. Even governments could plan cities or share resources more fairly. This isn’t just "possible"; in fact, it’s already starting in small ways. However, it only works if AI is treated as a tool, not a boss. That means teaching kids how it works(what we do!), letting communities test and fix systems before they go live, and always keeping a person in the loop for big decisions. When utilized correctly, AI doesn’t take away our voice. Instead, it gives us a louder, smarter one.

bottom of page