Message Boards Message Boards

0
|
4069 Views
|
4 Replies
|
4 Total Likes
View groups...
Share
Share this post:

Use Predict p[x] with 2-3 methods or must use one by one?

Posted 4 years ago

Hello,

My name is Decha.

How to use Predict p[x] with 2-3 methods?

From Wolfram document, sample as

    trainingData={1->8,2->3,3->8,4->7,5->4,6->3,7->3};

p =  Predict[trainingData, Method -> #] & /@ { "LinearRegression", "GaussianProcess"}

p[8]  

How to use p[8] with LinearRegression", "GaussianProcess"}? Or must it use one by one?

By the way,

Table[p=Predict[trainingData,Method -> k], {k, {"LinearRegression", "GaussianProcess"}}] 

Can it use?

Thank you for your answer.

Decha

POSTED BY: decha promtem
4 Replies
Posted 4 years ago

Hello, Milton

Very thank you for your suggestion.

Decha

POSTED BY: decha promtem
Posted 4 years ago

Decha, this is one way you could "use p[x]" with different Predict methods:

In[1]:= trainingData = {1 -> 8, 2 -> 3, 3 -> 8, 4 -> 7, 5 -> 4, 6 -> 3, 7 -> 3};

In[2]:= Table[p[k] = Predict[trainingData, Method -> k], {k,{"LinearRegression","GaussianProcess"}}];

In[3]:= p["LinearRegression"][8]
Out[3]= 2.43574

In[4]:= p["GaussianProcess"][8]
Out[4]= 5.14286

Of course there are other ways to do it

POSTED BY: Hans Milton
Posted 4 years ago

Hello, Lichtblau

Very thank you for your answer. I will study "Classify" follow your suggestion.

By the ways, could you help me to answer other question in topic "LearnDistribution, randomseeding in randomvariate with seedrandom method.

Very thank you Decha

POSTED BY: decha promtem

Not sure what Predict supports, but if you can instead use its cousin Classify you can obtain probabilities from each method. They can then be summed (perhaps weighted) to give a combined prediction.

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