# correlation from scipy.stats import pearsonr # pearson from scipy.stats import spearmanr # spearman from scipy.stats import kendalltau # kendall
# independent test from scipy.stats import chi2_contingency
# t-test from scipy.stats import ttest_1samp from scipy.stats import ttest_rel from scipy.stats import ttest_ind
# variance from scipy.stats import bartlett from scipy.stats import levene from scipy.stats import f.cdf # F-test(cumulative distrubution function of F distribution)
# ANOVA from scipy.stats import f_oneway from statsmodels.formula.api import ols from statsmodels.stats.anova import anova_lm from statsmodels.stats.multicomp import pairwise_tukeyhsd # post-process of ANOVA
머신러닝
데이터 분할
1
from sklearn.model_selection import train_test_split
모델링
1 2 3 4 5 6 7 8 9 10 11
from sklearn.neighbors import KNeighborsClassifier # k-NN from sklearn.neighbors import KNeighborsRegressor # k-NN from sklearn.cluster import AgglomerativeClustering # 계층적 준집 분석 from sklearn.cluster import KMeans # K-means from statsmodels.formula.api import ols # 선형회귀 from sklearn.linear_model import LinearRegression # 선형회귀 from statsmodels.api import Logit # 로지스틱 회귀 from sklearn.linear_model import LogisticRegression # 로지스틱 회귀 from sklearn.tree import DecisionTreeClassifier # Decision Tree from sklearn.tree import DecisionTreeRegressor # Decision Tree from sklearn.naive_bayes import GaussianNB # Naive Bayes
평가 - 회귀
1 2 3 4
from sklearn.metrics import mean_absolute_error # MAE from sklearn.metrics import mean_absolute_percentage_error # MAPE from sklearn.metrics import mean_squared_error # MSE mean_squared_error() ** 0.5## RMSE
평가 - 분류
1 2 3 4 5 6
from sklearn.metrics import roc_auc_score # AUC
from sklearn.metrics import accuracy_score from sklearn.metrics import precision_score from sklearn.metrics import recall_score from sklearn.metrics import f1_score