Message Boards Message Boards

1
|
3649 Views
|
3 Replies
|
8 Total Likes
View groups...
Share
Share this post:

Get a high correlation coefficient using different test lists?

Hi,

How to get a high correlation coefficient, as test list is different in each running of the following code. Is there possible to use any iteration command?

In[86]:= tuples = {{5.8`, 17.1`} -> 1.49`, {8.9`, 23.4`} -> 
    7.45`, {12.6`, 29.3`} -> 3.84`, {17.1`, 34.8`} -> 
    9.`, {22.8`, 36.7`} -> 6.3`, {20.`, 34.`} -> 
    5.14`, {25.4`, 32.1`} -> 4.04`, {28.`, 28.`} -> 
    4.01`, {23.8`, 32.2`} -> 3.9`, {17.4`, 31.6`} -> 
    3.31`, {12.7`, 26.9`} -> 2.01`, {8.1`, 22.`} -> 
    1.66`, {6.7`, 26.`} -> 1.59`, {8.`, 23.9`} -> 
    2.68`, {12.1`, 29.1`} -> 3.43`};

In[87]:= test = RandomSample[tuples, 5]
In[88]:= train = Complement[tuples, test]
In[89]:= cfunc =  Predict[train, Method -> "NeuralNetwork",  PerformanceGoal -> "Quality"]
In[90]:= YPrediction = Map[cfunc, test[[All, 1]]]
In[91]:= YObserved = test[[All, 2]]
In[92]:= Correlation[YPrediction, YObserved]

Many thanks !

POSTED BY: M.A. Ghorbani
3 Replies

The subject header could stand to be more informative as regards the contents of the post.

POSTED BY: Daniel Lichtblau

Dear Daniel,

Thank so much for your reminder :)

POSTED BY: M.A. Ghorbani

The subject header could stand to be more informative as regards the contents of the post.

As for replicability, you can set an explicit random seed (using RandomSeed[...]) before using RandomSample. Also it might make sense to do several such trials and take an average.

POSTED BY: Daniel Lichtblau
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract