Medium Changed decision boundary | Solve |
We have trained a model on a linearly separable training set to classify the data points into 2 sets (binary classification). Our intern recently labelled some new data points which are all correctly classified by the model. All of the new data points lie far away from the decision boundary. We added these new data points and re-trained our model- our decision boundary changed. Which of these models do you think we could be working with?
The 2 data sources use SQL Server and have a 3-character CompanyCode column. Both data sources contain an ORDER BY clause to sort the data by CompanyCode in ascending order.
Teylor wants to make sure that the Merge Join transformation works without additional transformations. What would you recommend?
A: Perceptron
B: SVM
C: Logistic regression
D: Guassion discriminant analysis
|
Medium CNN Architecture Tuning | Solve |
You are fine-tuning a Convolutional Neural Network (CNN) for image classification. The network architecture is as follows:
The model is trained using the following parameters:
- Batch size: 64
- Learning rate: 0.001
- Optimizer: Adam
- Loss function: Categorical cross-entropy
After several training epochs, you observe that the training accuracy is high, but the validation accuracy plateaus and is significantly lower. This suggests possible overfitting. Which of the following adjustments would most effectively mitigate this issue without overly compromising the model's performance?
A: Increase the batch size to 128
B: Add dropout layers with a dropout rate of 0.5 after each MaxPooling2D layer
C: Replace Adam optimizer with SGD (Stochastic Gradient Descent)
D: Decrease the number of filters in each Conv2D layer by half
E: Increase the learning rate to 0.01
F: Reduce the size of the Dense layer to 64 units
|
Medium CNN for Imbalanced Image Dataset | Solve |
You are fine-tuning a Convolutional Neural Network (CNN) for an image classification task where the dataset is highly imbalanced. The majority class comprises 70% of the data. The initial model setup and subsequent experiments yield the following observations:
**Initial Setup:**
- CNN architecture: 6 convolutional layers with increasing filter sizes, followed by 2 fully connected layers.
- Activation function: ReLU
- No class-weighting or data augmentation.
- Results: High overall accuracy, but poor precision and recall for minority classes.
**Experiment 1:**
- Changes: Implement class-weighting to penalize mistakes on minority classes more heavily.
- Results: Improved precision and recall for minority classes, but overall accuracy slightly decreased.
**Experiment 2:**
- Changes: Add dropout layers with a rate of 0.5 after each convolutional layer.
- Results: Overall accuracy decreased, and no significant change in precision and recall for minority classes.
Given these outcomes, what is the most effective strategy to further improve the model's performance specifically for the minority classes without compromising the overall accuracy?
A: Increase the dropout rate to 0.7
B: Further fine-tune class-weighting parameters
C: Increase the number of filters in the convolutional layers
D: Add batch normalization layers after each convolutional layer
E: Use a different activation function like LeakyReLU
F: Implement more aggressive data augmentation on the minority class
|
Easy Gradient descent optimization | Solve |
You are working on a regression problem using a simple neural network. You want to optimize the model's weights using gradient descent with different learning rate schedules. Consider the following pseudo code for training the neural network:
Which of the following learning rate schedules would most likely result in the fastest convergence without overshooting the optimal weights?
A: Constant learning rate of 0.01
B: Exponential decay with initial learning rate of 0.1 and decay rate of 0.99
C: Exponential decay with initial learning rate of 0.01 and decay rate of 0.99
D: Step decay with initial learning rate of 0.1 and decay rate of 0.5 every 100 epochs
E: Step decay with initial learning rate of 0.01 and decay rate of 0.5 every 100 epochs
F: Constant learning rate of 0.1
|
Medium Less complex decision tree model | Solve |
You are given a dataset to solve a classification problem using a decision tree algorithm. You are concerned about overfitting and decide to implement pruning to control the model's complexity. Consider the following pseudo code for creating the decision tree model:
Which of the following combinations of parameters would result in a less complex decision tree model, reducing the risk of overfitting?
A: max_depth=5, min_samples_split=2, min_samples_leaf=1
B: max_depth=None, min_samples_split=5, min_samples_leaf=5
C: max_depth=3, min_samples_split=2, min_samples_leaf=1
D: max_depth=None, min_samples_split=2, min_samples_leaf=1
E: max_depth=3, min_samples_split=10, min_samples_leaf=10
F; max_depth=5, min_samples_split=5, min_samples_leaf=5
|
Easy n-gram generator | Solve |
Our newest machine learning developer want to write a function to calculate the n-gram of any text. An N-gram means a sequence of N words. So for example, "black cats" is a 2-gram, "saw black cats" is a 3-gram etc. The 2-gram of the sentence "the big bad wolf fell down" would be [["the", "big"], ["big", "bad"], ["bad", "wolf"], ["wolf", "fell"], ["fell", "down"]]. Can you help them select the correct function for the same?
|
Easy Recommendation System Selection | Solve |
You are tasked with building a recommendation system for a newly launched e-commerce website. Given that the website is new, there is not much user interaction data available. Also, the items in the catalog have rich descriptions. Based on these requirements, which type of recommendation system approach would be the most suitable for this task?
|
Easy Sensitivity and Specificity | Solve |
You have trained a supervised learning model to classify customer reviews as either "positive" or "negative" based on a dataset with 10,000 samples and 35 features, including the review text, reviewer's name, and rating. The dataset is split into a 7,000-sample training set and a 3,000-sample test set.
After training the model, you evaluate its performance using a confusion matrix on the test set, which shows the following results:
Based on the confusion matrix, what are the sensitivity and specificity of the model?
|
Medium ZeroDivisionError and IndexError | Solve |
What will the following Python code output?
|
Medium Session | Solve |
The function high_sess should compute the highest number of events per session of each user in the database by reading a comma-separated value input file of session data. The result should be returned from the function as a dictionary. The first column of each line in the input file is expected to contain the user’s name represented as a string. The second column is expected to contain an integer representing the events in a session. Here is an example input file:
Tony,10
Stark,12
Black,25
Your program should ignore a non-conforming line like this one.
Stark,3
Widow,6
Widow,14
The resulting return value for this file should be the following dictionary: { 'Stark':12, 'Black':25, 'Tony':10, 'Widow':14 }
What should replace the CODE TO FILL line to complete the function?
|
Medium Max Code | Solve |
Below are code lines to create a Python function. Ignoring indentation, what lines should be used and in what order for the following function to be complete:
|
Medium Recursive Function | Solve |
Consider the following Python code:
In the above code, recursive_search is a function that takes a dictionary (data) and a target key (target) as arguments. It searches for the target key within the dictionary, which could potentially have nested dictionaries and lists as values, and returns the value associated with the target key. If the target key is not found, it returns None.
nested_dict is a dictionary that contains multiple levels of nested dictionaries and lists. The recursive_search function is then called with nested_dict as the data and 'target_key' as the target.
What will the output be after executing the above code?
|
Medium Stacking problem | Solve |
What does the below function ‘fun’ does?
A: Sum of digits of the number passed to fun.
B: Number of digits of the number passed to fun.
C: 0 if the number passed to fun is divisible by 10. 1 otherwise.
D: Sum of all digits number passed to fun except for the last digit.
|
Medium Array Manipulation and Summation | Solve |
Consider the following code snippet:
What will be the value of G after executing the code?
|
Medium Matrix Eigenvalues and Diagonalization | Solve |
Consider the following code snippet:
After running this code, which of the following statements is true regarding the B matrix?
|