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

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

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.

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

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

Hello, Milton

Very thank you for your suggestion.

Decha