是否有办法,我可以提出诸如[1、3、4.5、1]等价值清单,并获得与这些价值相关的职能? 类似:
I don t want to plot it or anything, I just want to substitute values in that function and see what the result would be.
编辑:有没有办法计算数据的相关性? 就像我给它一份包含数千个价值观的清单一样,它使我恢复根据这些价值观调整的职能。
是否有办法,我可以提出诸如[1、3、4.5、1]等价值清单,并获得与这些价值相关的职能? 类似:
I don t want to plot it or anything, I just want to substitute values in that function and see what the result would be.
编辑:有没有办法计算数据的相关性? 就像我给它一份包含数千个价值观的清单一样,它使我恢复根据这些价值观调整的职能。
Yes, the function is called map()
.
def y(x):
return 3*x+4
map(y, [1,3,4.5,1])
<>代码>(>功能适用于每个项目,并填写结果清单。
根据你修订后的问题,我会走下去,并补充一个答案。 没有这种职能。 我认为,你不大可能找到一种在任何<>>><>><>>方案拟定语言中结束的职能。 你的定义不够严格,但任何事情都是合理的。 如果我们仅举两点投入,就能够有各种关系:
[10, 1]
possible relationships:
def x(y):
return y ** 0
def x(y):
return y / 10
def x(y)
return y % 10 + 1
...... ......重复。 诚然,其中一些是任意的,但它们是你所穿阵列的第一和第二个价值观之间的有效关系。 当你要求建立10、15或35人之间的关系时,“解决方案”的可能性就变得更加荒唐。
I assume you want to find out if the sequences [1, 2, 3, 4]
and [ 1, 3, 4.5, 1]
(or else the pairs [(1, 1), (2, 3), (3, 4.5), (4, 1)]
are related with a (linear) function or not.
Try to plot these and see if they form somethign that looks like a (straight) line or not.
你们还可以寻找相关技术。 http://www.statsoft.com
What you re looking for is called "statistical regression". There are many methods by which you might do this; here s a site that might help: Least Squares Regression but ultimately, this is a field to which many books have been devoted. There s polynomial regressions, trig regressions, logarithmic...you ll have to know something about your data before you decide which model you apply; if you don t have any knowledge of what the dataset will look like before you process it, I d suggest comparing the residuals of whatever you get and choosing the one with the lowest sum.
简短回答: 无。
Is there a way to force Django models to pass a field to a MySQL function every time the model data is read or loaded? To clarify what I mean in SQL, I want the Django model to produce something like ...
I am looking for an enterprise tasks scheduler for python, like quartz is for Java. Requirements: Persistent: if the process restarts or the machine restarts, then all the jobs must stay there and ...
Given the following list that contains some duplicate and some unique dictionaries, what is the best method to remove unique dictionaries first, then reduce the duplicate dictionaries to single ...
Simple enough question: I m using python random module to generate random integers. I want to know what is the suggested value to use with the random.seed() function? Currently I am letting this ...
I m using PyDev under Eclipse to write some Jython code. I ve got numerous instances where I need to do something like this: import com.work.project.component.client.Interface.ISubInterface as ...
Python s paster serve app.ini is taking longer than I would like to be ready for the first request. I know how to profile requests with middleware, but how do I profile the initialization time? I ...
Our business currently has an online store and recently we ve been offering free specials to our customers. Right now, we simply display the special and give the buyer a notice stating we will add the ...
I m trying to convert a Python dictionary into a Python list, in order to perform some calculations. #My dictionary dict = {} dict[ Capital ]="London" dict[ Food ]="Fish&Chips" dict[ 2012 ]="...