0% found this document useful (0 votes)
7 views5 pages

PPPL Final Practical Questions

The document outlines a series of data analysis and machine learning tasks across various datasets, including tips, iris, flights, diamonds, titanic, and penguins. It covers tasks such as plotting distributions, creating regression models, and implementing classification algorithms. Additionally, it discusses programming concepts like decorators, abstraction, polymorphism, and encapsulation, along with practical examples and error handling in Python.

Uploaded by

yathartha2713
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views5 pages

PPPL Final Practical Questions

The document outlines a series of data analysis and machine learning tasks across various datasets, including tips, iris, flights, diamonds, titanic, and penguins. It covers tasks such as plotting distributions, creating regression models, and implementing classification algorithms. Additionally, it discusses programming concepts like decorators, abstraction, polymorphism, and encapsulation, along with practical examples and error handling in Python.

Uploaded by

yathartha2713
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Dataset: tips

 Q1. Plot the distribution of total bill amounts using seaborn and matplotlib.

 Q2. Create a scatter plot showing the relationship between total_bill and tip. Use
hue based on time.

 Q3. Create side-by-side boxplots for total bill split by day.

2. Dataset: iris

 Q5. Plot a pairplot for all numeric columns colored by species.

 Q6. Draw a scatter plot showing the distribution of petal_length for each species.

 Q7. Create a heatmap of the correlation matrix for the iris dataset.

3. Dataset: flights

 Q8. Create a line plot showing the number of passengers over years.

 Q9. Make a heatmap showing monthly passenger numbers for each year (pivot
table).

 Q10. Plot a barplot showing the average number of passengers per month.

4. Dataset: diamonds

 Q11. Plot the relationship between carat and price. Use color to differentiate by
cut.

 Q12. Create a boxplot of price grouped by cut.

 Q13. Create a histogram of the price column with appropriate bins.


5. Dataset: titanic

 Q14. Create a pairplot of passengers based on class.

 Q15. Draw a barplot of survival rate by sex.

 Q16. Create a heatmap showing missing values in the dataset.

6. Dataset: penguins

 Q17. Plot a scatter plot of bill_length_mm vs flipper_length_mm, using species


as hue.

 Q18. Create a boxplot of body_mass_g based on species.

 Q19. Use pairplot to visualize relationships between all numeric variables.

House Price Prediction (Simple Linear Regression)

 Q1. Using house_case1.csv, build a simple linear regression model to predict


price based on area.

 Q2. Plot the regression line along with the data points.
2. Multivariate House Price Prediction

 Q1. Using house_case4.csv, build a multiple linear regression model to predict


price using available features (area, bedrooms, age).

 Q2. Which feature has the strongest impact on house price? (Check using model
coefficients.)
3. Insurance Premium Prediction

 Q1. Using insurance_premium.csv, predict premium based on age using linear


regression.

 Q2. Using insurance_premium_multi_variable.csv, predict premium based on


age, bmi, and number_of_dependents.

 Q3. Calculate the mean absolute error (MAE) for your model.

(Dataset: Social_Network_Ads.csv)
4. Predicting Purchase Behavior
 Q9. Build a logistic regression model to predict if a user purchases a product
(Purchased) based on Age and EstimatedSalary.

 Q10. Evaluate the model using a confusion matrix and accuracy score.

 Q11. Plot the confusion matrix for your logistic regression model.

 Q12. Find precision, recall, and F1-score.


(Dataset: Social_Network_Ads.csv)
5. KNN Classifier for Purchase Prediction

 Q13. Build a KNN classifier to predict Purchased based on Age and


EstimatedSalary.

 Q14. Use train-test split (e.g., 75%-25%). What is the best k value (try k = 3, 5,
7)?

 Q15. Plot a confusion matrix and find model accuracy for each k.

 Q16. Compare the KNN model performance with logistic regression.

A. Create a decorator function that accepts a function as an argument.


B. The decorator should log the function name before executing it.
C. It should also calculate and log the execution time.

D. Use time module to measure execution time.


E. Use functools.wraps() to preserve the original function's metadata (such as its
name). F. Use time.time() to capture the start and end times of the function
execution.

G. Subtract the start time from the end time to calculate how long the function
took to execute.
H. Print or log the name of the function being executed.
I. Print or log the execution time in seconds or milliseconds.
J. Explain abstraction with suitable example.
K. Explain Polymorphism with suitable example.

L. Create a base class Student that will store basic student information (e.g.,
name, ID, grade, etc.).
M. Implement methods to set and get the student’s attributes.
N. Handle basic validation for input data (e.g., name should be a string, grade
should be numeric, etc.).

O. Implement error handling to catch invalid inputs (e.g., if a name is not a string,
if grade is out of range, etc.).
P. Use try and except blocks to catch exceptions and display meaningful error
messages to the user.
Q. Create a subclass AdvancedStudent that inherits from Student and adds more
features (e.g., handling advanced subjects, extra credits, or GPA calculation).

R. Demonstrate & explain how encapsulation works by suitable example.


S. Implement methods for updating student records, calculating grades, or any
other relevant operation (e.g., update_grade(), add_subject()).
T. Create instances of both the base and inherited classes.

22. Test error handling by providing invalid data (e.g., entering a negative grade,
non-string names).
23. Create a 1D and 2D NumPy array and determine their shape, size, and data
type.

24. Convert a Python list into a NumPy array and check its properties such as
shape and data type.
25. Generate a NumPy array from a list and explore its dimensions, total
elements, and type.
26. Create and analyze NumPy arrays by checking their structure, size, and
underlying data type.
27. Create a Pandas Series and a DataFrame from a Python list, dictionary, and
NumPy array, ensuring proper column names.
28. Load a CSV file into a Pandas DataFrame, display the first 10 rows, and check
its structure, including the number of rows and columns

You might also like