【发布时间】:2020-09-02 11:16:18
【问题描述】:
我有以下来自线性回归器和决策树回归器的训练分数。
lin_rmse_scores = np.array([65000.67382615, 70960.56056304, 67122.63935124, 66089.63153865,
68402.54686442, 65266.34735288, 65218.78174481, 68525.46981754,
72739.87555996, 68957.34111906])
tree_rmse_scores = np.array([65312.86044031, 70581.69865676, 67849.75809965, 71460.33789358,
74035.29744574, 65562.42978503, 67964.10942543, 69102.89388457,
66876.66473025, 69735.84760006])
我想使用 Pandas describe() 比较两个回归器的一些统计数据。对于线性回归器,我这样做如下:
df = pd.Series(lin_rmse_scores).describe()
对于我想指定列“Lin Regr”的系列。我想为决策树回归器附加第二列。结果应如下所示:
'Lin Regr' 'Dec Tree'
count 10.000000 10.000000
mean 67828.386774 68848.189796
std 2601.596761 2719.219956
min 65000.673826 65312.860440
25% 65472.168399 67119.938073
50% 67762.593108 68533.501655
75% 68849.373294 70370.235893
max 72739.875560 74035.297446
【问题讨论】: