{"id":1071438,"date":"2025-01-08T11:07:19","date_gmt":"2025-01-08T03:07:19","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1071438.html"},"modified":"2025-01-08T11:07:21","modified_gmt":"2025-01-08T03:07:21","slug":"%e7%94%a8python%e5%a6%82%e4%bd%95%e5%81%9a%e9%80%90%e6%ad%a5%e5%9b%9e%e5%bd%92-2","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1071438.html","title":{"rendered":"\u7528python\u5982\u4f55\u505a\u9010\u6b65\u56de\u5f52"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25101945\/604edb64-b137-493b-b31f-8c0b0832b785.webp\" alt=\"\u7528python\u5982\u4f55\u505a\u9010\u6b65\u56de\u5f52\" \/><\/p>\n<p><p> \u9010\u6b65\u56de\u5f52\u662f\u4e00\u79cd\u7edf\u8ba1\u65b9\u6cd5\uff0c\u7528\u4e8e\u9009\u62e9\u6700\u6709\u610f\u4e49\u7684\u53d8\u91cf\u8fdb\u884c\u56de\u5f52\u6a21\u578b\u7684\u6784\u5efa\u3002\u5176\u4e3b\u8981\u76ee\u7684\u662f\u901a\u8fc7\u9010\u6b65\u589e\u52a0\u6216\u51cf\u5c11\u53d8\u91cf\uff0c\u627e\u5230\u6700\u4f18\u7684\u6a21\u578b\u3002\u5728Python\u4e2d\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528<code>statsmodels<\/code>\u5e93\u6765\u5b9e\u73b0\u9010\u6b65\u56de\u5f52\u3002\u4ee5\u4e0b\u662f\u5982\u4f55\u7528Python\u8fdb\u884c\u9010\u6b65\u56de\u5f52\u7684\u6b65\u9aa4\u548c\u8be6\u7ec6\u89e3\u91ca\u3002<\/p>\n<\/p>\n<p><p><strong>\u9010\u6b65\u56de\u5f52\u5b9e\u73b0\u7684\u6838\u5fc3\u6b65\u9aa4\u5305\u62ec\uff1a\u9009\u62e9\u521d\u59cb\u6a21\u578b\u3001\u5411\u524d\u9009\u62e9\u53d8\u91cf\u3001\u5411\u540e\u6d88\u9664\u53d8\u91cf\u3001\u6700\u7ec8\u6a21\u578b\u9009\u62e9<\/strong>\u3002<\/p>\n<\/p>\n<p><h3>\u4e00\u3001\u9009\u62e9\u521d\u59cb\u6a21\u578b<\/h3>\n<\/p>\n<p><p>\u5728\u9010\u6b65\u56de\u5f52\u4e2d\uff0c\u9996\u5148\u9700\u8981\u9009\u62e9\u4e00\u4e2a\u521d\u59cb\u6a21\u578b\u3002\u521d\u59cb\u6a21\u578b\u53ef\u4ee5\u662f\u4e00\u4e2a\u7a7a\u6a21\u578b\uff08\u6ca1\u6709\u72ec\u7acb\u53d8\u91cf\uff09\uff0c\u4e5f\u53ef\u4ee5\u662f\u5305\u542b\u6240\u6709\u72ec\u7acb\u53d8\u91cf\u7684\u6a21\u578b\u3002\u4e00\u822c\u6765\u8bf4\uff0c\u9010\u6b65\u56de\u5f52\u6709\u4e09\u79cd\u7b56\u7565\uff1a\u5411\u524d\u9009\u62e9\uff08Forward Selection\uff09\u3001\u5411\u540e\u6d88\u9664\uff08Backward Elimination\uff09\u548c\u9010\u6b65\u56de\u5f52\uff08Stepwise Regression\uff09\u3002<\/p>\n<\/p>\n<p><h4>\u5411\u524d\u9009\u62e9<\/h4>\n<\/p>\n<p><p>\u5411\u524d\u9009\u62e9\u4ece\u4e00\u4e2a\u7a7a\u6a21\u578b\u5f00\u59cb\uff0c\u9010\u6b65\u6dfb\u52a0\u53d8\u91cf\uff0c\u6bcf\u6b21\u6dfb\u52a0\u4e00\u4e2a\u53d8\u91cf\uff0c\u4f7f\u6a21\u578b\u7684\u89e3\u91ca\u80fd\u529b\u6700\u5f3a\u3002\u6dfb\u52a0\u53d8\u91cf\u7684\u6807\u51c6\u901a\u5e38\u662f\u57fa\u4e8e<a href=\"https:\/\/docs.pingcode.com\/blog\/59162.html\" target=\"_blank\">AI<\/a>C\uff08Akaike\u4fe1\u606f\u51c6\u5219\uff09\u6216BIC\uff08\u8d1d\u53f6\u65af\u4fe1\u606f\u51c6\u5219\uff09\u3002<\/p>\n<\/p>\n<p><h4>\u5411\u540e\u6d88\u9664<\/h4>\n<\/p>\n<p><p>\u5411\u540e\u6d88\u9664\u4ece\u5305\u542b\u6240\u6709\u53d8\u91cf\u7684\u6a21\u578b\u5f00\u59cb\uff0c\u9010\u6b65\u5220\u9664\u53d8\u91cf\uff0c\u6bcf\u6b21\u5220\u9664\u4e00\u4e2a\u53d8\u91cf\uff0c\u4f7f\u6a21\u578b\u7684\u89e3\u91ca\u80fd\u529b\u6700\u5f3a\u3002\u5220\u9664\u53d8\u91cf\u7684\u6807\u51c6\u540c\u6837\u662f\u57fa\u4e8eAIC\u6216BIC\u3002<\/p>\n<\/p>\n<p><h4>\u9010\u6b65\u56de\u5f52<\/h4>\n<\/p>\n<p><p>\u9010\u6b65\u56de\u5f52\u7ed3\u5408\u4e86\u5411\u524d\u9009\u62e9\u548c\u5411\u540e\u6d88\u9664\u7684\u65b9\u6cd5\u3002\u5728\u6bcf\u4e00\u6b65\u4e2d\uff0c\u5148\u5c1d\u8bd5\u5411\u6a21\u578b\u4e2d\u6dfb\u52a0\u4e00\u4e2a\u53d8\u91cf\uff0c\u7136\u540e\u5c1d\u8bd5\u4ece\u6a21\u578b\u4e2d\u5220\u9664\u4e00\u4e2a\u53d8\u91cf\uff0c\u76f4\u5230\u6a21\u578b\u8fbe\u5230\u6700\u4f18\u3002<\/p>\n<\/p>\n<p><h3>\u4e8c\u3001\u5411\u524d\u9009\u62e9\u53d8\u91cf<\/h3>\n<\/p>\n<p><p>\u5728\u5411\u524d\u9009\u62e9\u4e2d\uff0c\u6211\u4eec\u4ece\u4e00\u4e2a\u7a7a\u6a21\u578b\u5f00\u59cb\uff0c\u9010\u6b65\u6dfb\u52a0\u53d8\u91cf\u3002\u6bcf\u6b21\u6dfb\u52a0\u4e00\u4e2a\u53d8\u91cf\uff0c\u4f7f\u5f97\u6a21\u578b\u7684AIC\u6216BIC\u503c\u6700\u5c0f\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import statsmodels.api as sm<\/p>\n<p>import pandas as pd<\/p>\n<p>import numpy as np<\/p>\n<p>from sklearn.datasets import load_boston<\/p>\n<h2><strong>\u52a0\u8f7d\u6570\u636e<\/strong><\/h2>\n<p>boston = load_boston()<\/p>\n<p>X = pd.DataFrame(boston.data, columns=boston.feature_names)<\/p>\n<p>y = boston.target<\/p>\n<h2><strong>\u5411\u524d\u9009\u62e9<\/strong><\/h2>\n<p>def forward_selection(X, y, significance_level=0.05):<\/p>\n<p>    initial_features = X.columns.tolist()<\/p>\n<p>    best_features = []<\/p>\n<p>    while len(initial_features) &gt; 0:<\/p>\n<p>        remaining_features = list(set(initial_features) - set(best_features))<\/p>\n<p>        new_pval = pd.Series(index=remaining_features)<\/p>\n<p>        for new_column in remaining_features:<\/p>\n<p>            model = sm.OLS(y, sm.add_constant(X[best_features + [new_column]])).fit()<\/p>\n<p>            new_pval[new_column] = model.pvalues[new_column]<\/p>\n<p>        min_p_value = new_pval.min()<\/p>\n<p>        if min_p_value &lt; significance_level:<\/p>\n<p>            best_features.append(new_pval.idxmin())<\/p>\n<p>        else:<\/p>\n<p>            break<\/p>\n<p>    return best_features<\/p>\n<p>selected_features = forward_selection(X, y)<\/p>\n<p>print(selected_features)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e09\u3001\u5411\u540e\u6d88\u9664\u53d8\u91cf<\/h3>\n<\/p>\n<p><p>\u5728\u5411\u540e\u6d88\u9664\u4e2d\uff0c\u6211\u4eec\u4ece\u5305\u542b\u6240\u6709\u53d8\u91cf\u7684\u6a21\u578b\u5f00\u59cb\uff0c\u9010\u6b65\u5220\u9664\u53d8\u91cf\u3002\u6bcf\u6b21\u5220\u9664\u4e00\u4e2a\u53d8\u91cf\uff0c\u4f7f\u5f97\u6a21\u578b\u7684AIC\u6216BIC\u503c\u6700\u5c0f\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u5411\u540e\u6d88\u9664<\/p>\n<p>def backward_elimination(X, y, significance_level=0.05):<\/p>\n<p>    features = X.columns.tolist()<\/p>\n<p>    while len(features) &gt; 0:<\/p>\n<p>        model = sm.OLS(y, sm.add_constant(X[features])).fit()<\/p>\n<p>        max_p_value = model.pvalues.max()<\/p>\n<p>        if max_p_value &gt;= significance_level:<\/p>\n<p>            excluded_feature = model.pvalues.idxmax()<\/p>\n<p>            features.remove(excluded_feature)<\/p>\n<p>        else:<\/p>\n<p>            break<\/p>\n<p>    return features<\/p>\n<p>selected_features = backward_elimination(X, y)<\/p>\n<p>print(selected_features)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u56db\u3001\u9010\u6b65\u56de\u5f52<\/h3>\n<\/p>\n<p><p>\u9010\u6b65\u56de\u5f52\u7ed3\u5408\u4e86\u5411\u524d\u9009\u62e9\u548c\u5411\u540e\u6d88\u9664\u7684\u65b9\u6cd5\u3002\u5728\u6bcf\u4e00\u6b65\u4e2d\uff0c\u5148\u5c1d\u8bd5\u5411\u6a21\u578b\u4e2d\u6dfb\u52a0\u4e00\u4e2a\u53d8\u91cf\uff0c\u7136\u540e\u5c1d\u8bd5\u4ece\u6a21\u578b\u4e2d\u5220\u9664\u4e00\u4e2a\u53d8\u91cf\uff0c\u76f4\u5230\u6a21\u578b\u8fbe\u5230\u6700\u4f18\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u9010\u6b65\u56de\u5f52<\/p>\n<p>def stepwise_selection(X, y, initial_list=[], threshold_in=0.01, threshold_out=0.05):<\/p>\n<p>    included = list(initial_list)<\/p>\n<p>    while True:<\/p>\n<p>        changed=False<\/p>\n<p>        # forward step<\/p>\n<p>        excluded = list(set(X.columns) - set(included))<\/p>\n<p>        new_pval = pd.Series(index=excluded)<\/p>\n<p>        for new_column in excluded:<\/p>\n<p>            model = sm.OLS(y, sm.add_constant(X[included + [new_column]])).fit()<\/p>\n<p>            new_pval[new_column] = model.pvalues[new_column]<\/p>\n<p>        best_pval = new_pval.min()<\/p>\n<p>        if best_pval &lt; threshold_in:<\/p>\n<p>            best_feature = new_pval.idxmin()<\/p>\n<p>            included.append(best_feature)<\/p>\n<p>            changed=True<\/p>\n<p>        # backward step<\/p>\n<p>        model = sm.OLS(y, sm.add_constant(X[included])).fit()<\/p>\n<p>        pvalues = model.pvalues.iloc[1:]<\/p>\n<p>        worst_pval = pvalues.max()<\/p>\n<p>        if worst_pval &gt; threshold_out:<\/p>\n<p>            changed=True<\/p>\n<p>            worst_feature = pvalues.idxmax()<\/p>\n<p>            included.remove(worst_feature)<\/p>\n<p>        if not changed:<\/p>\n<p>            break<\/p>\n<p>    return included<\/p>\n<p>selected_features = stepwise_selection(X, y)<\/p>\n<p>print(selected_features)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u8be6\u7ec6\u89e3\u91ca<\/h3>\n<\/p>\n<p><h4>1. \u6570\u636e\u52a0\u8f7d\u548c\u9884\u5904\u7406<\/h4>\n<\/p>\n<p><p>\u9996\u5148\uff0c\u6211\u4eec\u9700\u8981\u52a0\u8f7d\u6570\u636e\u5e76\u8fdb\u884c\u9884\u5904\u7406\u3002\u5728\u8fd9\u91cc\uff0c\u6211\u4eec\u4f7f\u7528<code>sklearn<\/code>\u5e93\u4e2d\u7684\u6ce2\u58eb\u987f\u623f\u4ef7\u6570\u636e\u96c6\u4f5c\u4e3a\u793a\u4f8b\u3002\u6570\u636e\u96c6\u52a0\u8f7d\u540e\uff0c\u72ec\u7acb\u53d8\u91cf\uff08\u7279\u5f81\uff09\u5b58\u50a8\u5728<code>X<\/code>\u4e2d\uff0c\u76ee\u6807\u53d8\u91cf\uff08\u623f\u4ef7\uff09\u5b58\u50a8\u5728<code>y<\/code>\u4e2d\u3002<\/p>\n<\/p>\n<p><h4>2. \u5411\u524d\u9009\u62e9<\/h4>\n<\/p>\n<p><p>\u5411\u524d\u9009\u62e9\u4ece\u4e00\u4e2a\u7a7a\u6a21\u578b\u5f00\u59cb\uff0c\u9010\u6b65\u6dfb\u52a0\u53d8\u91cf\u3002\u6bcf\u6b21\u6dfb\u52a0\u4e00\u4e2a\u53d8\u91cf\uff0c\u4f7f\u5f97\u6a21\u578b\u7684AIC\u6216BIC\u503c\u6700\u5c0f\u3002\u5728\u6bcf\u4e00\u6b65\u4e2d\uff0c\u6211\u4eec\u8ba1\u7b97\u6bcf\u4e2a\u5269\u4f59\u53d8\u91cf\u7684p\u503c\uff0c\u5e76\u9009\u62e9p\u503c\u6700\u5c0f\u7684\u53d8\u91cf\u6dfb\u52a0\u5230\u6a21\u578b\u4e2d\u3002\u5982\u679c\u8be5\u53d8\u91cf\u7684p\u503c\u5c0f\u4e8e\u7ed9\u5b9a\u7684\u663e\u8457\u6027\u6c34\u5e73\uff08<code>significance_level<\/code>\uff09\uff0c\u5219\u5c06\u5176\u6dfb\u52a0\u5230\u6a21\u578b\u4e2d\uff1b\u5426\u5219\uff0c\u505c\u6b62\u6dfb\u52a0\u53d8\u91cf\u3002<\/p>\n<\/p>\n<p><h4>3. \u5411\u540e\u6d88\u9664<\/h4>\n<\/p>\n<p><p>\u5411\u540e\u6d88\u9664\u4ece\u5305\u542b\u6240\u6709\u53d8\u91cf\u7684\u6a21\u578b\u5f00\u59cb\uff0c\u9010\u6b65\u5220\u9664\u53d8\u91cf\u3002\u6bcf\u6b21\u5220\u9664\u4e00\u4e2a\u53d8\u91cf\uff0c\u4f7f\u5f97\u6a21\u578b\u7684AIC\u6216BIC\u503c\u6700\u5c0f\u3002\u5728\u6bcf\u4e00\u6b65\u4e2d\uff0c\u6211\u4eec\u8ba1\u7b97\u6bcf\u4e2a\u53d8\u91cf\u7684p\u503c\uff0c\u5e76\u9009\u62e9p\u503c\u6700\u5927\u7684\u53d8\u91cf\u4ece\u6a21\u578b\u4e2d\u5220\u9664\u3002\u5982\u679c\u8be5\u53d8\u91cf\u7684p\u503c\u5927\u4e8e\u7ed9\u5b9a\u7684\u663e\u8457\u6027\u6c34\u5e73\uff08<code>significance_level<\/code>\uff09\uff0c\u5219\u5c06\u5176\u4ece\u6a21\u578b\u4e2d\u5220\u9664\uff1b\u5426\u5219\uff0c\u505c\u6b62\u5220\u9664\u53d8\u91cf\u3002<\/p>\n<\/p>\n<p><h4>4. \u9010\u6b65\u56de\u5f52<\/h4>\n<\/p>\n<p><p>\u9010\u6b65\u56de\u5f52\u7ed3\u5408\u4e86\u5411\u524d\u9009\u62e9\u548c\u5411\u540e\u6d88\u9664\u7684\u65b9\u6cd5\u3002\u5728\u6bcf\u4e00\u6b65\u4e2d\uff0c\u5148\u5c1d\u8bd5\u5411\u6a21\u578b\u4e2d\u6dfb\u52a0\u4e00\u4e2a\u53d8\u91cf\uff0c\u7136\u540e\u5c1d\u8bd5\u4ece\u6a21\u578b\u4e2d\u5220\u9664\u4e00\u4e2a\u53d8\u91cf\uff0c\u76f4\u5230\u6a21\u578b\u8fbe\u5230\u6700\u4f18\u3002\u5728\u5411\u524d\u9009\u62e9\u4e2d\uff0c\u6211\u4eec\u8ba1\u7b97\u6bcf\u4e2a\u5269\u4f59\u53d8\u91cf\u7684p\u503c\uff0c\u5e76\u9009\u62e9p\u503c\u6700\u5c0f\u7684\u53d8\u91cf\u6dfb\u52a0\u5230\u6a21\u578b\u4e2d\u3002\u5982\u679c\u8be5\u53d8\u91cf\u7684p\u503c\u5c0f\u4e8e\u7ed9\u5b9a\u7684\u9608\u503c\uff08<code>threshold_in<\/code>\uff09\uff0c\u5219\u5c06\u5176\u6dfb\u52a0\u5230\u6a21\u578b\u4e2d\u3002\u5728\u5411\u540e\u6d88\u9664\u4e2d\uff0c\u6211\u4eec\u8ba1\u7b97\u6bcf\u4e2a\u53d8\u91cf\u7684p\u503c\uff0c\u5e76\u9009\u62e9p\u503c\u6700\u5927\u7684\u53d8\u91cf\u4ece\u6a21\u578b\u4e2d\u5220\u9664\u3002\u5982\u679c\u8be5\u53d8\u91cf\u7684p\u503c\u5927\u4e8e\u7ed9\u5b9a\u7684\u9608\u503c\uff08<code>threshold_out<\/code>\uff09\uff0c\u5219\u5c06\u5176\u4ece\u6a21\u578b\u4e2d\u5220\u9664\u3002\u8fd9\u4e2a\u8fc7\u7a0b\u4e0d\u65ad\u91cd\u590d\uff0c\u76f4\u5230\u6ca1\u6709\u53d8\u91cf\u53ef\u4ee5\u6dfb\u52a0\u6216\u5220\u9664\u4e3a\u6b62\u3002<\/p>\n<\/p>\n<p><h3>\u603b\u7ed3<\/h3>\n<\/p>\n<p><p>\u901a\u8fc7\u4ee5\u4e0a\u6b65\u9aa4\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528Python\u5b9e\u73b0\u9010\u6b65\u56de\u5f52\uff0c\u5e76\u9009\u62e9\u6700\u4f18\u7684\u53d8\u91cf\u6784\u5efa\u56de\u5f52\u6a21\u578b\u3002\u9010\u6b65\u56de\u5f52\u662f\u4e00\u79cd\u6709\u6548\u7684\u7279\u5f81\u9009\u62e9\u65b9\u6cd5\uff0c\u53ef\u4ee5\u5e2e\u52a9\u6211\u4eec\u4ece\u5927\u91cf\u53d8\u91cf\u4e2d\u9009\u62e9\u6700\u6709\u610f\u4e49\u7684\u53d8\u91cf\uff0c\u4ece\u800c\u6784\u5efa\u66f4\u597d\u7684\u56de\u5f52\u6a21\u578b\u3002\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0c\u6211\u4eec\u53ef\u4ee5\u6839\u636e\u5177\u4f53\u95ee\u9898\u9009\u62e9\u5408\u9002\u7684\u663e\u8457\u6027\u6c34\u5e73\u548c\u9608\u503c\uff0c\u4ee5\u83b7\u5f97\u6700\u4f18\u7684\u6a21\u578b\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u9010\u6b65\u56de\u5f52\u7684\u5b9a\u4e49\u662f\u4ec0\u4e48\uff1f<\/strong><br \/>\u9010\u6b65\u56de\u5f52\u662f\u4e00\u79cd\u7edf\u8ba1\u5206\u6790\u65b9\u6cd5\uff0c\u7528\u4e8e\u9009\u62e9\u5bf9\u6a21\u578b\u6709\u663e\u8457\u5f71\u54cd\u7684\u81ea\u53d8\u91cf\u3002\u5b83\u901a\u8fc7\u9010\u6b65\u6dfb\u52a0\u6216\u5220\u9664\u53d8\u91cf\u6765\u4f18\u5316\u56de\u5f52\u6a21\u578b\uff0c\u5e38\u7528\u4e8e\u5904\u7406\u591a\u91cd\u5171\u7ebf\u6027\u95ee\u9898\u6216\u5728\u9ad8\u7ef4\u6570\u636e\u4e2d\u7b5b\u9009\u7279\u5f81\u3002\u6b64\u65b9\u6cd5\u53ef\u4ee5\u901a\u8fc7Python\u4e2d\u7684\u7edf\u8ba1\u5305\u5b9e\u73b0\uff0c\u4ee5\u4fbf\u63d0\u9ad8\u6a21\u578b\u7684\u9884\u6d4b\u80fd\u529b\u548c\u89e3\u91ca\u6027\u3002<\/p>\n<p><strong>\u5728Python\u4e2d\u6267\u884c\u9010\u6b65\u56de\u5f52\u9700\u8981\u54ea\u4e9b\u5e93\uff1f<\/strong><br \/>\u8981\u5728Python\u4e2d\u8fdb\u884c\u9010\u6b65\u56de\u5f52\uff0c\u901a\u5e38\u9700\u8981\u4f7f\u7528\u4ee5\u4e0b\u5e93\uff1a<code>pandas<\/code>\u7528\u4e8e\u6570\u636e\u5904\u7406\uff0c<code>statsmodels<\/code>\u7528\u4e8e\u7edf\u8ba1\u5efa\u6a21\uff0c<code>numpy<\/code>\u7528\u4e8e\u6570\u503c\u8ba1\u7b97\u3002\u4f60\u8fd8\u53ef\u4ee5\u4f7f\u7528<code>scikit-learn<\/code>\u6765\u5904\u7406\u6570\u636e\u96c6\u548c\u8bc4\u4f30\u6a21\u578b\u7684\u6027\u80fd\u3002\u786e\u4fdd\u5728\u5f00\u59cb\u4e4b\u524d\u5b89\u88c5\u8fd9\u4e9b\u5e93\uff0c\u53ef\u4ee5\u901a\u8fc7<code>pip install pandas statsmodels numpy scikit-learn<\/code>\u547d\u4ee4\u6765\u5b8c\u6210\u3002<\/p>\n<p><strong>\u5982\u4f55\u9009\u62e9\u9010\u6b65\u56de\u5f52\u7684\u6807\u51c6\uff1f<\/strong><br \/>\u5728\u9010\u6b65\u56de\u5f52\u4e2d\uff0c\u9009\u62e9\u5408\u9002\u7684\u6807\u51c6\u662f\u975e\u5e38\u91cd\u8981\u7684\u3002\u5e38\u7528\u7684\u6807\u51c6\u5305\u62ecAIC\uff08\u8d64\u6c60\u4fe1\u606f\u91cf\u51c6\u5219\uff09\u3001BIC\uff08\u8d1d\u53f6\u65af\u4fe1\u606f\u91cf\u51c6\u5219\uff09\u4ee5\u53cap\u503c\u7b49\u3002AIC\u548cBIC\u5747\u8861\u4e86\u6a21\u578b\u7684\u590d\u6742\u6027\u548c\u62df\u5408\u4f18\u5ea6\uff0c\u800cp\u503c\u5219\u53ef\u4ee5\u5e2e\u52a9\u5224\u65ad\u67d0\u4e2a\u53d8\u91cf\u662f\u5426\u663e\u8457\u3002\u6839\u636e\u5177\u4f53\u60c5\u51b5\u9009\u62e9\u5408\u9002\u7684\u6807\u51c6\uff0c\u6709\u52a9\u4e8e\u6784\u5efa\u66f4\u5177\u89e3\u91ca\u6027\u7684\u56de\u5f52\u6a21\u578b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u9010\u6b65\u56de\u5f52\u662f\u4e00\u79cd\u7edf\u8ba1\u65b9\u6cd5\uff0c\u7528\u4e8e\u9009\u62e9\u6700\u6709\u610f\u4e49\u7684\u53d8\u91cf\u8fdb\u884c\u56de\u5f52\u6a21\u578b\u7684\u6784\u5efa\u3002\u5176\u4e3b\u8981\u76ee\u7684\u662f\u901a\u8fc7\u9010\u6b65\u589e\u52a0\u6216\u51cf\u5c11\u53d8\u91cf\uff0c\u627e\u5230\u6700\u4f18 [&hellip;]","protected":false},"author":3,"featured_media":1071442,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[37],"tags":[],"acf":[],"_links":{"self":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1071438"}],"collection":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/comments?post=1071438"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1071438\/revisions"}],"predecessor-version":[{"id":1071445,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1071438\/revisions\/1071445"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1071442"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1071438"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1071438"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1071438"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}