dedecha
(decha promtem)
February 1, 2020, 4:47am
1
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
danl
(Daniel Lichtblau)
February 1, 2020, 3:33pm
2
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.
dedecha
(decha promtem)
February 1, 2020, 4:31pm
3
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
hansmilton
(Hans Milton)
February 1, 2020, 7:06pm
4
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
dedecha
(decha promtem)
February 2, 2020, 2:06am
5
Hello, Milton
Very thank you for your suggestion.
Decha