Machine learning and data science in MATLAB offer powerful tools to analyze data, build models, and improve decision-making. Topics covered include classification, regression, feature selection, and neural networks basics.
MCQs
1. Introduction to Machine Learning in MATLAB
Which MATLAB toolbox provides functions for machine learning? a) Statistics and Machine Learning Toolbox b) Neural Networks Toolbox c) Image Processing Toolbox d) Simulink Toolbox
Which of the following MATLAB functions is used to train a machine learning model? a) fitctree b) predict c) svmTrain d) trainModel
What is the primary purpose of machine learning in MATLAB? a) To analyze image data b) To predict outcomes based on past data c) To perform numerical simulations d) To process audio signals
Which of the following is an example of supervised learning in MATLAB? a) K-means clustering b) Principal Component Analysis (PCA) c) Support Vector Machines (SVM) d) Hierarchical clustering
What does the function cvpartition in MATLAB do? a) Splits data into training and test sets for cross-validation b) Reduces the dimensionality of data c) Visualizes data distributions d) Creates clusters in unsupervised learning
Which of the following machine learning models can be built using MATLAB? a) Decision trees b) K-nearest neighbors c) Naive Bayes classifier d) All of the above
In MATLAB, which function is commonly used for splitting data into training and testing sets? a) cvpartition b) splitData c) partitionData d) trainTestSplit
What does the fitlm function in MATLAB do? a) Fits a linear regression model to data b) Creates a random forest model c) Performs feature selection d) Trains a decision tree
What is the role of the crossval function in machine learning? a) It performs cross-validation to estimate the model’s performance b) It splits data into test and validation sets c) It optimizes hyperparameters d) It visualizes decision boundaries
Which of the following MATLAB functions is used to evaluate the accuracy of a classification model? a) classificationError b) confusionmat c) modelEval d) accuracyCheck
2. Classification and Regression Models
Which of the following models is used for classification in MATLAB? a) Linear regression b) K-means clustering c) Support Vector Machine (SVM) d) Principal Component Analysis (PCA)
What does the fitctree function in MATLAB do? a) Fits a decision tree classifier b) Fits a linear regression model c) Trains a neural network d) Performs clustering
Which of the following is a regression model available in MATLAB? a) Decision tree b) Support Vector Machine (SVM) c) Linear regression d) K-means clustering
Which function is used to make predictions from a trained model in MATLAB? a) predict b) predictModel c) classify d) testModel
In a regression model, what does the fitrsvm function in MATLAB train? a) Support Vector Machine for regression b) Decision tree for regression c) Naive Bayes classifier d) K-nearest neighbors for classification
What is the main advantage of using Support Vector Machines (SVM) in classification? a) SVM works well with high-dimensional data b) SVM is simple to implement c) SVM is slower compared to other models d) SVM requires a large amount of training data
In MATLAB, which method is used to evaluate a regression model’s performance? a) Root Mean Squared Error (RMSE) b) Mean Absolute Error (MAE) c) R-squared (R²) d) All of the above
Which of the following is an example of a classification problem? a) Predicting house prices b) Categorizing emails as spam or not spam c) Forecasting stock market prices d) Predicting the temperature for the next day
What does the confusionmat function return in MATLAB? a) A matrix showing the performance of a classification model b) A list of regression errors c) A tree structure of decision rules d) A summary of model accuracy
What does the fitclinear function in MATLAB do? a) Fits a linear model for classification b) Trains a decision tree for classification c) Fits a linear regression model d) Performs k-means clustering
3. Feature Selection and Dimensionality Reduction
What is the purpose of feature selection in machine learning? a) To increase the dimensionality of the data b) To reduce the number of irrelevant or redundant features c) To increase the computational complexity of the model d) To reduce the size of the dataset
Which MATLAB function is used to perform feature selection using a wrapper method? a) sequentialfs b) svmRFE c) filterFeatures d) selectFeatures
Which technique in machine learning is used for reducing the dimensionality of data? a) K-means clustering b) Principal Component Analysis (PCA) c) Random forests d) Support Vector Machines (SVM)
What does the pca function in MATLAB do? a) Performs Principal Component Analysis (PCA) to reduce data dimensions b) Performs clustering of data points c) Creates decision tree models d) Selects features for regression models
How does Principal Component Analysis (PCA) reduce dimensionality? a) By removing data points with high variance b) By projecting data onto orthogonal axes of maximum variance c) By clustering similar data points d) By selecting a subset of the original features
Which of the following is a common method for feature selection in MATLAB? a) Backward elimination b) Forward selection c) Genetic algorithms d) All of the above
Which MATLAB function can be used to standardize features before applying machine learning algorithms? a) normalize b) standardize c) scaleData d) transformFeatures
Why is it important to scale or normalize features in machine learning models? a) To increase model accuracy b) To ensure that all features contribute equally to the model c) To reduce the training time d) To make the model faster to deploy
Which of the following dimensionality reduction methods can be applied to non-linear data? a) PCA b) LDA c) t-SNE d) Random Forest
What does the fscnca function in MATLAB do? a) Performs feature selection using feature ranking for classification b) Reduces the dimensionality of the data c) Implements feature extraction for regression models d) Applies linear discriminant analysis
Answer Key
Qno
Answer (Option with the text)
1
a) Statistics and Machine Learning Toolbox
2
a) fitctree
3
b) To predict outcomes based on past data
4
c) Support Vector Machines (SVM)
5
a) Splits data into training and test sets for cross-validation
6
d) All of the above
7
a) cvpartition
8
a) Fits a linear regression model to data
9
a) It performs cross-validation to estimate the model’s performance
10
b) confusionmat
11
c) Support Vector Machine (SVM)
12
a) Fits a decision tree classifier
13
c) Linear regression
14
a) predict
15
a) Support Vector Machine for regression
16
a) SVM works well with high-dimensional data
17
d) All of the above
18
b) Categorizing emails as spam or not spam
19
a) A matrix showing the performance of a classification model
20
a) Fits a linear model for classification
21
b) To reduce the number of irrelevant or redundant features
22
a) sequentialfs
23
b) Principal Component Analysis (PCA)
24
a) Performs Principal Component Analysis (PCA) to reduce data dimensions
25
b) By projecting data onto orthogonal axes of maximum variance
26
d) All of the above
27
a) normalize
28
b) To ensure that all features contribute equally to the model
29
c) t-SNE
30
a) Performs feature selection using feature ranking for classification