Skip to content

List Loader #195

Closed
Closed

Description

@Sorrien

I was looking through the ml.net api for a generalized data loader, and I could not find one. So here is my proposal:

Take the following example for the TextLoader:

var dataPath = "intents.txt";
pipeline.Add(new TextLoader<IntentData>(dataPath, separator: "tab"));

I would like to have something like this:

var intents = new List<IntentData();
intents.Add(new IntentData());
pipeline.Add(new ListLoader<IntentData>(intents));

With a generalized loader like this I would have a wider range of sources for my data.

Activity

  1. danmoseley commented on May 21, 2018

    @danmoseley

    We are considering a broader set of loaders. What sources are you interested in using?

  2. GalOshri commented on May 21, 2018

    @GalOshri
    Contributor

    Would something like the CollectionDataSource work for this? See example usage here.

    This is not in the docs yet as it was added after the v0.1 release, but it will be added there soon.

  3. dotChris90 commented on May 21, 2018

    @dotChris90

    I just saw it - what are your ideas about this loaders? Will they all implement the same Interface? In my opinion thats quite important. Just like in EF Core the SQL connectors implement totally the same Interface.

  4. Sorrien commented on May 21, 2018

    @Sorrien
    ContributorAuthor

    I would like to use JSON, SQL, and Entity Framework Core primarily. @danmosemsft

  5. Sorrien commented on May 21, 2018

    @Sorrien
    ContributorAuthor

    @GalOshri That does look a lot like what I want, and I was not aware of that. I look forward to that being added.

  6. veikkoeeva commented on May 21, 2018

    @veikkoeeva
    Contributor

    For relational I'd like to use just plain ADO.NET, possibly Dapper or something alike. In other words, do not make EF a required dependency. :)

  7. Sorrien commented on May 21, 2018

    @Sorrien
    ContributorAuthor

    I'd prefer to be able to pass in data objects as a list to prevent exactly that. So you can use the database wrapper you want to use and then avoid any dependencies.

  8. veikkoeeva commented on May 22, 2018

    @veikkoeeva
    Contributor

    @Sorrien It's a good point. Maybe we should consider IEnumerable, IAsyncEnumerable IObservable (TPL, F# equivalents, what have you, just to make sure the design adapts) also and if it were possibly so the pipeline could drain the source if needed. I'm not sure about Stream. I could imagine there'd be performance issues with larger data sets if it all would be needed in memory up-front.

  9. Sorrien commented on May 22, 2018

    @Sorrien
    ContributorAuthor

    I have now tested CollectionDataSource with the latest build of the project and it is exactly what I was looking for.

  10. added a commit that references this issue on Aug 22, 2019
  11. ghost locked as resolved and limited conversation to collaborators on Mar 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions