static async Task Main(string[] args) { var channel = GrpcChannel.ForAddress("https://localhost:5001"); var client = new Prediction.PredictionClient(channel); var request = new HousingRequest { Longitude = -122.25f, Latitude = 37.85f, HousingMedianAge = 55.0f, TotalRooms = 1627.0f, TotalBedrooms = 235.0f, Population = 322.0f, Households = 120.0f, MedianIncome = 8.3014f, OceanProximity = "NEAR BAY" }; var response = await client.PredictAsync(request); Console.WriteLine($"Prediction is {response.Score.ToString("c")}"); Console.ReadLine(); }
public override async Task <HousingReply> Predict(HousingRequest request, ServerCallContext context) { var response = new HousingReply(); var prediction = _predictionEngine.Predict(request); response.Score = prediction.Score; return(await Task.FromResult(response)); }