我有一个组合数学的问题,我甚至很难用itertools概念化我将如何去做。我的数据集如下所示:
GoldMeasure Measure1 Measure2 Measure3 Measure4 Measure5 3+4-5
30.501 -1 -1 -1 -1 -1 -1
30.658 -1 -1 0 -1 -1 0
31.281 -1 -1 -1 1 -3
31.506 7 -1 -1 1 -1 1
31.554 -1 -1 -1 -1 -1 -1
31.613 -1 -1 -1 1 0
31.838 -1 -1 -1 -1 -2
31.954 -1 -1 -1 1 -1 1
33.073 1 1 1 -1 2
33.592 -2 -2 2 0 -2 4
Coefficient: -0.054 0.119 0.690 0.474 -0.441 0.723
我试图找到1-5的最佳组合,它与黄金指标的皮尔逊相关系数最高。在上面的数据集中,最好的单个度量是度量3,其系数为0.69。但是,如果将度量值3与度量值4相加,然后减去度量值5,则得到一个新的组合度量值,其系数为0.72。本质上,我想确定这五个度量的所有可能组合的相关系数。这些组合可以是度量值的2/5、度量值的3/5(如上面的示例中所示)、度量值的4/5或所有五个度量值。你知道吗
秩序有点重要。确实,度量3、4和5的加法组合与度量5、3和4的加法组合是相同的;但是,我也尝试将算术运算符作为另一个选项(加法或减法)包含进来。因此,3+4+5与5+3+4相同,但3+4-5与5+3-4不同。你知道吗
任何指导或帮助都将不胜感激。实际数据集有46个度量值,如上面的示例数据集所示,有些度量值没有特定样本的值。测度的值既有正的也有负的,但没有界。你知道吗
事先谢谢你的帮助。你知道吗
用五种方法来做这件事是可行的。你知道吗
例如,一个度量组合的内积,例如[1,1,0,-1,-1],与每一行度量列的内积将提供一系列值,GoldMeasure可以在这些值上进行回归以获得相关系数,这可以针对122个唯一的可能性进行。你知道吗
然而,根据{-1,0,1}的41次重复的部分乘积,41个度量将有18236498188585393202个独特的可能性。你知道吗
相关问题 更多 >
编程相关推荐