imports Flashcards
1
Q
sm
A
import statsmodels.api as sm
2
Q
scikit learn linear regression
A
from sklearn.linear_model import LinearRegression
3
Q
format numeric axis for plots
A
from matplotlib.ticker import PercentFormatter
4
Q
sklearn feature selection
A
from sklearn.feature_selection import f_regression
5
Q
sklearn scaler. code and what does it do?
A
from sklearn.preprocessing import StandardScaler # (subtract mean) / std
6
Q
sklearn split training and test
A
from sklearn.model_selection import train_test_split
7
Q
check for multicollinearity
A
from statsmodels.stats.outliers_influence import variance_inflation_factor
8
Q
fix for logistic regression from statsmodels
A
from scipy import stats
stats.chisqprob = lambda chisq, df: stats.chi2.sf(chisq, df)
9
Q
sklearn kmeans
A
from sklearn.cluster import KMeans