instruction stringlengths 42 87 | input stringclasses 1
value | output stringlengths 84 289 |
|---|---|---|
Explain what Artificial Intelligence (AI) is. | Artificial Intelligence (AI) is the simulation of human intelligence in machines that are programmed to think and learn. It involves creating systems capable of performing tasks that typically require human intelligence, such as perception, reasoning, problem-solving, and decision-making. | |
Define supervised learning in machine learning. | Supervised learning is a machine learning technique where a model is trained on labeled data. The algorithm learns to map inputs to known outputs based on example input-output pairs, enabling it to predict outcomes for new, unseen data. | |
List three common types of neural network architectures. | 1. Feedforward Neural Networks (FNN), 2. Convolutional Neural Networks (CNN), 3. Recurrent Neural Networks (RNN). | |
What is the difference between classification and regression tasks in machine learning? | Classification tasks predict discrete labels or categories, like spam detection, while regression tasks predict continuous values, such as predicting housing prices. | |
Describe overfitting and how to prevent it in a machine learning model. | Overfitting occurs when a model learns noise and details in the training data, performing poorly on new data. It can be prevented using regularization techniques, cross-validation, pruning, or obtaining more data. | |
Write a Python function to compute mean squared error (MSE). | def mean_squared_error(y_true, y_pred):
return sum((yt - yp) ** 2 for yt, yp in zip(y_true, y_pred)) / len(y_true) | |
What is reinforcement learning? Give an example. | Reinforcement learning is a type of machine learning where an agent learns to make decisions by taking actions in an environment to maximize cumulative rewards. An example is training a robot to navigate a maze by rewarding it for reaching the goal. | |
Name and describe two popular ensemble methods. | 1. Bagging: Combines predictions from multiple independent models trained on bootstrapped samples (e.g., Random Forest).
2. Boosting: Sequentially trains models, each correcting the errors of the previous one (e.g., AdaBoost, Gradient Boosting). | |
Explain the concept of feature engineering in machine learning. | Feature engineering is the process of selecting, transforming, or creating features (input variables) that improve the performance of machine learning models. | |
Provide code to split a dataset into training and test sets using scikit-learn. | from sklearn.model_selection import train_test_split
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42) | |
What is the purpose of cross-validation in model evaluation? | Cross-validation is used to assess how a model generalizes to independent data. It involves dividing the dataset into folds and rotating the validation set across these folds to ensure robust evaluation. | |
List common activation functions used in neural networks. | Common activation functions include ReLU (Rectified Linear Unit), sigmoid, and tanh. | |
What are precision and recall in the context of classification? | Precision is the ratio of true positives to total predicted positives, while recall is the ratio of true positives to all actual positives. Both are used to evaluate model performance for imbalanced datasets. | |
Describe the k-means clustering algorithm. | K-means clustering partitions data into k distinct groups based on feature similarity by iteratively updating cluster centroids and assigning points to the nearest cluster. | |
How can you handle missing data in a dataset? | Common strategies include removing data with missing values, imputing missing values with the mean, median, or mode, or using advanced techniques like k-NN imputation. | |
Give an example use-case for natural language processing (NLP). | Chatbots utilize natural language processing to interpret user input and generate appropriate responses in customer service applications. |
README.md exists but content is empty.
- Downloads last month
- 1