mlxtend version: 0.23.1

category_scatter

category_scatter(x, y, label_col, data, markers='sxo^v', colors=('blue', 'green', 'red', 'purple', 'gray', 'cyan'), alpha=0.7, markersize=20.0, legend_loc='best')

散点图,以不同颜色/标记样式绘制类别.

Parameters

Returns

Examples

有关使用示例,请参见 https://rasbt.github.io/mlxtend/user_guide/plotting/category_scatter/

checkerboard_plot

checkerboard_plot(ary, cell_colors=('white', 'black'), font_colors=('black', 'white'), fmt='%.1f', figsize=None, row_labels=None, col_labels=None, fontsize=None)

通过matplotlib绘制棋盘表格/热图.

Parameters

Returns

Examples

有关使用示例,请参见 https://rasbt.github.io/mlxtend/user_guide/plotting/checkerboard_plot/

ecdf

ecdf(x, y_label='ECDF', x_label=None, ax=None, percentile=None, ecdf_color=None, ecdf_marker='o', percentile_color='black', percentile_linestyle='--')

绘制经验累积分布函数

Parameters

Returns

Examples

有关使用示例,请参见 https://rasbt.github.io/mlxtend/user_guide/plotting/ecdf/

enrichment_plot

enrichment_plot(df, colors='bgrkcy', markers=' ', linestyles='-', alpha=0.5, lw=2, where='post', grid=True, count_label='Count', xlim='auto', ylim='auto', invert_axes=False, legend_loc='best', ax=None)

绘制堆积条形图

Parameters

Returns

Examples

有关使用示例,请参见 https://rasbt.github.io/mlxtend/user_guide/plotting/enrichment_plot/

heatmap

heatmap(matrix, hide_spines=False, hide_ticks=False, figsize=None, cmap=None, colorbar=True, row_names=None, column_names=None, column_name_rotation=45, cell_values=True, cell_fmt='.2f', cell_font_size=None, text_color_threshold=None)

绘制热力图通过matplotlib.

Parameters

Returns

Examples

有关使用示例,请参见 https://rasbt.github.io/mlxtend/user_guide/plotting/heatmap/

plot_confusion_matrix

plot_confusion_matrix(conf_mat, hide_spines=False, hide_ticks=False, figsize=None, cmap=None, colorbar=False, show_absolute=True, show_normed=False, norm_colormap=None, class_names=None, figure=None, axis=None, fontcolor_threshold=0.5)

通过matplotlib绘制混淆矩阵.

Parameters

Returns

Examples

有关使用示例,请参见 https://rasbt.github.io/mlxtend/user_guide/plotting/plot_confusion_matrix/

plot_decision_regions

plot_decision_regions(X, y, clf, feature_index=None, filler_feature_values=None, filler_feature_ranges=None, ax=None, X_highlight=None, zoom_factor=1.0, legend=1, hide_spines=True, markers='s^oxv<>', colors='#1f77b4,#ff7f0e,#3ca02c,#d62728,#9467bd,#8c564b,#e377c2,#7f7f7f,#bcbd22,#17becf', scatter_kwargs=None, contourf_kwargs=None, contour_kwargs=None, scatter_highlight_kwargs=None, n_jobs=None)

绘制分类器的决策区域.

请注意,此函数假设类别标签是连续标记的,例如 0, 1, 2, 3, 4 和 5.如果您有整数标签 > 4 的类别标签,您可能需要提供额外的颜色和/或标记作为 `colors` 和 `markers` 参数.
有关更多信息,请参见 https://matplotlib.org/examples/color/named_colors.html.

Parameters

Returns

Examples

有关使用示例,请参见 https://rasbt.github.io/mlxtend/user_guide/plotting/plot_decision_regions/

plot_learning_curves

plot_learning_curves(X_train, y_train, X_test, y_test, clf, train_marker='o', test_marker='^', scoring='misclassification error', suppress_plot=False, print_model=True, title_fontsize=12, style='default', legend_loc='best')

绘制分类器的学习曲线.

Parameters

Returns

Examples

有关使用示例,请参见 https://rasbt.github.io/mlxtend/user_guide/plotting/plot_learning_curves/

plot_linear_regression

plot_linear_regression(X, y, model=LinearRegression(), corr_func='pearsonr', scattercolor='blue', fit_style='k--', legend=True, xlim='auto')

绘制线性回归拟合线.

Parameters

Returns

Examples

有关使用示例,请参见 https://rasbt.github.io/mlxtend/user_guide/plotting/plot_linear_regression/

plot_pca_correlation_graph

plot_pca_correlation_graph(X, variables_names, dimensions=(1, 2), figure_axis_size=6, X_pca=None, explained_variance=None)

计算X的主成分分析并绘制相关图

Parameters

Returns

matplotlib_figure, correlation_matrix

Examples

有关使用示例,请参见 https://rasbt.github.io/mlxtend/user_guide/plotting/plot_pca_correlation_graph/

plot_sequential_feature_selection

plot_sequential_feature_selection(metric_dict, figsize=None, kind='std_dev', color='blue', bcolor='steelblue', marker='o', alpha=0.2, ylabel='Performance', confidence_interval=0.95)

绘制特征选择结果.

Parameters

Returns

Examples

有关使用示例,请参见 https://rasbt.github.io/mlxtend/user_guide/plotting/plot_sequential_feature_selection/

remove_borders

remove_borders(axes, left=False, bottom=False, right=True, top=True)

去除matplotlib图表中的杂乱元素.

Parameters

Examples

有关使用示例,请参见 https://rasbt.github.io/mlxtend/user_guide/plotting/remove_chartjunk/

scatter_hist

scatter_hist(x, y, xlabel=None, ylabel=None, figsize=(5, 5))

散点图及沿轴的单个特征直方图.

Parameters

Returns

scatterplotmatrix

scatterplotmatrix(X, fig_axes=None, names=None, figsize=(8, 8), alpha=1.0, kwargs)

散点图矩阵的下三角部分

Parameters

Returns

Examples

更多使用示例,请参见 https://rasbt.github.io/mlxtend/user_guide/plotting/scatterplotmatrix/

stacked_barplot

stacked_barplot(df, bar_width='auto', colors='bgrcky', labels='index', rotation=90, legend_loc='best')

绘制堆积条形图的函数

Parameters

Returns

Examples

有关使用示例,请参见 https://rasbt.github.io/mlxtend/user_guide/plotting/stacked_barplot/