Chapter 1 Capstone Project Ai Class 12
Chapter 1 Capstone Project Ai Class 12
deep understanding of the subject matter. It gives an opportunity for the student to integrate all
their knowledge and demonstrate it through a comprehensive project.
Some Capstone project ideas :-
1. Stock Prices Predictor
2. Develop A Sentiment Analyzer
3. Movie Ticket Price Predictor
4. Students Results Predictor
5. Human Activity Recognition using Smartphone Data set
6. Classifying humans and animals in a photo
Artificial Intelligence is perhaps the most transformative technology available today. Every AI project
follows the following six steps:
1) Problem definition i.e. Understanding the problem
2) Data gathering
3) Feature definition
4) AI model construction
5) Evaluation & refinements
6) Deployment
first step: “understanding the problem”
Begin formulating your problem by asking:- is there a pattern? If there is no pattern, then the problem cannot
be solved with AI technology.
If it is believed that there is a pattern in the data, then AI development techniques may be employed.
Five types of questions:- within the umbrella of predictive analysis:
1) Which category? (Classification)
2) How much or how many? (Regression)
3) Which group? (Clustering)
4) Is this unusual? (Anomaly Detection)
5) Which option should be taken? (Recommendation)
1. Decomposing The Problem Through DT Framework
Design Thinking is a design methodology that provides a solution-based approach to solving problems. It’s
extremely useful in tackling complex problems that are ill-defined or unknown.
The five stages of Design Thinking are as follows: Empathize, Define, Ideate, Prototype, and Test.
Important
Problem decomposition steps:-break down the problem into smaller units before coding
1. Understand the problem and then restate the problem in your own words
Know what the desired inputs and outputs are
Ask questions for clarification (in class these questions might be to your instructor, but most of the
time they will be asking either yourself or your collaborators)
2. Break the problem down into a few large pieces. Write these down, either on paper or as
comments in a file.
3. Break complicated pieces down into smaller pieces. Keep doing this until all of the pieces are small.
4. Code one small piece at a time.
1. Think about how to implement it
2. Write the code/query
3. Test it… on its own.
4. Fix problems, if any
1
How to validate model quality:- IMPORTANT
1.1 Train-Test Split Evaluation
The train-test split is a technique for evaluating the performance of a machine learning algorithm.
It can be used for classification or regression problems and can be used for any supervised learning
algorithm.
The procedure involves taking a dataset and dividing it into two subsets. The first subset is used to fit
the model and is referred to as the training dataset. The second subset of the dataset is provided to the
model, then predictions are made and compared to the expected values. This second dataset is referred
to as the test dataset.
Train Dataset: Used to fit the machine learning model.
Test Dataset: Used to evaluate the fit machine learning model.
The train-test procedure is appropriate when there is a sufficiently large dataset
available.
How to Configure the Train-Test Split
The procedure has one main configuration parameter, which is the size of the train and test sets.
There is no optimal split percentage.
You must choose a split percentage that meets your project’s objectives with considerations that
include:
Computational cost in training the model.
Computational cost in evaluating the model.
Training set representativeness.
Test set representativeness. Nevertheless, common split percentages include:
Train: 80%, Test: 20%
Train: 67%, Test: 33%
Train: 50%, Test: 50%
Example 1: Training and Test Data in Python Machine Learning
As we work with datasets, a machine learning model works in two stages. We usually split the data
around 20%-80% between testing and training stages. Under supervised learning, we split a dataset into
a training data and test data in Python ML.
3
2.1 RMSE (Root Mean Squared Error)
In machine Learning when we want to look at the accuracy of our model we take the root mean square of
the error that has occurred between the test values and the predicted values mathematically:
For a single value:
Let a= (predicted value- actual value) ^2 Let b=
mean of a = a (for single value) Then RMSE=
square root of b
Graphically:
As you can see in this scattered graph the red dots are the actual values and the blue line is the set of
predicted values drawn by our model. Here X represents the distance between the actual value and the
predicted line this line represents the error, similarly, we can draw straight lines from each red dot to the
blue line. Taking mean of all those distances and squaring them and finally taking the root will give us RMSE
of our model.
A good model should have an RMSE value less than 180. Example :
Consider the following data
x y
5 6.4
15 13
25 14.2
35 21.5
45 27.5
Regression Equation:Y= 0.5 X+2.5 Calculate the RMSE (Root means Square Error) for the above data.
Ans:-
error
x y' y error=y'-y *error
5 6.4 5 1.4 1.96
15 13 10 3 9
25 14.2 15 -0.8 0.64
35 21.5 20 1.5 2.25
45 27.5 25 2.5 6.25
sum of square of error 20.1
sum of square of error /
no of observation 4.02
RSME 2.0049
4
MSE (Mean Squared Error)
Mean Square Error (MSE) is the most commonly used regression loss function. MSE is the sum of squared
distances between our target variable and predicted values.
Regression Equation:Y= 0.5 X+2.5 Calculate the MSE ( means Square Error) for the above data.
error
x y' y error=y'-y *error
5 6.4 5 1.4 1.96
15 13 10 3 9
25 14.2 15 -0.8 0.64
35 21.5 20 1.5 2.25
45 27.5 25 2.5 6.25