object has no attribute 'liner'
时间: 2023-10-02 08:11:34 浏览: 127
引用:关于使用LinearRegression类中_residues属性报错“attributeerror: 'linearregression' object has no attribute '_residues'” 当使用sklearn库中liner_model进行线性回归预测数据时计算数据训练集残差平方和使LinearRegression的_residues属性时报错LinearRegression中没有属性_residues model = LinearRegression() hypothesis = model.fit(xTrain, yTrain) hpyTrain = model.predict(xTrain) hpyTest = model.predict(xTest) # 针对测试数据进行预测 print("Python计算的训练数据集残差平方和", model._residues) 原因是scikit-learn库版本过高,当前使用的是1.1.2,更改为1.0.2时结果正确输出。
根据你提供的引用内容,报错"object has no attribute 'liner'"是因为你在代码中使用了'liner'这个属性,但实际上该对象没有这个属性。要解决这个问题,你可以检查代码中是否有拼写错误,或者确认该对象确实应该具有这个属性。同时,你可以检查你所使用的库的版本是否与代码兼容,如果不兼容,可以尝试降低库的版本或更新代码以适应新版本的库。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [python报错: list object has no attribute shape的解决](https://download.csdn.net/download/weixin_38748721/13708867)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *2* [attributeerror: ‘linearregression‘ object has no attribute ‘_residues](https://blog.csdn.net/qq_62462013/article/details/127431460)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *3* [module ‘torch.nn.parameter‘ has no attribute ‘UninitializedParameter](https://blog.csdn.net/qq_46582929/article/details/123056515)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"]
[ .reference_list ]
阅读全文