none
logistic Regression Model - rxPredict ERROR RRS feed

  • Question

  • I have built a prediction for Lapse using logistic regression model

    My Logistic Regression model accepts two input parameters that is Amount and Method.

    Amount is a continuous variable of data type float

    Method is Discrete variable has got three possible values

    When calling rxPredict I pass the value for the two inputs i.e value for Amount and method.

    I receive the following error

    INTERNAL ERROR: In rxPredict, the number of parameters does not match the number of  variables: 3 vs. 5.

    It is my understanding that this error is shown because of the three discrete values in method as three different independent variables. Is this correct?

    How do I fix this error?

    How do I pass 5 values when there are only two input variable required to be passed?

    I am calling the rxPredict via Stored Procedure i.e,

    EXEC

    sp_execute_external_script@language =N'R',


                                      @script

    =N'

    mod <- unserialize(as.raw(model));

    print(summary(mod))

    OutputDataSet<-rxPredict(modelObject = mod, data = InputDataSet, outData = NULL,

              predVarNames = "Score", type = "response", writeModelVars = FALSE, overwrite = TRUE);

    str(OutputDataSet)

    print(OutputDataSet)

    '

    ,


    @input_data_1

    =@inquery,


    @params

    =N'@model varbinary(max),@Amount float,@Method nvarchar(100)',


    @model

    =@lmodel2,


    @Amount

    =@Amount ,


    @Method

    =@Method


    WITH

    RESULT SETS ((Score float));


    Monday, August 1, 2016 2:34 PM

All replies