1. What is the difference between Artificial Intelligence, Machine Learning, and Deep Learning?
Ans:
Artificial Intelligence (AI) is the overarching field of enabling machines to perform tasks requiring human intelligence. Machine Learning (ML) is a subset of AI where systems learn patterns from data. Deep Learning is a further subset of ML that uses multi-layered neural networks to model complex data for tasks like image recognition and NLP.
2. Can you explain supervised, unsupervised, and reinforcement learning with examples?
Ans:
Supervised learning uses labeled data to predict outcomes, e.g., predicting house prices. Unsupervised learning identifies patterns in unlabeled data, e.g., customer segmentation. Reinforcement learning trains agents via rewards and penalties, e.g., self-driving cars learning optimal navigation.
3. How do you handle overfitting in a machine learning model?
Ans:
Overfitting occurs when a model performs well on training data but poorly on unseen data. It can be mitigated using cross-validation, regularization (L1/L2), dropout in neural networks, pruning in decision trees, increasing training data, or applying data augmentation techniques.
4. What is the bias-variance tradeoff in machine learning?
Ans:
The bias-variance tradeoff is the balance between underfitting and overfitting. High bias causes underfitting, high variance causes overfitting. The objective is to achieve a balance that minimizes total error. Techniques include regularization, cross-validation, and ensemble methods such as Random Forest or Gradient Boosting.
5. What is a confusion matrix and which evaluation metrics can be derived from it?
Ans:
A confusion matrix summarizes classification performance using True Positives, True Negatives, False Positives, and False Negatives. Metrics such as accuracy, precision, recall, and F1-score are derived from it to assess model performance and make informed decisions.
6. What are activation functions in neural networks and why are they important?
Ans:
Activation functions introduce non-linearity in neural networks, enabling them to model complex patterns. Common functions include ReLU (efficient for deep networks), Sigmoid (outputs probability), and Tanh (outputs in range [-1,1]). Without activation functions, networks behave as linear models, limiting their learning capacity.
7. How do you choose the appropriate algorithm for a machine learning problem?
Ans:
Algorithm selection depends on data type, problem type, interpretability requirements, computational resources, and desired accuracy. For example, linear regression suits small tabular datasets, deep learning suits unstructured data like images, and ensemble methods like Random Forest or XGBoost offer high accuracy on tabular datasets.
8. What is Gradient Descent and what are its variants?
Ans:
Gradient Descent is an optimization technique used to minimize a model’s loss function by iteratively updating parameters in the negative gradient direction. Variants include Batch Gradient Descent (all data), Stochastic Gradient Descent (per data point), and Mini-batch Gradient Descent (subset of data). Adaptive optimizers like Adam improve convergence efficiency.
9. What are common challenges when deploying AI/ML models in production?
Ans:
Production deployment challenges include data drift, scalability, latency requirements, model interpretability, and performance monitoring. Mitigation strategies involve continuous model retraining, containerization with Docker, model versioning, and tracking performance metrics using tools such as MLflow or Prometheus.
10. Can you describe a real-world AI/ML project you have worked on and its outcomes?
Ans:
In a predictive maintenance project, sensor data was used to anticipate equipment failures. Challenges included missing values, class imbalance, and feature selection. Techniques such as data imputation, SMOTE, and feature engineering were applied. The project reduced downtime by 20% and optimized maintenance scheduling.