AI Lab 10 Lab Tasks
AI Lab 10 Lab Tasks
AI Lab 10 Lab Tasks
A- Outcomes:
After completion of the lab session students will be able:
a. To understand basics of neural networks
b. To define the architecture of a neural network and compile it
c. To understand how to train a neural network model for the given data
d. To understand the predictions from a neural network
1
Lab Session -10
B- Lab Tasks:
1- Predicting House Prices:
Suppose you are given a data set containing the sizes of houses (in square feet) in
Bahawalpur and their corresponding prices (in PKR). Your task is to build a simple
sequential model using TensorFlow and Keras to predict house prices based on their
sizes.
a. Import the necessary libraries.
b. Build a sequential model with a single dense layer.
c. Compile the model using an appropriate optimizer and loss function.
d. Assume the following data for house sizes and prices:
house_sizes=np.array([1000,1500,2000,2500,3000,3500,4000], dtype=float)
prices=np.array([20000000,30000000,40000000,50000000,60000000,700000
00,80000000], dtype=float)
e. Train the model using the given data for 1000 epochs.
f. Predict the price of a house that is 2700 square feet in size.
Write/copy your code here:
2
Lab Session -10
4
Lab Session-10