1
$\begingroup$

I have a model that predicts frequencies. True frequencies are close to 1 therefore the frequencies that predicted are mostly close to 1. Sample frequencies are:

true  = [0.9999930241642949,0.9999930128563443,0.9999930160769908,0.9999928480496632,0.9999790561295727,
 0.9999930202691384,0.9999924134373198,0.9995322143714916,0.9990997780848302,0.9999441699466823]

prediction = [0.9685569, 0.8430407, 0.93365747, 0.915529, 0.8040398, 0.8197026, 0.8163535,
 0.9588296,0.9716148,0.8882043]

However when I plot true frequencies vs predictions I get something like this:

enter image description here

The code I use for plotting:

import pandas as pd
data = pd.DataFrame({
    'true': true,
    'prediction': prediction,
})
sns.jointplot(x='true', y='prediction', data=data)


import numpy as np
import scipy.stats
r = np.corrcoef(prediction, true)
print(r)
scipy.stats.spearmanr(prediction, true)

But it perhaps not the right way to visualise it. And when I do spearman coorelation I get -0.097. How do you suggest I transform my frequencies? I was thinking of transforming these frequencies so that I can draw a linear regression line between these true and predicted. How do you suggest I can do that?

$\endgroup$
4
  • 2
    $\begingroup$ To draw a linear regression line between pred & actual, you should first improve your predictions I suppose. $\endgroup$
    – gunes
    Commented Jan 17, 2021 at 16:05
  • 1
    $\begingroup$ You can compute and plot a linear regression regardless of any transformation. $\endgroup$
    – whuber
    Commented Jan 17, 2021 at 16:38
  • $\begingroup$ By frequencies, it seems you mean relative frequencies. Please say something about the samples sizes used to calculate and estimate the frequencies. $\endgroup$
    – Gregg H
    Commented Jan 17, 2021 at 18:34
  • $\begingroup$ each input is 100*10*10 in shape on which I do 3D convolutions. 10 in second dimension means # of individuals and 10 in third dimension refers to 10 different features. So for each individual for each feature I have a count. And from that input I want to compute frequencies while taking sequence into context. Sequence is in the first dimension. And I use mean square logarithmic error to predict frequencies. Does it answer your question @GreggH? $\endgroup$
    – John
    Commented Jan 17, 2021 at 21:54

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.