Dython
Dython是一款数据建模库
- 依赖
numpy、pandas、seaborn、scipy、matplotlib、sklearn、scikit-plot - 包含的子模块:
data_utils:基础的数据探索性分析nominal:特征相关性度量model_utils:机器学习性能评估工具sampling:数据采样
安装:
1 | pip install dython |
1 | ## 载入数据集,用于示例 |
data_utils
identify_columns_with_na()
identify_columns_with_na():数据集的缺失情况,输出每列的数据缺失个数
1 | ## 将部分值替换为“缺失值nan” |
identify_columns_by_type()
identify_columns_by_type():按列的类型查找列
split_hist()
split_hist():快速绘制分组直方图
nominal
associations()
计算数据集中变量的相关系数。
- 相关系数包括:
PearsonCramer's VTheil's U- 条件熵
- 参数
nom_nom_assoc='cramer':名义变量之间的相关系数计算方法,默认为cramer - 参数
num_num_assoc='pearson':数值变量之间的相关系数计算方法,默认为Pearson相关系数
1 | from dython.nominal import associations |
cluster_correlations()
绘制基于层次聚类的相关系数矩阵图(热力图)
model_utils
ks_abc()
metric_graph()
- 参数
metric:roc:绘制ROC曲线