شغل أصيل
شغل أصيل
شغل أصيل
Question 3
Question 4
Which of the following code lines can be used for the above dataset
Selected Answers:
from sklearn.neighbors import KNeighborsClassifier
C.
Question 5
Please put the following scikit-learn codes for the iris dataset in the correct order.
X = iris["data"] X = iris["data"]
y = iris.target y = iris.target
2. 2.
3. 3.
Question 6
Gradient Descent cannot get stuck in a local minimum when training a Logistic Regression model because the cost
function is convex
Question 7
Suppose you are using Polynomial Regression. You plot the learning curves and you notice that there is a large gap
between the training error and the validation error.
The issue is that the model is overfitting the training set. This can be solved by:
Selected D.
Answer: Regularizing the model. For example, by adding an l2 penalty (Ridge) or an l1 penalty (Lasso) to the cost
function.
Question 8
For the good ML practice, it is recommended to split the dataset into three sets:
Contains Training
Contains training
Contains Train
Contains train
Question 9
l1 = Lasso
The training approach that is applied for the above code in scikit-learn tool is:
Question 10
Logistic =[A] is a =[B] supervised learning algorithm that is used to estimate the =[C] that an instance belongs to a
particular =[D].
Question 11
"It is the science (and art) of programming computers so they can learn from data."
B. Machine Learning
Selected Answer:
B. Machine Learning
Correct Answer:
Question 12
How many parameters are in a linear regression model for the dataset with 5 features?
C. 7
Selected Answer:
B. 6
Correct Answer:
Question 13
The reason for the above performance of the linear regression model is:
Question 15
Examples x1 x2 class
1 6 1 0
2 7 3 0
3 8 2 0
4 9 0 0
5 8 4 1
6 8 6 1
7 9 2 1
8 9 5 1
To classify a new example (8, 3.5) using kNN classifier with manhattan distance, then the correct
answers to the following blanks are:
Exact Match 8
Exact Match 4
Exact Match .5
Exact Match 1
Question 16
Selected Answer:
To predict the prices of cars, the type of Machine Learning algorithm that would you use is:
Question 18
D. Instance-based Learning
Selected Answer:
D. Instance-based Learning
Correct Answer:
Question 19
model = LogisticRegression()
model.fit(input_train, target_train)
If you have been asked to find the output of the sigmoid function, then the correct line code using
scikit-learn is: sigmoid function داﻣﮫ ﻗﺎل
Selected Answer:
ﻣﻌﻨﺎﺗﮫ ﻳ�� اﺣﺘﻤﺎﻟﻴﺔ
output_value = model.predict_proba(input_test)
B.
Correct Answer:
output_value = model.predict_proba(input_test)
B.
Question 20
Question 21
(Hint)
B. Normalization
Selected Answer:
D. Standardization
Correct Answer:
← OK
6/11/22, 10:47 PM Review Test Submission: Midterm (April 19 2022) – مقدمة...
D. Confusion Matrix
Question 2
"It is the study of how to make computers do things at which, at the moment, people are better."
D. Artificial Intelligence
Selected Answer:
D. Artificial Intelligence
Correct Answer:
Question 3
(Hint)
D. Normalization
Selected Answer:
A. Standardization
Correct Answer:
Question 4
https://lms.uqu.edu.sa/webapps/assessment/review/review.jsp?attempt_id=_7983773_1&course_id=_220895_1&content_id=_1938118_1&outcome_i… 2/7
6/11/22, 10:47 PM Review Test Submission: Midterm (April 19 2022) – مقدمة...
The training approach that is applied for the above code in scikit-learn tool is:
Question 5
Model parameters should be the optimal values in order to use the model for predicting new
instances.
Question 6
Please put the following scikit-learn codes for the iris dataset in the correct order.
X = iris["data"] X = iris["data"]
y = iris.target y = iris.target
2. 2.
3. 3.
y_pred=knn.predict(X_test) y_pred=knn.predict(X_test)
6. 6.
Question 7
Gradient Descent cannot get stuck in a local minimum when training a Logistic Regression model because the cost
function is convex
Question 8
https://lms.uqu.edu.sa/webapps/assessment/review/review.jsp?attempt_id=_7983773_1&course_id=_220895_1&content_id=_1938118_1&outcome_i… 3/7
6/11/22, 10:47 PM Review Test Submission: Midterm (April 19 2022) – مقدمة...
For the good ML practice, it is recommended to split the dataset into three sets:
Contains Training
Contains training
Contains Train
Contains train
Question 9
Question 10
Which of the following code lines can be used for the above dataset
Selected Answers:
from sklearn.linear_model import LogisticRegression
B.
Correct Answers:
from sklearn.neighbors import KNeighborsRegressor
A.
Question 11
model = LogisticRegression()
model.fit(input_train, target_train)
https://lms.uqu.edu.sa/webapps/assessment/review/review.jsp?attempt_id=_7983773_1&course_id=_220895_1&content_id=_1938118_1&outcome_i… 4/7
6/11/22, 10:47 PM Review Test Submission: Midterm (April 19 2022) – مقدمة...
If you have been asked to find the class type, then the correct line code using scikit-learn is:
Selected Answer:
output_value = model.predict_proba(input_test)
B.
Correct Answer:
output_value = model.predict(input_test)
C.
Question 12
Question 13
___________ is a learning approach that is used for training a model using all the available data.
A. Model-based Learning
Selected Answer:
ﻛﻤﻴﺔ اﻟﺪاﺗﺎ اﳌﺴﺘﺨﺪﻣﺔ، اﻟﻈﺎهﺮ ان اﳌﻘﺼﻮد
اﻧﮫ ﻛﻴﻒ �ﺴﺘﺨﺪﻣهﺎ... وﻟ�ﺲ
B. Batch Learning
Correct Answer:
Question 14
To detect spam filters, the type of Machine Learning algorithm that would you use is:
Question 15
Question 16
The reason for the above performance of the linear regression model is:
https://lms.uqu.edu.sa/webapps/assessment/review/review.jsp?attempt_id=_7983773_1&course_id=_220895_1&content_id=_1938118_1&outcome_i… 5/7
6/11/22, 10:47 PM Review Test Submission: Midterm (April 19 2022) – مقدمة...
Question 17
Correct Answer:
Question 18
Logistic =[A] is a =[B] supervised learning algorithm that is used to estimate the =[C] that an instance belongs to a
particular =[D].
Question 19
How many parameters are in a linear regression model for the dataset with 6 features?
D. 6
Selected Answer:
A. 7
Correct Answer:
Question 20
Suppose you are using Polynomial Regression. You plot the learning curves and you notice that there is a large gap
between the training error and the validation error.
https://lms.uqu.edu.sa/webapps/assessment/review/review.jsp?attempt_id=_7983773_1&course_id=_220895_1&content_id=_1938118_1&outcome_i… 6/7
6/11/22, 10:47 PM Review Test Submission: Midterm (April 19 2022) – مقدمة...
The issue is that the model is overfitting the training set. This can be solved by:
Selected Answer:
C. Increasing the size of the training set.
Question 21
Examples x1 x2 class
1 6 1 0
2 7 3 0
3 8 2 0
4 9 0 0
5 8 4 1
6 8 6 1
7 9 2 1
8 9 5 1
To classify a new example (8, 3.5) using kNN classifier with manhattan distance, then the correct
answers to the following blanks are:
Exact Match 8
Exact Match 4
Exact Match .5
Exact Match 1
Saturday, June 11, 2022 10:46:45 PM AST
← OK
https://lms.uqu.edu.sa/webapps/assessment/review/review.jsp?attempt_id=_7983773_1&course_id=_220895_1&content_id=_1938118_1&outcome_i… 7/7