- Which library is primarily used for deep learning in Python?
View Answer
Correct answer: A — TensorFlow
- What will be printed?
1 python 2 import tensorflow as tf 3 print(tf.__version__!="") View Answer
Correct answer: A — True
- Which of the following is used to define tensors in TensorFlow?
View Answer
Correct answer: D — All of the above
- What is the output of below code?
1 python 2 import tensorflow as tf 3 x = tf.constant([1,2,3]) 4 print(x.shape) View Answer
Correct answer: A — (3,)
- Which function is used to build models in TensorFlow Keras?
View Answer
Correct answer: A — Sequential()
- What will be printed?
1 python 2 from tensorflow.keras.models import Sequential 3 print(callable(Sequential)) View Answer
Correct answer: A — True
- Which of the following is used for defining layers in Keras?
View Answer
Correct answer: D — All of the above
- What is the output of below code?
1 python 2 from tensorflow.keras.layers import Dense 3 print(isinstance(Dense(10),Dense)) View Answer
Correct answer: A — True
- Which library is used for tensor operations similar to NumPy but with GPU support?
View Answer
Correct answer: A — PyTorch
- What will be printed?
1 python 2 import torch 3 x = torch.tensor([1,2,3]) 4 print(x.size()) View Answer
Correct answer: A — torch.Size([3])
- Which of the following is used for automatic differentiation in PyTorch?
View Answer
Correct answer: A — autograd
- What is the output of below code?
1 python 2 import torch 3 x = torch.tensor(2.0,requires_grad=True) 4 y = x**2 5 y.backward() 6 print(x.grad) View Answer
Correct answer: B — tensor(2.)
- Which of the following is PyTorch's neural network module?
View Answer
Correct answer: A — torch.nn
- What will be printed?
1 python 2 import torch.nn as nn 3 print(hasattr(nn,"Linear")) View Answer
Correct answer: A — True
- Which of the following is used for optimization in PyTorch?
View Answer
Correct answer: A — torch.optim
- What is the output of below code?
1 python 2 import torch.optim as optim 3 print(hasattr(optim,"SGD")) View Answer
Correct answer: A — True
- Which library is used for machine learning algorithms in Python?
View Answer
Correct answer: A — scikit-learn
- What will be printed?
1 python 2 import sklearn 3 print(sklearn.__version__!="") View Answer
Correct answer: A — True
- Which function splits dataset into train and test in scikit-learn?
View Answer
Correct answer: A — train_test_split()
- What is the output of below code?
1 python 2 from sklearn.model_selection import train_test_split 3 print(callable(train_test_split)) View Answer
Correct answer: A — True
- Which function standardizes features in scikit learn?
View Answer
Correct answer: A — StandardScaler
- What will be printed?
1 python 2 from sklearn.preprocessing import StandardScaler 3 print(callable(StandardScaler)) View Answer
Correct answer: A — True
- Which function normalizes features in scikit learn?
View Answer
Correct answer: A — Normalizer
- What is the output of below code?
1 python 2 from sklearn.preprocessing import Normalizer 3 print(hasattr(Normalizer(),"fit")) View Answer
Correct answer: A — True
- Which function reduces dimensionality in scikit learn?
View Answer
Correct answer: A — PCA
- What will be printed?
1 python 2 from sklearn.decomposition import PCA 3 print(callable(PCA)) View Answer
Correct answer: A — True
- Which function trains linear regression in scikit learn?
View Answer
Correct answer: A — LinearRegression
- What is the output of below code?
1 python 2 from sklearn.linear_model import LinearRegression 3 print(hasattr(LinearRegression(),"fit")) View Answer
Correct answer: A — True
- Which function trains logistic regression in scikit learn?
View Answer
Correct answer: A — LogisticRegression
- What will be printed?
1 python 2 from sklearn.linear_model import LogisticRegression 3 print(callable(LogisticRegression)) View Answer
Correct answer: A — True
- Which function trains decision tree in scikit learn?
View Answer
Correct answer: A — DecisionTreeClassifier
- What is the output of below code?
1 python 2 from sklearn.tree import DecisionTreeClassifier 3 print(hasattr(DecisionTreeClassifier(),"fit")) View Answer
Correct answer: A — True
- Which function trains random forest in scikit learn?
View Answer
Correct answer: A — RandomForestClassifier
- What will be printed?
1 python 2 from sklearn.ensemble import RandomForestClassifier 3 print(callable(RandomForestClassifier)) View Answer
Correct answer: A — True
- Which function trains support vector machine in scikit learn?
View Answer
Correct answer: D — All of the above
- What is the output of below code?
1 python 2 from sklearn.svm import SVC 3 print(hasattr(SVC(),"fit")) View Answer
Correct answer: A — True
- Which function trains k nearest neighbors in scikit learn?
View Answer
Correct answer: C — Both A and B
- What will be printed?
1 python 2 from sklearn.neighbors import KNeighborsClassifier 3 print(callable(KNeighborsClassifier)) View Answer
Correct answer: A — True
- Which function trains naive bayes in scikit learn?
View Answer
Correct answer: D — All of the above
- What is the output of below code?
1 python 2 from sklearn.naive_bayes import GaussianNB 3 print(hasattr(GaussianNB(),"fit")) View Answer
Correct answer: A — True
- Which function trains gradient boosting in scikit learn?
View Answer
Correct answer: C — Both A and B
- What will be printed?
1 python 2 from sklearn.ensemble import GradientBoostingClassifier 3 print(callable(GradientBoostingClassifier)) View Answer
Correct answer: A — True
- Which function evaluates model accuracy in scikit learn?
View Answer
Correct answer: A — accuracy_score
- What is the output of below code?
1 python 2 from sklearn.metrics import accuracy_score 3 print(accuracy_score([1,0],[1,0])) View Answer
Correct answer: A — 1.0
- Which function evaluates confusion matrix in scikit learn?
View Answer
Correct answer: A — confusion_matrix
- What will be printed?
1 python 2 from sklearn.metrics import confusion_matrix 3 print(confusion_matrix([1,0],[1,0])) View Answer
Correct answer: A — [[1 0] [0 1]]
- Which function evaluates classification report in scikit learn?
View Answer
Correct answer: A — classification_report
- What is the output of below code?
1 python 2 from sklearn.metrics import classification_report 3 print("precision" in classification_report([1,0],[1,0])) View Answer
Correct answer: A — True
- Which function saves model in scikit learn?
View Answer
Correct answer: A — joblib.dump()
- What will be printed?
1 python 2 import joblib 3 print(callable(joblib.dump)) View Answer
Correct answer: A — True