- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
当我使用模型进行预测时遇到问题,R 显示此消息警告消息预测来自排名不足的拟合可能会产生误导
,我该如何解决?我认为我的模型是正确的,但预测失败了,我不知道为什么。
在这里您可以逐步看到我正在做的事情以及模型的摘要:
myModel <- lm(margin~.,data = dataClean[train,c(target,numeric,categoric)])
Call:
lm(formula = margin ~ ., data = dataClean[train, c(target, numeric, categoric)])
Residuals:
Min 1Q Median 3Q Max
-0.220407 -0.035272 -0.003415 0.028227 0.276727
Coefficients: (2 not defined because of singularities)
Estimate Std. Error t value Pr(>|t|)
(Intercept) 6.061e-01 2.260e-02 26.817 < 2e-16 ***
price 1.042e-05 8.970e-06 1.162 0.245610
shipping 1.355e-03 2.741e-04 4.943 9.25e-07 ***
categoryofficeSupplies -7.721e-02 2.295e-02 -3.364 0.000802 ***
categorytechnology -3.993e-02 2.325e-02 -1.717 0.086249 .
subCategorybindersAndAccessories -1.650e-01 1.421e-02 -11.612 < 2e-16 ***
subCategorybookcases 3.337e-04 2.328e-02 0.014 0.988565
subCategorychairsChairmats -3.104e-02 2.106e-02 -1.474 0.140831
subCategorycomputerPeripherals 1.356e-02 1.293e-02 1.049 0.294604
subCategorycopiersAndFax -1.943e-01 2.944e-02 -6.598 7.27e-11 ***
subCategoryenvelopes -1.648e-01 2.045e-02 -8.057 2.62e-15 ***
subCategorylabels -1.534e-01 1.984e-02 -7.730 3.00e-14 ***
subCategoryofficeFurnishings -8.827e-02 2.220e-02 -3.976 7.61e-05 ***
subCategoryofficeMachines -1.521e-01 1.639e-02 -9.281 < 2e-16 ***
subCategorypaper -1.624e-01 1.363e-02 -11.909 < 2e-16 ***
subCategorypensArtSupplies -8.484e-04 1.524e-02 -0.056 0.955623
subCategoryrubberBands 3.174e-02 2.245e-02 1.414 0.157854
subCategoryscissorsRulersTrimmers 1.092e-01 2.327e-02 4.693 3.13e-06 ***
subCategorystorageOrganization 1.219e-01 1.575e-02 7.739 2.82e-14 ***
subCategorytables NA NA NA NA
subCategorytelephoneAndComunication NA NA NA NA
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 0.08045 on 858 degrees of freedom
Multiple R-squared: 0.6512, Adjusted R-squared: 0.6439
F-statistic: 88.98 on 18 and 858 DF, p-value: < 2.2e-16
estimateModel <- predict(myModel, type="response", newdata=dataClean[test, c(numeric,categoric,target)])
Warning message:
In predict.lm(myModel, type = "response", newdata = dataClean[test, :
prediction from a rank-deficient fit may be misleading
最佳答案
您的两个子类别级别的相关系数已被抑制。这意味着它们中的每一个都可以通过价格和运输以及其他类别和子类别级别的某种组合进行 100% 预测。这在 R 文档中称为“别名”。该警告可能重要也可能不重要,尽管同意@ZheyuanLi 的观点,即它可能是良性的。我不认为这个特定的警告可能是由于缺失值造成的,因为 R 回归函数通常以一种当任何一个变量具有缺失值时删除整行的方式运行。两个变量之间存在 100% 相关性的理论也不太可能。如果您想查找显示可能导致此问题的组合,我建议从
开始with( dataClean , table( category, SubCategory) )
我预测您会发现一个子类别上有一个或多个类别行。
关于r - 如何解决我的线性模型上的 "rank-deficient fit may be misleading error"问题?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40774922/
我正在尝试找出一种计算排名的方法。现在它只需要每个条目的赢/输的比率,所以例如100 次中,有 99 次获胜,则胜率达到 99%。但如果一个参赛作品在 1 票中赢得 1 票,那么它的获胜排名将是 10
我尝试了以下操作,但它没有对每个类别进行明智的排名。相反,在不考虑类别的情况下对所有记录进行排名。我希望每个类别重新出现排名 select rs.Section,rs.Field1,rs.Field
如何获得在分区更改时重新启动的 RANK?我有这张表: ID Date Value 1 2015-01-01 1 2 2015-01-02 1 1; 关于
由于我们可以使用 row_number() 获得分配的行号如果我们想使用 dense_rank() 在不跳过分区内的任何数字的情况下找到每一行的排名,我们为什么需要rank()功能,我想不出任何用例
我很难搜索可以帮助我构建文本序列(特征)分类器的文档、研究或博客。我拥有的文本序列包含网络日志。 我正在使用 TensorFlow 构建 GRU 模型,并将 SVM 作为分类函数。我在处理张量形状时遇
我遇到了这类错误。 colsys.f:1367.51: 1 NOLD, ALDIF, K, NCOMP, M, MSTAR, 3,DUMM,0)
import tensorflow as tf x = [[1,2,3],[4,5,6]] y = [0,1] z = [1,2] x = tf.constant(x) y = tf.constant
我在学习 SQL 中的排名函数,发现它使用的排名与 pandas 方法不同。如何得到相同的答案? 提问链接:https://www.windowfunctions.com/questions/rank
在 SQL Server 数据库中,我有一个我对排名感兴趣的值表。 当我执行 RANK() OVER (ORDER BY VALUE DESC) 作为 RANK 时,我得到以下结果(在假设表中): R
我有一个包含以下字段的游戏 table : ID Name Email Points ---------------------------------- 1 Jo
我有以下 TensorFlow 代码: layer_1 = tf.add(tf.matmul(tf.cast(x, tf.float32), weights['h1']), biases['b1'])
我是 Sentdex 教程的神经网络新手。我尝试运行该代码: import tensorflow as tf from tensorflow.examples.tutorials.mnist i
我是 tensorflow 的新手,我正在尝试将双向 LSTM 的一些代码从旧版本的 tensorflow 更新到最新版本 (1.0),但我收到此错误: Shape must be rank 2 bu
我正在使用以下格式的数据集: Column 1 (What I Have), Column 2 (What I need to see) 8 1 8 1 8 1 9 2 9
我有一个 Keras 函数模型(具有卷积层的神经网络),它可以很好地与 tensorflow 配合使用。我可以运行它,我可以适应它。 但是,使用tensorflow gpu时无法建立模型。 这是构建模
MPI 中的进程以什么顺序执行?我的意思是排名明智的顺序? 例如:rank == 0 首先,rank == 1 接下来? 我通过在运行时给出以下命令来考虑两个过程: mpirun -np 2 示例。
我正在尝试使用 cvxpy(因此使用 cvxopt)在具有 28 个节点和 37 条线路的相对简单的网络中对最佳功率流进行建模,但得到的是“Rank(A) < p or Rank([G; A] ) <
我是 tensorflow 的新手,我正在做一些在线练习以熟悉 tensorflow。我要执行以下任务: Create two tensors x and y of shape 300 from an
我有一个 Ubuntu 对话语料库的 .tfrecords 文件。我正在尝试读取整个数据集,以便我可以将上下文和话语分成几批。使用 tf.parse_single_example 我能够阅读一个示例。
实际上我们不能在 if 语句中使用 tf.var 作为 bool 来代替使用 tf.cond。我为规范化输入数据编写了这段代码,但出现了令人困惑的错误,我哪里做错了? def global_co
我是一名优秀的程序员,十分优秀!