在使用类线性回归时获得 nan

问题描述

我有一个线性回归类,想检查它如何与数据集 load_boston 一起工作。我计算了平均绝对百分比误差 (MAPE),结果为 nan。

GlobalConfiguration.Configuration.Formatters.JsonFormatter.SerializerSettings
        .ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore;

但是当我像下面这样创建 X,y 时,代码正常工作并且 MAPE 给出浮点值

<ExceptionMessage>The 'ObjectContent`1' type Failed to serialize the response body for content type 'application/xml; charset=utf-8'.</ExceptionMessage>
<ExceptionType>system.invalidOperationException</ExceptionType>

我的代码有什么问题?以及如何修复它以获得浮点值? (抱歉我的英语不好,它不是我的母语)

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)