[SOLVED] Stored procedure as a data source in ML.net?

Issue

is there a way I can pass stored procedure data in DatabaseSource.

Any other way I can load data from stored procedures in ML.net?

var loader = context.Data.
CreateDatabaseLoader<Patient>();

var SPData=(mySPData);

DatabaseSource dbSource =SPData;

IDataView data= loader.Load(dbSource);

Solution

You should be able to as long as you can express it in your query.

https://docs.microsoft.com/dotnet/machine-learning/how-to-guides/load-data-ml-net

One other way to do it would be to execute a query with your stored procedure and map the results to an IEnumerable<T>. Then, load the IEnumerable into an IDataView.

https://docs.microsoft.com/dotnet/machine-learning/how-to-guides/load-data-ml-net#load-data-from-other-sources

Answered By – Luis Quintanilla

Answer Checked By – Robin (BugsFixing Admin)

Leave a Reply

Your email address will not be published. Required fields are marked *