none
Where does the output of summary(logitObj) go? - Microsoft tutorial RRS feed

  • Question

  • I am working on this example 

    In-Database Advanced Analytics for SQL Developers 

    https://msdn.microsoft.com/en-us/library/mt683480.aspx

    In Step 5  Curious where the o/p of this R command goes

    summary(logitObj)

    Here is the full script behind the stored procedure EXEC TrainTipPredictionModel

    CREATE PROCEDURE [dbo].[TrainTipPredictionModel]  
    
    AS  
    BEGIN  
      DECLARE @inquery nvarchar(max) = N'  
        select tipped, fare_amount, passenger_count,trip_time_in_secs,trip_distance,   
        pickup_datetime, dropoff_datetime,   
        dbo.fnCalculateDistance(pickup_latitude, pickup_longitude,  dropoff_latitude, dropoff_longitude) as direct_distance  
        from nyctaxi_sample  
        tablesample (70 percent) repeatable (98052)  
    '  
      -- Insert the trained model into a database table  
      INSERT INTO nyc_taxi_models  
      EXEC sp_execute_external_script @language = N'R',  
                                      @script = N'  
    
    ## Create model  
    logitObj <- rxLogit(tipped ~ passenger_count + trip_distance + trip_time_in_secs + direct_distance, data = InputDataSet)  
    summary(logitObj)  
    
    ## Serialize model and put it in data frame  
    trained_model <- data.frame(model=as.raw(serialize(logitObj, NULL)));  
    ',  
                                      @input_data_1 = @inquery,  
                                      @output_data_1_name = N'trained_model'  
      ;  
    
    END  
    GO  
    
    

    Wednesday, December 7, 2016 11:29 PM