RFfastestLap.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:f1_2017 作者: aflaisler 项目源码 文件源码
def plot_pred(y_predicted, y, savefig=True):
    # y_predicted.reset_index(drop=1, inplace=1)
    index = np.argsort(y)
    y = y[index]
    # y.shape
    yhat = y_predicted[index]
    yy = pd.DataFrame([y, yhat])
    if yy.shape[1] > yy.shape[0]:
        yy = yy.T
    yy.reset_index(drop=0, inplace=1)
    plt.scatter(yy.index, yy[1], s=.4)
    plt.plot(yy.index, yy[0], ls='-', color='red', linewidth=.5)
    if savefig:
        dt_ = datetime.datetime.now().strftime('%d%b%y_%H%M')
        plt.savefig("../graphs/" + dt_ + ".png")
    plt.show()


# Check the data before regression (no Na, size, etc)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号