Machinelearning: CreateStreamingDataView does not exist in MLContext

Created on 1 Jan 2019  路  6Comments  路  Source: dotnet/machinelearning

System information

  • All:
  • All:

Issue

  • What did you do? Tried to access CreateStreamingDataView method
  • What happened? It does not exits in MLContext, has it moved or should i be using something else?
  • What did you expect? i expected to be able to load data using CreateStreamingDataView

Source code / logs

Please paste or attach the code or logs or traces that would be helpful to diagnose the issue you are reporting.

API need info question

Most helpful comment

With the latest ML.net 0.10.0 CreateStreamingDataView went missing (I have Microsoft.ML.Data namespace included).

Therefore, for those having this issue, replace:
var data = mlContext.CreateStreamingDataView(dataset);
With:
var data = mlContext.Data.ReadFromEnumerable(dataset);

All 6 comments

Hi @zish82. CreateStreamingDataView has not moved. (follow the link to the source, to see the method on the HostEnvironment).

It is also in several of our tests, that run on every build.

If you don't see it, please add the 'Microsoft.ML.Data' namepace.

Thank you @sfilipi for your reply. @zish82 , could you confirm that when using the Microsoft.ML.Data namespace you could use CreateStreamingDataView?

Hi @sfilipi and @yaeldekel , this is an old style extension that operates over IHostEnvironment, I might expect that we'd make this an extension over DataOperationsCatalog instead (but also make it in Microsoft.ML namespace), since operating over MLContext directly is a bit too high level.

Hi Guys,
It worked as you suggested by adding ML.Data namespace. For some reason my VS was not suggesting that!

With the latest ML.net 0.10.0 CreateStreamingDataView went missing (I have Microsoft.ML.Data namespace included).

Therefore, for those having this issue, replace:
var data = mlContext.CreateStreamingDataView(dataset);
With:
var data = mlContext.Data.ReadFromEnumerable(dataset);

@ziad-akiki I didn't find the method CreateStreamingDataView, so I used your code, but AsEnumerable() doesn't exist too.

code from ms docs

// Create prediction engine
var sentimentStreamingDataView = mlContext.CreateStreamingDataView(sentiments);
var predictions = loadedModel.Transform(sentimentStreamingDataView);

// Use the model to predict whether comment data is toxic (1) or nice (0).
var predictedResults = predictions.AsEnumerable<SentimentPrediction>(mlContext, reuseRowObject: false);

How to get predictedResults?

Was this page helpful?
0 / 5 - 0 ratings