-
Notifications
You must be signed in to change notification settings - Fork 1
Description
Hi,
I have one C# project, I want to use one self-contained dataset to calculate the MaxScore & MinScore for one table tennis game using the current score. For example, if the current score is: 2-0; the home player leads by 2 points, then the MaxScore is (if we don't consider if both sides have 10-10 tie): 13=11 + 2, it means if the final score is: 2-11. The MinScore is: 11, it means the final score is: 11-0, the away player did not score any point.
And I have one SQL Server data table called: PingPongTotalBet, which has the following C# class: public class PingPongTotalBet
{
public int ScoreID { get; set; }
public int Score1 { get; set; }
public int Score2 { get; set; }
public int MaxScore { get; set; }
public int MinScore { get; set; }
}
=> SELECT Count(*) FROM PingPongTotalBet => It has only 144 records for this data table.
I want to know which Machine Learning Algorithm can be used to train such model, I want to use all the 144 data as training data, and use any of 144 of the training data for some testing. So, the dataset is self-contained.
But I don't have much experience for machine learning, I have some C# code for using MS machine learning nuget package: public class MLMaxTotalSet
{
[LoadColumn(0)]
public float Score1;
[LoadColumn(1)]
public float Score2;
[LoadColumn(2)]
public float MaxScore;
}
public class MLMinTotalSet
{
[LoadColumn(0)]
public float Score1;
[LoadColumn(1)]
public float Score2;
[LoadColumn(2)]
public float MinScore;
}
public class PointsPrediction
{
[ColumnName("Score")]
public float Score;
}
But when I did some testing, the results are not very good, it always return something not exactly as the training data, I want to get the integer test results, not the double or float test results.
But I don't know your repo yet. Could you provide some instructions on how to write C# code to train a model. The following is C# code to train MS Machine Learning for this: public static void TrainMaxModel()
{
MLContext mlContext = new MLContext();
List dataMax = Max_PingPong_Train_Set();
IDataView dataViewMax = mlContext.Data.LoadFromEnumerable(dataMax);
var trainer = mlContext.Regression.Trainers.FastTree(labelColumnName: "MaxScore", numberOfLeaves: 20, learningRate: 0.1);
var dataProcessPipeline = mlContext.Transforms.Conversion.MapValueToKey("MaxScore")
.Append(mlContext.Transforms.Concatenate("Features", "Score1", "Score2"))
.Append(mlContext.Transforms.Conversion.MapKeyToValue("MaxScore"));
var trainingPipelineMax = dataProcessPipeline.Append(trainer);
var modelMax = trainingPipelineMax.Fit(dataViewMax);
mlContext.Model.Save(modelMax, dataViewMax.Schema, MaxTotalModel);
}
=> The result is ok, but not very good. Any suggestion on if I can use your repo to do the same?