menu

Python for Data Science and Machine Learning


1. What is the difference between a list and an array in Python?

Lists can only contain one data type, while arrays can contain multiple data types.

Arrays can be resized after creation, while lists cannot.

Lists can be indexed using negative numbers, while arrays cannot.

Arrays are optimized for numerical operations, while lists are not.


2. Which of the following is a method for reducing overfitting in machine learning?

Regularization

Gradient descent

Lasso regression

None of the above


3. Which of the following is used to create arrays in NumPy?

list

tuple

ndarray

set


4. What is the purpose of Pandas library in Python?

Data visualization

Data analysis

Deep learning

Machine learning


5. Which library in Python is used for deep learning?

Keras

PyTorch

TensorFlow

All of the above


6. Which library in Python is used for machine learning?

Pandas

NumPy

Scikit-learn

TensorFlow


7. Which of the following is a Python library for natural language processing?

Matplotlib

NumPy

Pandas

NLTK


8. Which of the following is a regression algorithm in machine learning?

K-means clustering

Decision tree

Random forest

Linear regression


9. What is the purpose of cross-validation in machine learning?

To test the performance of the model on unseen data

To create a validation set for hyperparameter tuning

To reduce overfitting of the model

All of the above


10.

Which library in Python is commonly used for numerical computing and data analysis?

NumPy

Matplotlib

Scikit-learn

TensorFlow