Back to marketplace

Supervised Learning

No description yet. This curated deck is ready for daily study.

Total cards: 24•Content version: v4•Public deck•Updated: 8/1/2026

Card preview (24)

#1
Front (Question)

What is Reinforcement Learning?

Back (Answer)

Software agent optimizes its behaviour based on rewards and punishments.

#2
Front (Question)

How to do VEDA for 2 categorical variables?

Back (Answer)

Using sns.barplot(x=”day”, y=”total_bill”, data=tips) where data is a df. OR tips.boxplot(‘day’, ‘total_bill’)

#3
Front (Question)

How to do VEDA for binary categorical variables?

Back (Answer)

plt. figure() sns. countplot(x=’education’, hue=’party’, data=df, palette=’RdBu’) plt. xticks([0,1], [‘No’, ‘Yes’]) plt. show()

#4
Front (Question)

How to do pair-wise VEDA for 4 quantitative variables?

Back (Answer)

pd.scatter_matrix(df, c = y, figsize = [8, 8], marker = ‘D’)

#5
Front (Question)

What is accuracy?

Back (Answer)

Fraction of correct predictions.

#6
Front (Question)

How to access predictor values after removing target values from df?

Back (Answer)

df.drop(‘target’, axis=1).values

#7
Front (Question)

How to turn list of values into format for sklearn?

Back (Answer)

X.reshape(-1,1)

#8
Front (Question)

How to generate pairwise feature correlation VEDA?

Back (Answer)

sns.heatmap(df.corr(), square=True, cmap=’RdYlGn’)

#9
Front (Question)

What are a and b in y = ax +b ?

Back (Answer)

a is slope and b is y intercept

#10
Front (Question)

How to do k-fold cv with sklearn?

Back (Answer)

cross_val_score(reg, X, y, cv=k)

#11
Front (Question)

Why should regularization be used?

Back (Answer)

To penalize large coefficients and avoid over-fitting

#12
Front (Question)

What is Ridge regression?

Back (Answer)

regression with regularization where alpha (hyper)-parameter weighs the OLS. Should be first choice for regression over lasso.

#13
Front (Question)

What is Lasso regression?

Back (Answer)

regression with regularization where coefs can be set to 0 to remove unimportant features. Great for feature selection.

#14
Front (Question)

How to specify parameters for Lasso and access its coefficients?

Back (Answer)

lasso = Lasso(alpha=0.4, normalize=True) lasso.coef_

#15
Front (Question)

When is accuracy a poor metric when only fraction of correct predictions is used?

Back (Answer)

When there is class imbalance where low freq items will never be correctly labeled. if maj class is 99%, then accuracy of 99% can be achieved with model that always picks maj class.

#16
Front (Question)

How to calculate accuracy using confusion matrix?

Back (Answer)

(TP+TN)/(TP+TN+FN+FP)

#17
Front (Question)

How to calculate precision using conf matrix?

Back (Answer)

TP/TP+FP

#18
Front (Question)

How to calculate recall using conf matrix?

Back (Answer)

TP/TP+FN

#19
Front (Question)

What is F1?

Back (Answer)

(2(precision*recall))/(precision+recall)

#20
Front (Question)

How to get classifier’s performance report using SKL?

Back (Answer)

sklearn.metrics.classification_report

#21
Front (Question)

What is the ROC curve?

Back (Answer)

The receiver operating characteristic curve is a graphical plot that illustrates the diagnostic ability of a binary classifier system as its discrimination threshold is varied.

#22
Front (Question)

What is a better than random AUC?

Back (Answer)

If the AUC is greater than 0.5, the model is better than random guessing.

#23
Front (Question)

How to use AUC during cross-validation?

Back (Answer)

cross_val_score(logreg, X, y, cv=5, scoring=’roc_auc’)

#24
Front (Question)

What are hyperparameters?

Back (Answer)

Parameters that cannot be learnt by fitting the model. Like k or alpha.