Artificial Intelligence Cheat Sheet

AI Problem-Solving Approaches

ApproachDescriptionBest ForCharacteristics
Uninformed SearchSearch without problem-specific knowledgeSimple problems, small state spacesBFS, DFS, uniform cost, iterative deepening
Informed SearchSearch using heuristic functionsLarge state spaces with domain knowledgeGreedy best-first, A* search
Local SearchSearch in current state space onlyOptimization problems, constraint satisfactionHill climbing, simulated annealing, genetic algorithms
Adversarial SearchMulti-agent environments with conflicting goalsGame playing, strategic decision makingMinimax, alpha-beta pruning
Constraint SatisfactionFind values that satisfy constraintsScheduling, configuration problemsBacktracking, constraint propagation

Machine Learning Types

TypeDescriptionExamplesAlgorithms
Supervised LearningLearn from labeled training dataImage classification, spam detectionLinear regression, decision trees, SVM, neural networks
Unsupervised LearningFind patterns in unlabeled dataCustomer segmentation, anomaly detectionK-means clustering, PCA, association rules
Reinforcement LearningLearn through interaction with environmentGame playing, robotics, autonomous drivingQ-learning, deep Q-networks, policy gradients
Semi-supervised LearningUse both labeled and unlabeled dataImage classification with few labelsSelf-training, co-training
Transfer LearningApply knowledge from one domain to anotherPre-trained models, domain adaptationFeature extraction, fine-tuning

Search Algorithms

AlgorithmTypeTime ComplexitySpace ComplexityOptimality
Breadth-First Search (BFS)UninformedO(b^d)O(b^d)Yes (for unweighted graphs)
Depth-First Search (DFS)UninformedO(b^m)O(bm)No
Uniform Cost SearchUninformedO(b^(C*/ε))O(b^(C*/ε))Yes
Greedy Best-FirstInformedO(b^m)O(b^m)No
A* SearchInformedO(b^d)O(b^d)Yes (if heuristic is admissible)
Iterative DeepeningUninformedO(b^d)O(bd)Yes

Knowledge Representation

MethodDescriptionAdvantagesDisadvantages
Logic-BasedUse logical statements to represent knowledgePrecise, supports inferenceComputationally expensive, handles uncertainty poorly
Rule-BasedRepresent knowledge as if-then rulesEasy to understand, maintainCan become large and inconsistent
Semantic NetworksRepresent relationships as a graphIntuitive, visual representationNot good for complex reasoning
FramesStructured representation with slots and valuesGood for representing objectsComplex to implement and maintain
OntologiesFormal specification of concepts and relationshipsStandardized, machine-readableRequires domain expertise
Probabilistic ModelsRepresent uncertainty with probabilitiesHandles uncertainty wellComplex to construct and compute

Machine Learning Algorithms

AlgorithmTypeUse CaseProsCons
Linear RegressionSupervised (Regression)Predicting continuous valuesSimple, interpretable, efficientAssumes linear relationship, sensitive to outliers
Logistic RegressionSupervised (Classification)Binary classificationSimple, fast, provides probabilitiesAssumes linear decision boundary
Decision TreesSupervised (Classification/Regression)Classification and regressionInterpretable, handles non-linear relationshipsProne to overfitting, unstable
Random ForestSupervised (Classification/Regression)Classification and regressionReduces overfitting, handles non-linear relationshipsLess interpretable, requires more computation
Support Vector Machines (SVM)Supervised (Classification/Regression)Classification with high-dimensional dataEffective in high dimensions, memory efficientDoesn't provide probability estimates, sensitive to kernel choice
K-Means ClusteringUnsupervised (Clustering)Grouping similar data pointsSimple, efficientNeed to specify number of clusters, sensitive to initialization
Neural NetworksSupervised/UnsupervisedComplex pattern recognitionUniversal approximators, handle complex relationshipsBlack box, requires large datasets, computationally expensive

Neural Networks

TypeArchitectureUse CaseCharacteristics
Feedforward NetworksLayers of neurons, no cyclesClassification, regressionSimple, fully connected layers
Convolutional Neural Networks (CNN)Convolutional layers, pooling, fully connectedImage processing, computer visionTranslation invariance, parameter sharing
Recurrent Neural Networks (RNN)Loops to maintain stateSequence modeling, NLPHandles variable-length sequences
Long Short-Term Memory (LSTM)Special RNN with memory cellsLong sequence modelingHandles vanishing gradient problem
Transformer NetworksAttention mechanisms, self-attentionNLP, image processingParallel processing, captures long-range dependencies
Generative Adversarial Networks (GAN)Generator and discriminator networksImage generation, style transferGenerates realistic data samples

AI Planning

MethodDescriptionAdvantagesDisadvantages
Classical PlanningFind sequence of actions to reach goalSystematic, optimal solutionsAssumes fully observable, deterministic environment
Probabilistic PlanningHandle uncertainty in actions and statesRealistic, handles uncertaintyComputationally expensive
Hierarchical PlanningDecompose complex tasks into subtasksManages complexity, reusable componentsRequires domain knowledge
Multi-Agent PlanningCoordinate multiple agents to achieve goalsHandles distributed systemsComplex coordination, communication overhead
Temporal PlanningConsider timing constraints in planningRealistic scheduling, resource allocationIncreased complexity

Expert Systems

ComponentDescriptionFunctionExamples
Knowledge BaseDomain knowledge stored in rules/factsStore and represent knowledgeMedical diagnosis rules, tax calculation rules
Inference EngineReasoning mechanismApply rules to facts to derive conclusionsForward chaining, backward chaining
Explanation FacilityExplain reasoning processJustify conclusionsTrace of rule applications
Knowledge Acquisition FacilityTool for adding knowledgeInterface for knowledge engineersKnowledge acquisition tools
User InterfaceInterface for usersInteraction with systemText-based, graphical interfaces

Natural Language Processing (NLP)

TaskDescriptionTechniquesApplications
TokenizationSplit text into tokens (words, sentences)Rule-based, statistical methodsPreprocessing for all NLP tasks
Part-of-Speech TaggingLabel each word with its grammatical roleHMM, CRF, neural networksGrammar checking, information extraction
Named Entity Recognition (NER)Identify and classify named entitiesRule-based, machine learningInformation extraction, question answering
Sentiment AnalysisDetermine sentiment in textLexicon-based, machine learningSocial media monitoring, review analysis
Machine TranslationTranslate text from one language to anotherRule-based, statistical, neuralLanguage translation systems
Text SummarizationGenerate concise summary of textExtractive, abstractive methodsNews summarization, document processing
Question AnsweringAnswer questions based on textInformation retrieval, neural networksChatbots, search engines

Ethics and AI Safety

ConcernDescriptionExamplesMitigation Strategies
Bias and FairnessAI systems showing unfair behavior toward groupsBiased hiring algorithms, facial recognition biasDebiased training data, fairness constraints
PrivacyAI systems compromising individual privacyData breaches, surveillanceDifferential privacy, federated learning
TransparencyAI systems being "black boxes"Uninterpretable neural networksExplainable AI, model interpretability
AccountabilityDifficulty assigning responsibility for AI decisionsAutonomous vehicle accidentsClear governance, audit trails
Job DisplacementAI automating human jobsAutomation of routine tasksRetraining programs, human-AI collaboration
SecurityAI systems being vulnerable to attacksAdversarial attacks, data poisoningRobust training, secure implementation