This is not issue - How can I get more learners/Algorithms?
Hi Team,
I am .NET developer and ML.NET is great start for me to learn Machine Learning.
Being .NET developer, I always wanted to do ML in .NET and find TensorFlow and other libraries difficult to understand on first glance.
To learn ML.NET, I am working on prediction model, best use case would be Stock prediction. As I can easily get historical data.
I have following questions,
-
What is the best algorithm in ML.NET for such use case? In TensorFlow and other libraries, I can see LSTM, Time Series Model and ARIMA etc...
-
How can I use one of the below in ML.NET? If available or what is alternative available?
- ARIMA Model
- Long Short Term Memory
- Neural Net - Neural Network for prediction
-
How can I use ML.NET for Neural Network? For above use case? I know below URL but I don't find proper use cases that will explain when to use which trainer. https://docs.microsoft.com/en-us/dotnet/api/microsoft.ml.trainers?view=ml-dotnet
-
Rather than predicting single output value, how can I predict series of values i.e. stock prices for next weeks or month?
I am very much interested in ML.NET but being newbie I don't know from where to start. Learning things by implementing is best way and that is why I have choose Stock Prediction.
Regards, Parag
Hi, I am getting predicted value 0. What I am doing wrong in below sample?
using System; using System.IO; using Microsoft.ML; using Microsoft.ML.Data; using Microsoft.ML.Models; using Microsoft.ML.Runtime.Api; using Microsoft.ML.Trainers; using Microsoft.ML.Transforms;
namespace MLPredictionDemo { class Program {
static void Main(string[] args)
{
string dataPath = "inputData.csv";
var pipeline = new LearningPipeline();
pipeline.Add(new TextLoader(dataPath).CreateFrom<InputData>(useHeader:false, separator: ','));
pipeline.Add(new ColumnCopier(("Close", "Label")));
pipeline.Add(new ColumnConcatenator("Features", "Day", "Open", "High", "Low"));
pipeline.Add(new StochasticDualCoordinateAscentRegressor());
var model = pipeline.Train<InputData, outputPrediction>();
var testData = new TextLoader("testData.csv").CreateFrom<InputData>(useHeader:false, separator: ',');
var evaluator = new RegressionEvaluator();
var metrics = evaluator.Evaluate(model, testData);
Console.WriteLine($"RMS - { metrics.Rms}");
Console.WriteLine($"R^2 - { metrics.RSquared}");
var prediction = model.Predict(new InputData()
{
Day = 5616,
Open = 523f,
High = 592f,
Low = 521f
});
Console.WriteLine($"Predicted Price is : {prediction.Close}");
Console.ReadLine();
}
}
public class InputData
{
[Column("0")]
public float Day;
[Column("1")]
public float Open;
[Column("2")]
public float High;
[Column("3")]
public float Low;
[Column("4")]
public float Close;
}
public class outputPrediction
{
[ColumnName("Close")]
public float Close;
}
}
My sample input data is in below format (Headers are added just for understanding, actual input data don't have headers)
Day,Open,High,Low,Close 1,422,438.75,421.05,436.8 2,420.5,429.9,413.95,419.9 3,438,441.5,427,429.3 4,436.35,447,434.5,442.45 5,430,438.4,426.5,434.1 6,436.9,437.5,415.8,430.2 7,413.6,434.75,412.6,431.6 8,412,422.65,408.35,412.4 9,405.2,418.1,402.1,410.55 10,421,422.4,399.4,408.2 11,412,424.9,410.7,421.6 12,422,425,407,413.9 13,397.25,425.35,397.25,421.95 14,385,401.5,383.5,394 15,379.95,386.2,373.25,384.1
change your outputPrediction class to following:
public class outputPrediction
{
[ColumnName("Score")]
public float Close;
}
Regarding more algorithms, we have time series transforms and learners internally, we just need to open source them. previously we got blocked by absence of MKL library, but it's not a issue anymore. Neural networks, it's a bit hard (see CNTK) to support full framework for Neural nets, so we exploring our options regarding integration of current ones.
In current moment we more focused on our API, since this pipeline thingy is quite limited, and suit only simple needs. So we want to have proper API right now.
@parag-patil I'll mark this issue as closed, but feel free to reopen if you want to continue discussing.