Answer the question
In order to leave comments, you need to log in
How to set rule for predicted (Predict) field in Microsoft Linear Regression?
Good afternoon!
How to specify in Microsoft Analysis Services, for the Microsoft Linear Regression algorithm, that the predicted (Predict) field should be greater than zero?
Tried like this:
ALTER MINING STRUCTURE TMCRegression
ADD MINING MODEL LogisticRegression
(
[GROUP],
[PriceDeliver],
[PriceSale] PREDICT,
[PriceReestr],
[PrPriceSale] ,
[PrPriceDeliver]
)
USING Microsoft_Logistic_Regression
WITH FILTER ([PriceSale] > 0)
SELECT
t.[Group], t.[NAME], Predict(LogisticRegression.[PriceSale]) AS [Predict PriceSale], t.[PriceSale],
(100.0*Abs(Predict(LogisticRegression.[PriceSale])-t.[PriceSale]))/t.[PriceSale] AS Quality,
t.PriceDeliver, t.PriceReestr, t.PrPriceSale, t.PrPriceDeliver
FROM LogisticRegression
PREDICTION JOIN
OPENQUERY([ForecastDS],'SELECT * FROM dbo.TMCIncome') AS t
ON
t.[Group] = LogisticRegression.[Group] AND
t.PriceDeliver = LogisticRegression.[PriceDeliver] AND
t.PriceReestr = LogisticRegression.[PriceReestr] AND
t.PrPriceSale = LogisticRegression.[PrPriceSale] AND
t.PrPriceDeliver = LogisticRegression.[PrPriceDeliver]
ORDER BY (100.0*Abs(Predict(LogisticRegression.[PriceSale])-t.[PriceSale]))/t.[PriceSale] DESC
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question