Skip to content

Commit 0880a90

Browse files
rgesteveAlexsandrussmichaelgsharp
authored
Onedal algorithms backed by nuget packages (#6521)
Co-authored-by: Alexander Andreev <[email protected]> Co-authored-by: Michael Sharp <[email protected]>
1 parent ff21cc5 commit 0880a90

File tree

41 files changed

+12271
-32
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+12271
-32
lines changed

Microsoft.ML.sln

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Microsoft Visual Studio Solution File, Format Version 12.00
1+
Microsoft Visual Studio Solution File, Format Version 12.00
22
# Visual Studio Version 17
33
VisualStudioVersion = 17.1.32120.378
44
MinimumVisualStudioVersion = 10.0.40219.1
@@ -71,6 +71,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML.ImageAnalytics
7171
EndProject
7272
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML.Mkl.Components", "src\Microsoft.ML.Mkl.Components\Microsoft.ML.Mkl.Components.csproj", "{A7222F41-1CF0-47D9-B80C-B4D77B027A61}"
7373
EndProject
74+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML.OneDal", "src\Microsoft.ML.OneDal\Microsoft.ML.OneDal.csproj", "{A7222F94-2AF1-10C9-A21C-C4D22B137A69}"
75+
EndProject
7476
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML.TensorFlow", "src\Microsoft.ML.TensorFlow\Microsoft.ML.TensorFlow.csproj", "{570A0B8A-5463-44D2-8521-54C0CA4CACA9}"
7577
EndProject
7678
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML.TimeSeries", "src\Microsoft.ML.TimeSeries\Microsoft.ML.TimeSeries.csproj", "{5A79C7F0-3D99-4123-B0DA-7C9FFCD13132}"
@@ -90,6 +92,8 @@ EndProject
9092
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML.Samples", "docs\samples\Microsoft.ML.Samples\Microsoft.ML.Samples.csproj", "{ECB71297-9DF1-48CE-B93A-CD969221F9B6}"
9193
EndProject
9294
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML.SamplesUtils", "src\Microsoft.ML.SamplesUtils\Microsoft.ML.SamplesUtils.csproj", "{11A5210E-2EA7-42F1-80DB-827762E9C781}"
95+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML.Samples.OneDal", "docs\samples\Microsoft.ML.Samples.OneDal\Microsoft.ML.Samples.OneDal.csproj", "{38ED61F4-FA22-4DE9-B0C4-91F327F4EE31}"
96+
EndProject
9397
EndProject
9498
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML.Recommender", "src\Microsoft.ML.Recommender\Microsoft.ML.Recommender.csproj", "{C8E1772B-DFD9-4A4D-830D-6AAB1C668BB3}"
9599
EndProject
@@ -403,6 +407,14 @@ Global
403407
{A7222F41-1CF0-47D9-B80C-B4D77B027A61}.Debug|Any CPU.Build.0 = Debug|Any CPU
404408
{A7222F41-1CF0-47D9-B80C-B4D77B027A61}.Debug|x64.ActiveCfg = Debug|Any CPU
405409
{A7222F41-1CF0-47D9-B80C-B4D77B027A61}.Debug|x64.Build.0 = Debug|Any CPU
410+
{A7222F94-2AF1-10C9-A21C-C4D22B137A69}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
411+
{A7222F94-2AF1-10C9-A21C-C4D22B137A69}.Debug|Any CPU.Build.0 = Debug|Any CPU
412+
{A7222F94-2AF1-10C9-A21C-C4D22B137A69}.Debug|x64.ActiveCfg = Debug|Any CPU
413+
{A7222F94-2AF1-10C9-A21C-C4D22B137A69}.Debug|x64.Build.0 = Debug|Any CPU
414+
{A7222F94-2AF1-10C9-A21C-C4D22B137A69}.Release|Any CPU.ActiveCfg = Release|Any CPU
415+
{A7222F94-2AF1-10C9-A21C-C4D22B137A69}.Release|Any CPU.Build.0 = Release|Any CPU
416+
{A7222F94-2AF1-10C9-A21C-C4D22B137A69}.Release|x64.ActiveCfg = Release|Any CPU
417+
{A7222F94-2AF1-10C9-A21C-C4D22B137A69}.Release|x64.Build.0 = Release|Any CPU
406418
{A7222F41-1CF0-47D9-B80C-B4D77B027A61}.Release|Any CPU.ActiveCfg = Release|Any CPU
407419
{A7222F41-1CF0-47D9-B80C-B4D77B027A61}.Release|Any CPU.Build.0 = Release|Any CPU
408420
{A7222F41-1CF0-47D9-B80C-B4D77B027A61}.Release|x64.ActiveCfg = Release|Any CPU
@@ -747,6 +759,14 @@ Global
747759
{C3D82402-F207-4F19-8C57-5AF0FBAF9682}.Release|Any CPU.Build.0 = Release|Any CPU
748760
{C3D82402-F207-4F19-8C57-5AF0FBAF9682}.Release|x64.ActiveCfg = Release|Any CPU
749761
{C3D82402-F207-4F19-8C57-5AF0FBAF9682}.Release|x64.Build.0 = Release|Any CPU
762+
{38ED61F4-FA22-4DE9-B0C4-91F327F4EE31}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
763+
{38ED61F4-FA22-4DE9-B0C4-91F327F4EE31}.Debug|Any CPU.Build.0 = Debug|Any CPU
764+
{38ED61F4-FA22-4DE9-B0C4-91F327F4EE31}.Debug|x64.ActiveCfg = Debug|Any CPU
765+
{38ED61F4-FA22-4DE9-B0C4-91F327F4EE31}.Debug|x64.Build.0 = Debug|Any CPU
766+
{38ED61F4-FA22-4DE9-B0C4-91F327F4EE31}.Release|Any CPU.ActiveCfg = Release|Any CPU
767+
{38ED61F4-FA22-4DE9-B0C4-91F327F4EE31}.Release|Any CPU.Build.0 = Release|Any CPU
768+
{38ED61F4-FA22-4DE9-B0C4-91F327F4EE31}.Release|x64.ActiveCfg = Release|Any CPU
769+
{38ED61F4-FA22-4DE9-B0C4-91F327F4EE31}.Release|x64.Build.0 = Release|Any CPU
750770
EndGlobalSection
751771
GlobalSection(SolutionProperties) = preSolution
752772
HideSolutionNode = FALSE
@@ -782,6 +802,7 @@ Global
782802
{802233D6-8CC0-46AD-9F23-FEE1E9AED9B3} = {AED9C836-31E3-4F3F-8ABC-929555D3F3C4}
783803
{00E38F77-1E61-4CDF-8F97-1417D4E85053} = {09EADF06-BE25-4228-AB53-95AE3E15B530}
784804
{A7222F41-1CF0-47D9-B80C-B4D77B027A61} = {09EADF06-BE25-4228-AB53-95AE3E15B530}
805+
{A7222F94-2AF1-10C9-A21C-C4D22B137A69} = {09EADF06-BE25-4228-AB53-95AE3E15B530}
785806
{570A0B8A-5463-44D2-8521-54C0CA4CACA9} = {09EADF06-BE25-4228-AB53-95AE3E15B530}
786807
{5A79C7F0-3D99-4123-B0DA-7C9FFCD13132} = {09EADF06-BE25-4228-AB53-95AE3E15B530}
787808
{8C05642D-C3AA-4972-B02C-93681161A6BC} = {09EADF06-BE25-4228-AB53-95AE3E15B530}
@@ -825,6 +846,7 @@ Global
825846
{FF0BD187-4451-4A3B-934B-2AE3454896E2} = {09EADF06-BE25-4228-AB53-95AE3E15B530}
826847
{BBC3A950-BD68-45AC-9DBD-A8F4D8847745} = {09EADF06-BE25-4228-AB53-95AE3E15B530}
827848
{C3D82402-F207-4F19-8C57-5AF0FBAF9682} = {AED9C836-31E3-4F3F-8ABC-929555D3F3C4}
849+
{38ED61F4-FA22-4DE9-B0C4-91F327F4EE31} = {DA452A53-2E94-4433-B08C-041EDEC729E6}
828850
EndGlobalSection
829851
GlobalSection(ExtensibilityGlobals) = postSolution
830852
SolutionGuid = {41165AF1-35BB-4832-A189-73060F82B01D}

README-oneDAL.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# oneDAL supported algorithms
2+
3+
oneAPI Data Analytics Library (oneDAL) is a library providing highly optimized machine learning and data analytics kernels. Some of these kernels is integrated into ML.NET via C++/C# interoperability.
4+
5+
[oneDAL Documentation](http://oneapi-src.github.io/oneDAL/) | [oneDAL Repository](https://github.com/oneapi-src/oneDAL)
6+
7+
> Please note that oneDAL acceleration paths are only available in x64 architectures
8+
9+
Integration consists of:
10+
11+
* A "native" component (under `src/Native/Microsoft.ML.OneDal`) implementing wrapper to pass data and parameters to oneDAL;
12+
* Dispatching to oneDAL kernels inside relevant learners: `OLS` (`src/Microsoft.ML.Mkl.Components`), `Logistic Regression` (`src/Microsoft.ML.StandardTrainers`), `Random Forest` (`src/Microsoft.ML.FastTree`);
13+
14+
## Running ML.NET trainers with dispatching to oneDAL kernels
15+
16+
Currently, dispatching to oneDAL inside ML.NET is regulated by `MLNET_BACKEND` environment variable. If it's set to `ONEDAL`, oneDAL kernel will be used, otherwise - default ML.NET.
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>net7.0</TargetFramework>
6+
<!--This ensures that we can never make the mistake of adding this as a friend assembly. Please don't remove.-->
7+
<PublicSign>false</PublicSign>
8+
</PropertyGroup>
9+
10+
<!--
11+
<ItemGroup>
12+
<Reference Include="Microsoft.ML">
13+
<HintPath>../machinelearning/artifacts/bin/Microsoft.ML/Debug/netstandard2.0/Microsoft.ML.dll</HintPath>
14+
</Reference>
15+
<Reference Include="Microsoft.ML.Core">
16+
<HintPath>../machinelearning/artifacts/bin/Microsoft.ML/Debug/netstandard2.0/Microsoft.ML.Core.dll</HintPath>
17+
</Reference>
18+
<Reference Include="Microsoft.ML.Data">
19+
<HintPath>../machinelearning/artifacts/bin/Microsoft.ML/Debug/netstandard2.0/Microsoft.ML.Data.dll</HintPath>
20+
</Reference>
21+
<Reference Include="Microsoft.ML.Mkl.Components">
22+
<HintPath>../machinelearning/artifacts/bin/Microsoft.ML.Mkl.Components/Debug/netstandard2.0/Microsoft.ML.Mkl.Components.dll</HintPath>
23+
</Reference>
24+
<Reference Include="Microsoft.ML.DataView">
25+
<HintPath>../machinelearning/artifacts/bin/Microsoft.ML/Debug/netstandard2.0/Microsoft.ML.DataView.dll</HintPath>
26+
</Reference>
27+
<Reference Include="Microsoft.ML.Transforms">
28+
<HintPath>../machinelearning/artifacts/bin/Microsoft.ML.Transforms/Debug/netstandard2.0/Microsoft.ML.Transforms.dll</HintPath>
29+
</Reference>
30+
<Reference Include="Microsoft.ML.StandardTrainers">
31+
<HintPath>../machinelearning/artifacts/bin/Microsoft.ML/Debug/netstandard2.0/Microsoft.ML.StandardTrainers.dll</HintPath>
32+
</Reference>
33+
<Reference Include="Microsoft.ML.FastTree">
34+
<HintPath>../machinelearning/artifacts/bin/Microsoft.ML.FastTree/Debug/netstandard2.0/Microsoft.ML.FastTree.dll</HintPath>
35+
</Reference>
36+
<Reference Include="Microsoft.ML.OneDal">
37+
<HintPath>../machinelearning/artifacts/bin/Microsoft.ML.OneDal/Debug/netstandard2.0/Microsoft.ML.OneDal.dll</HintPath>
38+
</Reference>
39+
<PackageReference Include="Newtonsoft.Json" Version="13.0.1"/>
40+
</ItemGroup>
41+
-->
42+
43+
<ItemGroup>
44+
<ProjectReference Include="..\..\..\src\Microsoft.ML.Transforms\Microsoft.ML.Transforms.csproj" />
45+
<ProjectReference Include="..\..\..\src\Microsoft.ML.Core\Microsoft.ML.Core.csproj" />
46+
<ProjectReference Include="..\..\..\src\Microsoft.ML.Data\Microsoft.ML.Data.csproj" />
47+
<ProjectReference Include="..\..\..\src\Microsoft.ML.Mkl.Components\Microsoft.ML.Mkl.Components.csproj" />
48+
<ProjectReference Include="..\..\..\src\Microsoft.ML.StandardTrainers\Microsoft.ML.StandardTrainers.csproj" />
49+
<ProjectReference Include="..\..\..\src\Microsoft.ML.FastTree\Microsoft.ML.FastTree.csproj" />
50+
<ProjectReference Include="..\..\..\src\Microsoft.ML.OneDal\Microsoft.ML.OneDal.csproj" />
51+
<PackageReference Include="Newtonsoft.Json" Version="13.0.1"/>
52+
</ItemGroup>
53+
54+
</Project>
Lines changed: 203 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,203 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using Microsoft.ML;
5+
using Microsoft.ML.Data;
6+
using Microsoft.ML.Trainers;
7+
using Microsoft.ML.Trainers.FastTree;
8+
using Newtonsoft.Json;
9+
10+
namespace Microsoft.ML.Samples.OneDal
11+
{
12+
class Program
13+
{
14+
public static IDataView[] LoadData(
15+
MLContext mlContext, string trainingFile, string testingFile,
16+
string task, string label = "target", char separator = ',')
17+
{
18+
List<IDataView> dataList = new List<IDataView>();
19+
System.IO.StreamReader file = new System.IO.StreamReader(trainingFile);
20+
string header = file.ReadLine();
21+
file.Close();
22+
string[] headerArray = header.Split(separator);
23+
List<TextLoader.Column> columns = new List<TextLoader.Column>();
24+
foreach (string column in headerArray)
25+
{
26+
if (column == label)
27+
{
28+
if (task == "binary")
29+
columns.Add(new TextLoader.Column(column, DataKind.Boolean, Array.IndexOf(headerArray, column)));
30+
else
31+
columns.Add(new TextLoader.Column(column, DataKind.Single, Array.IndexOf(headerArray, column)));
32+
}
33+
else
34+
{
35+
columns.Add(new TextLoader.Column(column, DataKind.Single, Array.IndexOf(headerArray, column)));
36+
}
37+
}
38+
39+
var loader = mlContext.Data.CreateTextLoader(
40+
separatorChar: separator,
41+
hasHeader: true,
42+
columns: columns.ToArray()
43+
);
44+
dataList.Add(loader.Load(trainingFile));
45+
dataList.Add(loader.Load(testingFile));
46+
return dataList.ToArray();
47+
}
48+
49+
public static string[] GetFeaturesArray(IDataView data, string labelName = "target")
50+
{
51+
List<string> featuresList = new List<string>();
52+
var nColumns = data.Schema.Count;
53+
var columnsEnumerator = data.Schema.GetEnumerator();
54+
for (int i = 0; i < nColumns; i++)
55+
{
56+
columnsEnumerator.MoveNext();
57+
if (columnsEnumerator.Current.Name != labelName)
58+
featuresList.Add(columnsEnumerator.Current.Name);
59+
}
60+
61+
return featuresList.ToArray();
62+
}
63+
64+
public static double[] RunRandomForestClassification(MLContext mlContext, IDataView trainingData, IDataView testingData, string labelName, int numberOfTrees, int numberOfLeaves)
65+
{
66+
var featuresArray = GetFeaturesArray(trainingData, labelName);
67+
var preprocessingPipeline = mlContext.Transforms.Concatenate("Features", featuresArray);
68+
var preprocessedTrainingData = preprocessingPipeline.Fit(trainingData).Transform(trainingData);
69+
var preprocessedTestingData = preprocessingPipeline.Fit(trainingData).Transform(testingData);
70+
71+
FastForestBinaryTrainer.Options options = new FastForestBinaryTrainer.Options();
72+
options.LabelColumnName = labelName;
73+
options.FeatureColumnName = "Features";
74+
options.NumberOfTrees = numberOfTrees;
75+
options.NumberOfLeaves = numberOfLeaves;
76+
options.MinimumExampleCountPerLeaf = 5;
77+
options.FeatureFraction = 1.0;
78+
79+
var trainer = mlContext.BinaryClassification.Trainers.FastForest(options);
80+
81+
ITransformer model = trainer.Fit(preprocessedTrainingData);
82+
83+
IDataView trainingPredictions = model.Transform(preprocessedTrainingData);
84+
var trainingMetrics = mlContext.BinaryClassification.EvaluateNonCalibrated(trainingPredictions, labelColumnName: labelName);
85+
IDataView testingPredictions = model.Transform(preprocessedTestingData);
86+
var testingMetrics = mlContext.BinaryClassification.EvaluateNonCalibrated(testingPredictions, labelColumnName: labelName);
87+
88+
double[] metrics = new double[4];
89+
metrics[0] = trainingMetrics.Accuracy;
90+
metrics[1] = testingMetrics.Accuracy;
91+
metrics[2] = trainingMetrics.F1Score;
92+
metrics[3] = testingMetrics.F1Score;
93+
return metrics;
94+
}
95+
96+
public static double[] RunRandomForestRegression(MLContext mlContext, IDataView trainingData, IDataView testingData, string labelName, int numberOfTrees, int numberOfLeaves)
97+
{
98+
var featuresArray = GetFeaturesArray(trainingData, labelName);
99+
var preprocessingPipeline = mlContext.Transforms.Concatenate("Features", featuresArray);
100+
var preprocessedTrainingData = preprocessingPipeline.Fit(trainingData).Transform(trainingData);
101+
var preprocessedTestingData = preprocessingPipeline.Fit(trainingData).Transform(testingData);
102+
103+
FastForestRegressionTrainer.Options options = new FastForestRegressionTrainer.Options();
104+
options.LabelColumnName = labelName;
105+
options.FeatureColumnName = "Features";
106+
options.NumberOfTrees = numberOfTrees;
107+
options.NumberOfLeaves = numberOfLeaves;
108+
options.MinimumExampleCountPerLeaf = 5;
109+
options.FeatureFraction = 1.0;
110+
111+
var trainer = mlContext.Regression.Trainers.FastForest(options);
112+
113+
ITransformer model = trainer.Fit(preprocessedTrainingData);
114+
115+
IDataView trainingPredictions = model.Transform(preprocessedTrainingData);
116+
var trainingMetrics = mlContext.Regression.Evaluate(trainingPredictions, labelColumnName: labelName);
117+
IDataView testingPredictions = model.Transform(preprocessedTestingData);
118+
var testingMetrics = mlContext.Regression.Evaluate(testingPredictions, labelColumnName: labelName);
119+
120+
double[] metrics = new double[4];
121+
metrics[0] = trainingMetrics.RootMeanSquaredError;
122+
metrics[1] = testingMetrics.RootMeanSquaredError;
123+
metrics[2] = trainingMetrics.RSquared;
124+
metrics[3] = testingMetrics.RSquared;
125+
return metrics;
126+
}
127+
128+
public static double[] RunOLSRegression(MLContext mlContext, IDataView trainingData, IDataView testingData, string labelName)
129+
{
130+
var featuresArray = GetFeaturesArray(trainingData, labelName);
131+
var preprocessingPipeline = mlContext.Transforms.Concatenate("Features", featuresArray);
132+
var preprocessedTrainingData = preprocessingPipeline.Fit(trainingData).Transform(trainingData);
133+
var preprocessedTestingData = preprocessingPipeline.Fit(trainingData).Transform(testingData);
134+
135+
OlsTrainer.Options options = new OlsTrainer.Options();
136+
options.LabelColumnName = labelName;
137+
options.FeatureColumnName = "Features";
138+
139+
var trainer = mlContext.Regression.Trainers.Ols(options);
140+
141+
ITransformer model = trainer.Fit(preprocessedTrainingData);
142+
143+
IDataView trainingPredictions = model.Transform(preprocessedTrainingData);
144+
var trainingMetrics = mlContext.Regression.Evaluate(trainingPredictions, labelColumnName: labelName);
145+
IDataView testingPredictions = model.Transform(preprocessedTestingData);
146+
var testingMetrics = mlContext.Regression.Evaluate(testingPredictions, labelColumnName: labelName);
147+
148+
double[] metrics = new double[4];
149+
metrics[0] = trainingMetrics.RootMeanSquaredError;
150+
metrics[1] = testingMetrics.RootMeanSquaredError;
151+
metrics[2] = trainingMetrics.RSquared;
152+
metrics[3] = testingMetrics.RSquared;
153+
return metrics;
154+
}
155+
156+
static void Main(string[] args)
157+
{
158+
// args[0] - training data filename
159+
// args[1] - testing data filename
160+
// args[2] - machine learning task (regression, binary)
161+
// args[3] - machine learning algorithm (RandomForest, OLS)
162+
// Random Forest parameters:
163+
// args[4] - NumberOfTrees
164+
// args[5] - NumberOfLeaves
165+
var mlContext = new MLContext(seed: 42);
166+
// data[0] - training subset
167+
// data[1] - testing subset
168+
IDataView[] data = LoadData(mlContext, args[0], args[1], args[2]);
169+
string labelName = "target";
170+
171+
var mainWatch = System.Diagnostics.Stopwatch.StartNew();
172+
double[] metrics;
173+
if (args[3] == "RandomForest")
174+
{
175+
int numberOfTrees = Int32.Parse(args[4]);
176+
int numberOfLeaves = Int32.Parse(args[5]);
177+
if (args[2] == "binary")
178+
{
179+
180+
metrics = RunRandomForestClassification(mlContext, data[0], data[1], labelName, numberOfTrees, numberOfLeaves);
181+
mainWatch.Stop();
182+
Console.WriteLine("algorithm,all workflow time[ms],training accuracy,testing accuracy,training F1 score,testing F1 score");
183+
Console.WriteLine($"Random Forest Binary,{mainWatch.Elapsed.TotalMilliseconds},{metrics[0]},{metrics[1]},{metrics[2]},{metrics[3]}");
184+
}
185+
else
186+
{
187+
metrics = RunRandomForestRegression(mlContext, data[0], data[1], labelName, numberOfTrees, numberOfLeaves);
188+
mainWatch.Stop();
189+
Console.WriteLine("algorithm,all workflow time[ms],training RMSE,testing RMSE,training R2 score,testing R2 score");
190+
Console.WriteLine($"Random Forest Regression,{mainWatch.Elapsed.TotalMilliseconds},{metrics[0]},{metrics[1]},{metrics[2]},{metrics[3]}");
191+
}
192+
}
193+
else if (args[3] == "OLS")
194+
{
195+
metrics = RunOLSRegression(mlContext, data[0], data[1], labelName);
196+
mainWatch.Stop();
197+
Console.WriteLine("algorithm,all workflow time[ms],training RMSE,testing RMSE,training R2 score,testing R2 score");
198+
Console.WriteLine($"OLS Regression,{mainWatch.Elapsed.TotalMilliseconds},{metrics[0]},{metrics[1]},{metrics[2]},{metrics[3]}");
199+
}
200+
}
201+
}
202+
}
203+
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
numpy
2+
pandas
3+
scikit-learn

0 commit comments

Comments
 (0)