A p-value measures how compatible the observed data are with the null hypothesis. It is not the probability that either hypothesis is true, and it is not an effect size.
ข้อ 2
Which distribution is symmetric and bell-shaped?
The normal distribution is symmetric and bell-shaped. Exponential and Poisson distributions are right-skewed, and a uniform distribution is flat.
ข้อ 3
What does standard deviation measure?
Standard deviation quantifies how much values vary around the mean. The center is measured by the mean or median, the mode is the most frequent value, and quartiles describe distribution shape.
ข้อ 4
Which test compares the means of two independent groups?
A two-sample t-test compares means of two independent groups. A paired t-test compares related measurements, ANOVA compares three or more groups, and chi-square tests categorical associations.
ข้อ 5
What does correlation measure?
Correlation quantifies the strength and direction of a linear relationship between two variables. It does not prove causation, measure mean differences, or describe variance alone.
ข้อ 6
Which correlation value indicates no linear relationship?
A correlation of 0 means no linear relationship. Values near 1 indicate a strong positive relationship, and values near -1 indicate a strong negative relationship.
ข้อ 7
What is a confidence interval?
A confidence interval estimates a range for a population parameter with a confidence level such as 95%. It is not a sample range, effect size, or single prediction.
ข้อ 8
Which measure of central tendency is most robust to outliers?
The median is less affected by extreme values than the mean. The mode is the most frequent value, and the range is a spread measure, not central tendency.
ข้อ 9
What does P(A|B) represent?
P(A|B) is the conditional probability of A occurring when B is known to have occurred. It is not the joint, union, or reverse conditional probability.
ข้อ 10
What is Bayes theorem used for?
Bayes theorem calculates a posterior probability by combining a prior with evidence. It is not for means, correlation, or dimensionality reduction.
ข้อ 11
Which distribution models the count of events in a fixed interval?
The Poisson distribution models the number of events in a fixed interval when events occur independently. Binomial models counts of successes in trials, and normal and uniform are continuous.
ข้อ 12
What is a type I error?
A type I error is rejecting the null hypothesis when it is actually true, also called a false positive. Failing to reject a false null is a type II error.
ข้อ 13
Which pandas function reads a CSV file?
pd.read_csv() reads a CSV file into a DataFrame. The other method names do not exist in pandas.
ข้อ 14
Which method returns the first rows of a DataFrame?
.head() returns the first rows, defaulting to five. .tail() returns the last rows; the other names are not pandas methods.
ข้อ 15
Which pandas method removes rows with missing values?
.dropna() removes missing values, while .fillna() fills them with a value. .isna() identifies missing values, and .replace() swaps values.
ข้อ 16
Which pandas method fills missing values with a chosen value?
.fillna() replaces missing values with a specified value or method. .dropna() removes them, .notna() checks for present values, and .rename() changes labels.
ข้อ 17
Which pandas operation groups rows and applies an aggregation?
.groupby() splits data into groups and lets you aggregate with methods such as sum, mean, or count. .merge() combines tables, .pivot() reshapes, and .sort_values() sorts.
ข้อ 18
Which method combines two DataFrames by columns?
.merge() joins DataFrames on keys, similar to SQL joins. .concat() stacks them, .append() is deprecated for rows, and .stack() reshapes columns.
ข้อ 19
What does .value_counts() do?
.value_counts() returns counts for each unique value in a Series. Sorting, filling missing values, and means are separate operations.
ข้อ 20
Which method applies a function to each element in a Series?
.apply() applies a function to each element or row. .sum() aggregates, .describe() gives summary statistics, and .dtypes shows data types.
ข้อ 21
What is a pandas DataFrame?
A DataFrame is a two-dimensional labeled data structure with rows and columns. A Series is one-dimensional, and a database or plot is a different concept.
ข้อ 22
Which pandas method computes summary statistics?
.describe() computes statistics such as count, mean, standard deviation, min, and quartiles. .head() shows rows, .shape gives dimensions, and .columns lists column labels.
ข้อ 23
Which Python library provides multidimensional arrays?
NumPy provides ndarray objects for numerical computation. Requests handles HTTP, Flask builds web apps, and Selenium automates browsers.
ข้อ 24
Which Python library is commonly used for plotting?
Matplotlib is a core plotting library, often paired with Seaborn for statistical graphics. Pandas handles data, SciPy provides scientific functions, and scikit-learn provides machine learning models.
ข้อ 25
Which SQL clause filters rows?
WHERE filters individual rows before grouping. HAVING filters groups, GROUP BY creates groups, and ORDER BY sorts results.
ข้อ 26
Which SQL clause groups rows?
GROUP BY groups rows by one or more columns so aggregates can be computed. WHERE filters rows, HAVING filters groups, and LIMIT restricts rows.
ข้อ 27
Which SQL clause filters groups after aggregation?
HAVING filters grouped results after aggregation, while WHERE filters rows before grouping. GROUP BY creates groups, and JOIN combines tables.
ข้อ 28
Which join returns all rows from the left table and matching rows from the right?
LEFT JOIN keeps all left rows and fills unmatched right values with null. INNER JOIN keeps only matches, RIGHT JOIN keeps all right rows, and FULL OUTER JOIN keeps all rows from both.
ข้อ 29
Which SQL function counts rows?
COUNT() counts rows or non-null values. SUM() adds numeric values, AVG() computes the average, and MAX() returns the largest value.
ข้อ 30
Which SQL function computes the average?
AVG() returns the mean of a numeric column. COUNT() counts rows, SUM() totals values, and DISTINCT is a keyword, not an aggregate function.
ข้อ 31
Which keyword removes duplicate values from a query result?
SELECT DISTINCT returns unique combinations. UNIQUE is not a standard query keyword in most SQL dialects, and FILTER or ONLY are not used this way.
ข้อ 32
Which SQL clause sorts results?
ORDER BY sorts rows by one or more columns in ascending or descending order. GROUP BY groups rows, WHERE filters, and LIMIT restricts the number of rows.
ข้อ 33
Which SQL keyword limits the number of returned rows in many dialects?
LIMIT restricts the number of rows in PostgreSQL, MySQL, and SQLite. TOP is used in SQL Server, OFFSET skips rows, and COUNT aggregates.
ข้อ 34
Which SQL operator matches string patterns?
LIKE matches patterns with wildcards such as % and _. Equality, IN, and BETWEEN test exact or range values, not patterns.
ข้อ 35
What is a primary key?
A primary key uniquely identifies each row and cannot contain null values. A foreign key references another table, and indexes improve performance.
ข้อ 36
Which join returns only rows with matches in both tables?
INNER JOIN returns only rows where the join condition matches in both tables. LEFT and RIGHT joins include unmatched rows from one side, and FULL OUTER JOIN includes all rows.
ข้อ 37
What is supervised learning?
Supervised learning trains on labeled examples to predict target outcomes. Clustering is unsupervised, dimensionality reduction transforms features, and generation creates new data.
ข้อ 38
Which task predicts categorical labels?
Classification predicts discrete labels, while regression predicts continuous values. Clustering finds groups and dimensionality reduction compresses features.
ข้อ 39
Which task predicts continuous values?
Regression predicts numeric outcomes such as price or temperature. Classification predicts categories, clustering groups data, and association finds rules.
ข้อ 40
Which algorithm is commonly used for binary classification?
Logistic regression models the probability of a binary outcome. K-means clusters, Apriori finds associations, and PCA reduces dimensions.
ข้อ 41
What is overfitting?
Overfitting happens when a model captures noise in training data and performs poorly on new data. Underfitting is when a model is too simple.
ข้อ 42
Which technique helps reduce overfitting in decision trees?
Limiting depth, pruning, and regularization reduce overfitting. Increasing depth and adding features usually make overfitting worse.
ข้อ 43
What is cross-validation?
Cross-validation splits data into folds and evaluates the model across folds for a more stable estimate. Training once on all data leaves no independent evaluation.
ข้อ 44
What is precision?
Precision is TP / (TP + FP), the share of positive predictions that are correct. Recall is TP / (TP + FN), the share of actual positives found.
ข้อ 45
What is recall?
Recall is TP / (TP + FN), measuring how many actual positives were captured. Precision is TP / (TP + FP), and F1 combines precision and recall.
ข้อ 46
What is the F1 score?
F1 is the harmonic mean of precision and recall, balancing both. Accuracy and error are separate measures, and F1 is not a sum or ratio of negatives.
ข้อ 47
Which metric is often preferred for imbalanced classification?
F1 is useful for imbalanced data because accuracy can be misleading when one class dominates. MSE and R-squared are for regression.
ข้อ 48
What is feature engineering?
Feature engineering creates, transforms, or selects features so models learn better patterns. It is separate from sample size and hyperparameter tuning.
ข้อ 49
Which algorithm is commonly used for clustering?
K-means partitions data into clusters based on distance. Linear and logistic regression are supervised, and decision trees can be used for classification or regression.
ข้อ 50
What is A/B testing?
A/B testing randomly assigns users to versions and measures the effect of a change. It is not model evaluation, data splitting, or database comparison.
ข้อ 51
What is a metric?
A metric is a quantifiable measure such as conversion rate or retention. It is not a column, model, or test, although models are evaluated with metrics.
ข้อ 52
What is a conversion rate?
Conversion rate is the share of visitors who complete a desired action, such as purchase or sign-up. The other formulas describe different metrics.
ข้อ 53
What is retention?
Retention measures how many users come back after a defined period. New users, cancellations, and session length are separate metrics.
ข้อ 54
What is churn?
Churn is the loss of customers or users over time. Referrals, purchases, and email opens are different behaviors.
ข้อ 55
What is cohort analysis?
Cohort analysis follows groups, such as users acquired in the same month, to compare behavior over time. It is not A/B testing, algorithm testing, or a simple mean.
ข้อ 56
What is a null hypothesis?
The null hypothesis states there is no effect or difference, and experiments test whether evidence supports rejecting it. The alternative hypothesis claims an effect exists.
ข้อ 57
Which of the following are Python data analysis libraries? Select all that apply.
NumPy, pandas, and Matplotlib are used for data analysis and visualization. Flask is a web framework, not a data analysis library.
ข้อ 58
Which of the following are SQL aggregate functions? Select all that apply.
COUNT, AVG, and SUM are aggregate functions. DISTINCT is a keyword used with SELECT, not an aggregate function.
ข้อ 59
A p-value below 0.05 always proves the alternative hypothesis.
A low p-value provides evidence against the null hypothesis, but it does not prove the alternative hypothesis. Results depend on study design, assumptions, and effect size.
ข้อ 60
Match each machine learning metric to its definition.
Precision is TP / predicted positives, recall is TP / actual positives, F1 balances precision and recall, and accuracy is correct predictions divided by total predictions.