LEARNING (from another book): -Learning denotes the changes in the system that are adaptive in the sense that they enable the system to do the same taks or tasks drawn from the same population more efficiently and more effectively the next time -Learning covers a wide range of phenomena, at the one end of the spectrum is skill refinement, people get better at many tasks simply by practicing -At the other end of the spectrum lies knowledge acquisition, many AI programs draw heavily on knowledge as their source of power

1. Rote learning:
	-

2. Learning from advice:
	-

3. Learning by problem solving:
	-

4. Learning from examples:
	-The AI agent is presented with a aset of training examples, each consisting of input attributes and a corresponding output value, the learner then tries to induce a general function or rule that can predict the output value for new input values
	-Example of hand written digits, aru type ko learning would be hard because its hard to define the classes themsevles
	-One common approach to inductive learning is decision tree learning. A decision tree is a tree like structure where each internal node represents a test on a specific input attriubte, each branch represents the outcome of the test, and each leaf reprsensts the calss label
	-To learn a decision tree, we start with the root node and recursively split the data based on the most informative attribute at each level, until we reach a leaf node for each class
	-Here;s how decision tree learnign process for digit identification might work:
	
	1. Start with the root node, which represents the entire dataset
	2. Find the most informative attribute (pixel) that best separates the data into classes
	3. Create a child node for each possible outcome of the test eg if pixel value > 0.5 go left otherwise go right
	4. Recursively repeat steps 2-3 for each child node until all data is correctly classified or some stoping criteria is met
	
	-After learning the decision tree, we can use it to classify new, unseen images by following the path from the root to the appropriate leaf node based on the pixel vavaleus

6. Analogy:
	-Is a type of machine learning where an algorithm learns by recognizing and applying analogies between different domains
	-The basic idea is that if two domains share similar relationships between objects or concepts, then knowledge from one domain can be applied to other domain using analogical reasoning
	-Steps:
	
	1. Retrieve: The algorithm searches for a source analog, which is a known problem that shares similarities with the current problem
	2. Mapping: The algorithm identifies the mapping between the source analog and the current problem, this invovles identifying correspondences between the objects, relations and properties in the two domains
	3. Transfer: the algorithm applies the knowledge from the source analog to the current problem by transferring the mappings to create a soltuion
	4. Evaluate: the aglrotihm evaluates the solution to determine if it is correct and makes necessary adjustments
	
	-One of the key challenges of anlaogy based leanring is identifying appropraite source analogs and determining the appropraite mappings between two domains
	-Requires significatn domain knowledge and expertise on he part of the algorithm designed
	-EXAMPLE ko lagi angle ra line theorem prover le rleaiton banako wala bhaihalyo
		

5. Explanation based learning
-


ANOTHER TYPE OF CLASSIFICATION:

1. Supervised learning:
	-A type of machine learning in which an Ai system learns from labelled data, which means data that is already labeleed with correct output
	-The goal of superised learning is to learn a general rule that maps inputs to output which can then be used to predict the output for new, unseen inputs
	-Can be further divided into:
	>Regression: in regression, the output is a continuous value, the goal is to predcit a value based on a set of input featues, for example price of house based on its size
	>Classification: the output is a discrete value, goal is to predict a label class based on a set of input features for example whether an email is a spam
	
	Mathematical:	
		-We have a training set consnisting of input features X and output labels Y. We want to learn a function f(X) that maps the input features to output labels, we do this by minizmignt the error between the predicated output and the true output, typically done by using a loss funciton like mean ssqure error (MSE)
		
	Example:
		-Image classification whether dog ,c at or bear
		
2. Unsupervised:
	-Unsupervised learning is a type of machine learning in which the AI system learns from unlabeled data, which means data without any predefined output. The goal of unsupervised learning is to learn the underlying structure and patterns in the data.
	-Unsupervised learning can be further divided into two subcategories:

	Clustering: In clustering, the goal is to group similar data points together. For example, grouping customers with similar purchasing behavior into different segments.

Dimensionality Reduction: In dimensionality reduction, the goal is to reduce the number of features of the data while retaining as much information as possible. For example, reducing the number of features of an image while retaining its essential characteristics.

	Mathematical:
		-In unsupervised learning, we have a training set consisting of input features X, but no output labels y. The goal is to find patterns or structure in the data. This is typically done using techniques like clustering or principal component analysis (PCA).

	Example:
		-An example of unsupervised learning is market basket analysis. Given a dataset of customer transactions, the AI system can learn to group together items that are frequently purchased together (e.g., chips and salsa) to help retailers better understand customer behavior and optimize store layouts.
		
		
3. Reinforcement learning:
	-Reinforcement learning is a type of machine learning in which the AI system learns by interacting with an environment and receiving feedback in the form of rewards or penalties. The goal of reinforcement learning is to learn an optimal policy that maximizes the expected reward.
	
	Mathemtiacal:
		-In reinforcement learning, the AI system interacts with the environment through a sequence of actions. The system receives a state from the environment, takes an action based on that state, and receives a reward or penalty based on the action taken. The goal is to learn an optimal policy that maps states to actions that maximizes the expected reward. This is typically done using techniques like Q-learning or policy gradient methods.
		
	Example:
		-A robot that navigaes through thte maze
		
		
7(continuation): Neural net learning and genetic learning:
	-Efforts in machine learning to mimic animal learning at a neutral level
	-Neural network models are based on a computational brain metaphor a number of other techqniues are inspired by evolution called genetic algorithms

GENETIC LEARNING: -Genetic algorithm is a metaheusitic inspired by natural selection that belongs to the larger calss of evolutionary algorithms -Commonly used to generate high quality solutiosn to optimizations and search problems by relying on biologically inspired operators such as mutation, crossover and selection -Generate a set of random soultions and make them compete in anarea where only the fittest survive, each solution in the set is equivalent to a chromosome, a set of such solutions (chromosomes) forms a popoulation -The algorithm then uses three basic genetic operators reproduction, crosover and mutation together with fitness function to evovle a new population or the next generation -Starting from a random set of solutions the algorithm uses these operators and the fitness function to guide its search for the optimal solution -The fitness function gauges how good the solution in question is and provides a mesure to its adaptability or szvivability

1. Initialization:
	-Chromosome representation is one of the main challenges in oritenting the problem to suit the GA applciation
	-The population size depends on the nature of the problem but typically contains seevral hundreds of thousands of possible solution
	-Often randomly generated, allowing the entire range of possible solutions like search space

2. Selection:
	-During each successive generation, a portion of the existing population is selected to reproduce for a new generation, indiviaul solutions are selected through a fitness based process, where fitter solutions (measured by fitness functiosn) are typically more likely to be selected
	(rouletee wheel bata rey ticket scheudling jasto)
	-The fitness function is defined over the genetic representation and measures the quality of the represented solution
	-For isntance, in the knapsack solution, one wants to maximize the total value of objects that can be put in a knapsack of some fixed quanitty. A representation of a solution might be an array of bits where each bit represents a different object, and the value of the bit (0 or 1) represents whether or not the object is in the knapsack
	-The fitness is the sum of the values of all the objects in the knapsack
	

3. Crossover;
	-Next step is to generate a second gneration population of soltions from those selected through a combinatino of geneti coperators crossover and mutation
	-For each new solution to be produced, a pair of parent solutions is selected for breeding from the pool selected previously, by producing a child solution using the above methods of crossover and mutation, a new solution is created which typically shares many of the characterisitcs of its parents:
		1. One point corssover:
			-A point on both parents chromosomes is picked randomly and desinged a crossover point, bits to the right of that point are swapped between the two parent chormosomes
			
		2. Two point:
			-Duita point randomly choose garni bich ko swap garni
			
4. Mutation:
	-Euta bit randomly flip garni with probabilty of 1/lenght of chromosomes
	
5. New generation:
	-The indiviudal with better fitness values are selected from the parent and the child population to form the next gnereation