Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
138 views
in Technique[技术] by (71.8m points)

python - How could I calculate weight for FICO score?

It is like from our data set at first we have to classify our chosen variable into x1, x2, x3, x4 and x5. Then we need to create a model and need to consider their weights.
Like:

y = (x1*w1) + (x2*w2) + (x3*w3) + (x4*w4) + (x5*w5)

Here my question is how code I do it in Python? any idea? Actually I'm new in Python any help (for code) will be appreciated. Thanks in advance.

question from:https://stackoverflow.com/questions/65858185/how-could-i-calculate-weight-for-fico-score

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Pretty much exactly as you have written it. You could put it inside a function as follows:

def fico_score(x1,x2,x3,x4,x5,w1,w2,w3,w4,w5):
   return (x1*w1)+(x2*w2)+(x3*w3)+(x4*w4)+(x5*w5)

y = fico_score(1,2,3,4,5,1,2,3,4,5) # Call the function (here just with random numbers)

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...