# Find the Weight Values using Linear Regression Analysis in Python [closed]

I have the equation below, which is a noise quality metric of an image:

If the BIQS is 1, it means the image is clean. Else, if it is between 0 and 1, it means the image may contain blur and noise. The smaller the value of BIQS, the dirty is the image. The task is to get the weights value for w1, w2,w3 and w4, given the set of values Blur_mean, Blur_noise, Noise_mean and Noise_ratio, which reflects the image quality. The weights reflects how much each term (Blur_mean, Blur_noise, Noise_mean and Noise_ratio ) contributes to the total image quality score. For Example:

     Blur_mean     Blur_noise    Noise_mean       Noise_ratio
1.   0.8398212     0.8948329     0.9849308        0.89428493
2.   0.8989332     0.8989432     0.7576812        0.35546632
3.   0.4324123     0.3123232     0.2123332        0.33213233
n.   .........     .........     .........        ..........


I don't know the basis for identifying the appropriate values or weight for w1,w2,w3 and w4. Is it possible to use linear regression analysis to find the values of w1, w2,w3 and w4 with almost/ close to 1 R-square or small standard error ? From what I observe, there are 4 independent variables here:

Blur_mean
Blur_noise
Noise_mean
Noise_ratio


Dependent Variable is BIQS and the unknowns are w1, w2, w3 and w4. Is there any library that takes care of it in Python?

• Yes, there's a python library that can do linear regression. There's some, but scikit-learn is the easiest to use in my opinion. – Itamar Mushkin Sep 6 at 6:22