Introduction to Artificial Intelligence Flashcards
(50 cards)
What is Artificial Intelligence?
Artificial Intelligence (AI) is a branch of computer science focused on creating systems that can perform tasks requiring human-like intelligence, such as learning, reasoning, and perception. AI can be narrow, excelling at specific tasks like playing chess, or general, aiming for human-level versatility across many tasks. Modern AI often relies on machine learning, where systems improve from data without explicit programming.
What was the Dartmouth Conference?
The Dartmouth Conference, held in 1956, is considered the birthplace of AI as a formal field. Organized by John McCarthy, Marvin Minsky, Nathaniel Rochester, and Claude Shannon, it brought together researchers to explore the potential of machines to simulate human intelligence. The event marked the beginning of AI research and coined the term “artificial intelligence.”
What are AI Winters?
AI Winters were periods of reduced funding and interest in AI research, primarily in the 1970s and late 1980s, due to unmet expectations and technical limitations. These downturns followed overhyped promises, leading to skepticism. However, each winter was followed by renewed interest as breakthroughs, like deep learning, revitalized the field.
What is the Turing Test?
The Turing Test, proposed by Alan Turing in 1950, evaluates a machine’s ability to exhibit human-like intelligence. In the test, a human judge interacts with both a machine and a human via text. If the judge cannot reliably distinguish the machine from the human, the machine passes the test, demonstrating intelligent behavior.
What is the difference between Strong AI and Weak AI?
Weak AI, or narrow AI, is designed for specific tasks, like voice assistants or recommendation systems, without true understanding. Strong AI, or artificial general intelligence (AGI), aims to replicate human cognitive abilities, enabling machines to perform any intellectual task a human can. While weak AI is prevalent today, strong AI remains theoretical.
What is Machine Learning?
Machine Learning (ML) is a subset of AI that enables systems to learn from data and improve over time without being explicitly programmed. It involves algorithms that identify patterns in data to make predictions or decisions. ML is widely used in applications like spam detection, image recognition, and recommendation systems.
What is Supervised Learning?
Supervised Learning is a type of machine learning where the model is trained on labeled data, meaning each input has a corresponding output. The goal is to learn a mapping from inputs to outputs, enabling the model to make predictions on new, unseen data. Common algorithms include linear regression and decision trees.
What is Unsupervised Learning?
Unsupervised Learning involves training models on data without labeled outputs. The goal is to find hidden patterns or structures in the data, such as clustering similar items or reducing dimensionality. Common algorithms include k-means clustering and principal component analysis (PCA).
from sklearn.cluster import KMeans
kmeans = KMeans(n_clusters=3)
kmeans.fit(X)
labels = kmeans.labels_
What is Reinforcement Learning?
Reinforcement Learning (RL) is a type of machine learning where an agent learns by interacting with an environment, receiving rewards or penalties for its actions. The agent aims to maximize cumulative rewards over time. RL is used in applications like game playing and robotics.
action = agent.select_action(state)
reward = environment.step(action)
agent.update_policy(reward)
What is Linear Regression?
Linear Regression is a supervised learning algorithm used to predict a continuous target variable based on one or more input features. It assumes a linear relationship between inputs and the target, finding the best-fit line that minimizes the sum of squared errors.
from sklearn.linear_model import LinearRegression
model = LinearRegression()
model.fit(X_train, y_train)
predictions = model.predict(X_test)
What is Logistic Regression?
Logistic Regression is a supervised learning algorithm used for binary classification tasks. It models the probability that an input belongs to a particular class using the logistic function, which outputs values between 0 and 1.
from sklearn.linear_model import LogisticRegression
model = LogisticRegression()
model.fit(X_train, y_train)
predictions = model.predict(X_test)
What are Decision Trees?
Decision Trees are supervised learning models that split data into branches based on feature values, creating a tree-like structure. Each leaf node represents a class label or regression value. They are interpretable but can overfit if not pruned.
from sklearn.tree import DecisionTreeClassifier
model = DecisionTreeClassifier()
model.fit(X_train, y_train)
predictions = model.predict(X_test)
What are Random Forests?
Random Forests are an ensemble learning method that combines multiple decision trees to improve accuracy and reduce overfitting. Each tree is trained on a random subset of the data and features, and the final prediction is based on majority voting or averaging.
from sklearn.ensemble import RandomForestClassifier
model = RandomForestClassifier(n_estimators=100)
model.fit(X_train, y_train)
predictions = model.predict(X_test)
What are Support Vector Machines (SVMs)?
Support Vector Machines (SVMs) are supervised learning models used for classification and regression. They find the hyperplane that best separates data into classes, maximizing the margin between support vectors. SVMs can handle non-linear data using kernel functions.
from sklearn.svm import SVC
model = SVC(kernel=’linear’)
model.fit(X_train, y_train)
predictions = model.predict(X_test)
What is K-Means Clustering?
K-Means Clustering is an unsupervised learning algorithm that partitions data into k clusters based on similarity. It iteratively assigns data points to the nearest cluster centroid and updates centroids until convergence.
from sklearn.cluster import KMeans
kmeans = KMeans(n_clusters=3)
kmeans.fit(X)
labels = kmeans.labels_
What is Hierarchical Clustering?
Hierarchical Clustering is an unsupervised learning method that builds a hierarchy of clusters either by merging smaller clusters (agglomerative) or splitting larger ones (divisive). It results in a dendrogram showing the relationships between clusters.
from scipy.cluster.hierarchy import dendrogram, linkage
Z = linkage(X, method=’ward’)
dendrogram(Z)
What is Principal Component Analysis (PCA)?
Principal Component Analysis (PCA) is a dimensionality reduction technique used in unsupervised learning. It transforms data into a lower-dimensional space by identifying the directions (principal components) that capture the most variance in the data.
from sklearn.decomposition import PCA
pca = PCA(n_components=2)
X_reduced = pca.fit_transform(X)
What is a Perceptron?
A Perceptron is the simplest type of neural network, consisting of a single layer that can learn linear decision boundaries. It takes weighted inputs, applies an activation function, and outputs a binary classification. Perceptrons are the building blocks of more complex neural networks.
from sklearn.linear_model import Perceptron
model = Perceptron()
model.fit(X_train, y_train)
predictions = model.predict(X_test)
What is a Multilayer Perceptron (MLP)?
A Multilayer Perceptron (MLP) is a type of neural network with multiple layers, including input, hidden, and output layers. It can learn non-linear relationships by using activation functions like sigmoid or ReLU in the hidden layers. MLPs are trained using backpropagation.
from sklearn.neural_network import MLPClassifier
model = MLPClassifier(hidden_layer_sizes=(10, 10))
model.fit(X_train, y_train)
predictions = model.predict(X_test)
What are Activation Functions?
Activation functions introduce non-linearity into neural networks, allowing them to learn complex patterns. Common functions include Sigmoid (for binary classification), ReLU (for hidden layers), and Tanh (for centered outputs). They determine whether a neuron should be activated based on its input.
import numpy as np
def relu(x):
return np.maximum(0, x)
print(relu(-1), relu(2)) # Outputs: 0 2
What is Backpropagation?
Backpropagation is the algorithm used to train neural networks by minimizing the error between predicted and actual outputs. It calculates the gradient of the loss function with respect to each weight by propagating the error backward through the network, updating weights via gradient descent.
for layer in reversed(network):
error = compute_error(layer)
gradients = compute_gradients(error)
update_weights(gradients)
What are Convolutional Neural Networks (CNNs)?
Convolutional Neural Networks (CNNs) are specialized neural networks for processing grid-like data, such as images. They use convolutional layers to detect local patterns (e.g., edges), pooling layers to reduce dimensionality, and fully connected layers for classification. CNNs are widely used in computer vision.
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Conv2D, MaxPooling2D, Flatten, Dense
model = Sequential([
Conv2D(32, (3,3), activation=’relu’, input_shape=(28,28,1)),
MaxPooling2D((2,2)),
Flatten(),
Dense(10, activation=’softmax’)
])
What are Recurrent Neural Networks (RNNs)?
Recurrent Neural Networks (RNNs) are designed for sequential data, such as time series or text. They have loops that allow information to persist, enabling them to maintain a “memory” of previous inputs. RNNs are used in applications like language modeling and speech recognition.
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import SimpleRNN, Dense
model = Sequential([
SimpleRNN(50, input_shape=(10,1)),
Dense(1)
])
What is Long Short-Term Memory (LSTM)?
Long Short-Term Memory (LSTM) is a type of RNN designed to capture long-term dependencies in sequential data. It uses gates to control the flow of information, preventing the vanishing gradient problem. LSTMs are effective in tasks like machine translation and text generation.
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import LSTM, Dense
model = Sequential([
LSTM(50, input_shape=(10,1)),
Dense(1)
])