Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create the Binary Classification With Array float values #2952

Closed
vrjesus opened this issue Mar 14, 2019 · 2 comments
Closed

Create the Binary Classification With Array float values #2952

vrjesus opened this issue Mar 14, 2019 · 2 comments

Comments

@vrjesus
Copy link

vrjesus commented Mar 14, 2019

Binary classification

I want create a Machine Learning, but I need use a vector (array) of floats values (through of a sensor). My question is this, each value must be a Column or I must create a single Column with all values separate with a the comma?

@rogancarr
Copy link
Contributor

@vrjesus You can keep your data as an array of floats. You can define a class with a float array and read them into an IDataView.

Define a class like this:

public class MyClass
{
   public float[] MyVector {get; set;}
}

and read it from an Enumerable like this:

var mlContext = new MLContext(seed: 1);
var data = mlContext.Data.LoadFromEnumerable<MyClass>(myStream);

If you have data in a text file, you can look at this sample for how to specify the class such that you can read it in with mlContext.Data.LoadFromTextFile<MyClass>.

@singlis
Copy link
Member

singlis commented Mar 18, 2019

@vrjesus I am closing this issue. If this is not resolved, please re-open.

@singlis singlis closed this as completed Mar 18, 2019
@ghost ghost locked as resolved and limited conversation to collaborators Mar 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants