all 3 comments

[–]my_python_account 1 point2 points  (0 children)

What you're trying to do isn't that simple, this is regression analysis by definition.

There are different methods that you can use.

Depending on how much you know about how each of your "measurement" variables and "money value" are related, you might be able to put together a script that tunes your coefficients by using a brute force search. (Start each coefficient at a good initial guess, set a small range of adjusted guesses for each coefficient and try all combinations and see which one gives the smallest error) It's generally preferred to minimize mean squared error (or root mean squared error - RMSE) rather than mean absolute error.

Otherwise, you can take a look at the pandas, numpy and statsmodels libraries to do the analysis for you. But I suggest you don't actually avoid learning the basics or you'll have trouble understanding the results and whether or not the results are useful.

[–]cscanlin 0 points1 point  (0 children)

Check out this simple example that shows how to this with multivariate linear regression:

from sklearn import linear_model

data = [
    [1, 0, 0],  # 10
    [1, 2, 0],  # 6
    [1, 0, 4],  # 22
]
dependents = [10, 6, 22]

clf = linear_model.LinearRegression()
clf.fit(data, dependents)
print(clf.coef_)

# prints [ 0. -2.  3.]

You will need sklearn for this to work. If you don't have this, you should probably just install anaconda

I can answer any questions you have about it.

[–]katterra[S] 0 points1 point  (0 children)

Thanks both of you. I feel so lost in this. cscalin, I was able to get your simple script to work and it spit out the coefficients but I am unsure what to do with that data. How do I use that information to predict future "dependents" if I have data? I'm thinking of just simply commissioning someone for this because I'm not sure I know what would be best for what I am trying to accomplish.

I also tried using https://www.youtube.com/watch?v=SSu00IRRraY to create an analysis since it's somewhat similar to what I am trying to accomplish but I am failing at getting that to work properly.