
























Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!

























A list can contain any Python type. But a list itself is also a Python type. That means that a list can also contain a list! Python is getting funkier by the minute, but fear not, just remember the list syntax: (Python List Assignment) my_list = [el1, el2, el3] Can you tell which ones of the following lines of Python code are valid ways to build a list? Please choose all correct answers. - correct answer ✅a. [[1, 2, 3], [4, 5, 7]] b. [1 + 2, "a" * 5, 3] c. [1, 3, 4, 2] **d. All of the above Assume, you are given two lists: a = [1,2,3,4,5] b = [6,7,8,9] The task is to create a list which has all the elements of a and b in one dimension. Output: a = [1,2,3,4,5,6,7,8,9] Which of the following options would you choose? (Python List) - correct answer ✅a. a.join(b) b. a "+" b c. a.append(b) **d. a.extend(b) You want to print the top 5 ids with highest income from this dataset (dataframe shows a partial view):
What should be the correct sequence of commands? (Data Manipulation with Pandas) - correct answer ✅a. df.sort_values(), df.head() b. df.head(), df.sort_values() **c. df.sort_values("Income"), df.head() d. df.sort_values("Age"), df.head() Filter all the rows where age is less than 40 in this dataset (Data Manipulation with Pandas). Choose all correct answers. - correct answer ✅a. df.filter('Age')< **b. df[df.age<40] c. df.sort_values("Age")< **d. df [df['Age']<40] Get the proportion of male and female entries in this dataset (Data Manipulation with Pandas). - correct answer ✅a. df["Gender"].numbers() **b. df ["Gender"].value_counts(normalize=True) c. df["Gender"].counts() d. df["Gender"].value_counts() Complete the following command to get the mean income of each gender from this dataset. (Data Manipulation with Pandas) Complete this command:
**b. df['Sold_Qty'].max() c. df['Sold_Qty'].min() d. df['Sold_Qty'].sum() Have a look at this line of code: (python basics) np.array([True, 1, 2]) + np.array([3, 4, False]) Can you tell which code chunk builds the exact same Python object? - correct answer ✅a. np.array([True, 1, 2, 3, 4, False]) b. np.array([0, 1, 2, 3, 4, 5]) c. np.array([1, 1, 2]) + np.array([3, 4, -1]) **d. np.array([4, 3, 0]) + np.array([0, 2, 2]) Assuming matplotlib.pyplot is imported as plt. Which of the following commands plots a histogram of the variable named X? (Intro to matplotlib) - correct answer ✅a. plt.plot.hist(X) **b. plt.hist(X) c. plt.histogram(X) d. plt.plot(X) How would you create a Figure with 6 Axes objects organized in 3 rows and 2 columns? (matplotlib grammar) - correct answer ✅a. fig, ax = plt.axes((2, 3)) b. fig, ax = plt.subplots[3, 2] c. fig, ax = plt.subplots((2, 3)) **d. fig, ax = plt.subplots(3, 2)
What is the correct way to calculate 2 to the power of 10? (python basics) - correct answer ✅a. 2^ b. 2pow c. 2%% d. 2 Which one is NOT like the others? (python basics) - correct answer ✅*a. dataframe b. boolean c. int d. str e. float Consider the below code and fill in the blanks
"living room", 20.0, "bedroom", 10.75, "bathroom", 9.50]
print(areas[___])
print(areas[___]) - correct answer ✅a .2, 10 b. 2, - c. 1, - **d. 1, 9
The marketing department of ACME Corporation needs to identify potential high- value customers for their new Kitchen Robot. These robots are expensive, so we are looking to identify customers that can afford such a machine. It's been determined that households with a net income greater than $50,000 USD are of interest in the marketing campaign, so you will choose a(n) ___________ algorithm to model these customers. - correct answer ✅**a. classification b. recommender system c. regression d. affinity analysis Reducing the number of predictors to the smallest set that will still provide accurate predictions is a concept called ____________________. - correct answer ✅a. regeneration **b. parsimony c. shrinkage d. Gillette's razor You have been given a dataset with 15 predictors and a binary outcome that denotes whether a customer has left the company (yes or no). As an absolute minimum, you'll need _____________ samples to achieve an minimally accurate prediction. - correct answer ✅a. 200 **b. 180 c. 190 d. 150 You have been given a dataset with 15 predictors and a numeric outcome that denotes the income that a household has obtained. As an absolute minimum, you'll
need _____________ samples to achieve an minimally accurate prediction. - correct answer ✅a. 300 b. 150 c. 200 d. 180 The process of identifying outliers is best performed by someone with domain knowledge as opposed to someone with statistical knowledge. - correct answer ✅True False If you impute a missing value with its column mean, then you will ___________________. - correct answer ✅a. maximize the variability of the dataset **b. understate the variability of the dataset c. overweight the variability of the dataset d. normalize the variability of the dataset Standardization uses the following formula: Using the rule-of-thumb method, one can assume that all extreme values (outliers) will be greater than ____________ or less than ____________. - correct answer ✅a. 0, 1 b. 1, 0 c. +1, -
c. underweight, overweight d. underweight, oversample You are given a dataset that has many duplicate entries, that is customers who appear multiple times in the data because of address changes, marriages, and mis- entries (boulevard instead of blvd., etc.) Because of this situation, you will choose a(n) __________ algorithm to clean up the dataset. - correct answer ✅a. adaptive filtering b. dimension reduction c. collaborative filtering d. data reduction When working with linear or logistic regression, categorical variables must have one subtype removed when one-hot encoding (dummy coding) or else the model will fail. - correct answer ✅a. True b. False When building a predictive model, the first five steps of the modeling process, in order are: - correct answer ✅Step 1 Determine the purpose Step 2 Obtain the data Step 3 Explore, clean, and preprocess the data Step 4 Reduce the data dimension Step 5 Determine the data mining task Because machine learning is automated, there is not any human bias or discrimination in the results. - correct answer ✅True
False An individual's behavior can be psychologically manipulated through the analysis of their Facebook data. - correct answer ✅True False Fake Facebook and _____________ accounts, most notably under Russian control, have helped create and spread divisive and destabilizing messaging in Western democracies with a goal of affecting election outcomes. - correct answer ✅a. Instagram b. Etsy **c. Twitter d. TikTok Citizens of the European Union, like citizens of the United States, can opt out of automated decision making algorithms. - correct answer ✅True **False The Competitive Intelligence department of the Acme Corporation has gathered every possible variable to model their chief competitors. In addition to the number of employees by department, the sales and profit numbers, product satisfaction, warranty returns, and product pricing, they also gathered data such as the brand of wristwatches worn by the chief executives and the softness of the bath tissue in the executive washroom. You suspect that many of these variables are unnecessary, so you choose a(n) ____________ technique for data preprocessing, which should improve ____________________. - correct answer ✅a. dimension reduction, bias-variance tradeoff
Here's a look at the first 10 observations of the West Roxbury Housing dataset. Choose the answer that best describes this display. - correct answer ✅a. There are three floating point, 10 integer, and one categorical variable. b. There are two floating point, 11 integer, and one categorical variable. c. At ~$350 dollars, these houses are cheap. d. There is one floating point, 12 integer, and one categorical variable. Referring to the first 10 rows of the Wext Roxbury Housing dataset, choose the answer that best describes this data. - correct answer ✅a. REMODEL is best encoded as an ordinal variable. b. REMODEL is best encoded as a categorical variable. c. REMODEL is best left out of the data. d. REMODEL is best encoded as an nominal variable. The pandas function 'pd.get_dummies(data_df, prefix_sep="_", drop_first=True)' automatically encodes ordinal and nominal categorical variables differently. - correct answer ✅a. True **b. False A cluster is always comprised of a group consisting of two or more members. - correct answer ✅a. True **b. False
The following formula for a cluster model denotes the _____________________ that is used to form clusters. - correct answer ✅a. average linkage formula b. ward linkage formula c. complete linkage formula **d. single linkage formula The following formula for a cluster model denotes the _____________________ that is used to form clusters. - correct answer ✅a. average linkage formula b. single linkage formula c. ward linkage formula d. complete linkage formula The following formula for a cluster model denotes the _____________________ that is used to form clusters. - correct answer ✅a. average linkage formula b. ward linkage formula c. complete linkage formula d. single linkage formula Agglomerative clustering begins with n clusters, and n = - correct answer ✅a. zero **b. the number of samples c. the number of variables d. one
Based on the following profile plot, the greatest distinction between clusters is found with _______________. - correct answer ✅a. Sales b. Fuel_Cost c. Nuclear d. Fixed_charge The primary means of grouping neighborhoods by lifestyle involves using _____________ to segment the demographics. - correct answer ✅a. GPS coordinates b. counties c. cities d. zip codes The following equation represents the _______________________. - correct answer ✅a. Euclidean distance formula b. Ward's distance method c. complete linkage formula d. average linkage formula In cluster analysis, we should standardize or normalize the variables if they are on different scales because variables with ____________ scales have ____________ influence on the model. - correct answer ✅a. larger, more b. smaller, more c. larger, less d. differential, distributed
The difference between Euclidean distance and Manhattan distance is that the latter uses ______________ values instead of _____________ differences - correct answer ✅**a. absolute, squared b. exponential, squared c. absolute, exponential d. squared, absolute If all of your variables are categorical, and all of those categorical variables are one-hot encoded (dummy coded), then ________________ measures are better to use than distance measures. - correct answer ✅a. normalization b. absolute value **c. similarity d. exponential In the picture below, the actual test error rate is in blue, LOOCV training model error is a black-dashed line, and 10-fold CV training model error is an orange line. Which of the following statements is correct? - correct answer ✅a. 10-fold CV has lower variance than LOOCV. b. 10-fold cross validation has higher variance than LOOCV. **c. Both LOOCV and 10-fold CV have overfit the model. d. Both LOOCV and 10-fold CV have underfit the model. Resampling is performed to _____________________. - correct answer ✅a. average the data across folds. **b. estimate the variability of a model fit.
**d. a single sample. The reason the following picture shows 10 different plots for mean squared error is because _____________. - correct answer ✅a. instability of 10-fold cross- validation b. 10 different polynomial values between training and validation c. 10 divisions of the data by sequential rows for training and validation d. 10 random divisions of the data between training and validation In many cases, 10-fold cross-validation reduces the variance and produces lower test error estimates than Leave-One-Out cross-validation because of _________________. - correct answer ✅a. lower correlation between folds. b. lower bias on the training data. c. better variance predictions. d. improved model fit. If our sole interest is in bias reduction, then we would always choose __________________. - correct answer ✅a. 10-fold cross validation. **b. leave-one-out cross validation. c. 5-fold cross validation. d. hold-out validation set approach. Which of the following is the most important assumption for linear regression? - correct answer ✅a. The normality of the outcome variable **b. The normality of the residuals
c. None of these d. The normality of the predictor variables Which of the options is correct with respect to RMSE and MAE? - correct answer ✅a. RMSE is preferable to MAE if the residuals have outliers b. RMSE can be negative or positive but MAE will always be positive c. Both RMSE and MAE can be either positive or negative d. MAE is preferable to RMSE if the residuals have outliers What does Y represent in the equation? - correct answer ✅a. The predicted value for outcome variable b. The actual values of the outcome variable c. The difference between the actual values of the outcome variable and the predicted value for outcome variable d. None of these What do x1, x2, x3, ... , xp represent? - correct answer ✅a. They are the predictor variables b. They represent the relationship between the predictor and the predicted variables c. None of these d. They are the predicted variables What do β1, β2, β3, ... , βp represent? - correct answer ✅a. None of these b. They are the predicted variables