Skip to content

Commit 9b7eab3

Browse files
committed
moving Ols to a separate project
1 parent dcc8ae8 commit 9b7eab3

File tree

12 files changed

+68
-280
lines changed

12 files changed

+68
-280
lines changed

Microsoft.ML.sln

+11
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML.CodeAnalyzer",
9797
EndProject
9898
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML.CodeAnalyzer.Tests", "test\Microsoft.ML.CodeAnalyzer.Tests\Microsoft.ML.CodeAnalyzer.Tests.csproj", "{3E4ABF07-7970-4BE6-B45B-A13D3C397545}"
9999
EndProject
100+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML.AdditionalLearners", "src\Microsoft.ML.AdditionalLearners\Microsoft.ML.AdditionalLearners.csproj", "{A5C185B3-514F-4594-B5DE-73A65EB47792}"
101+
EndProject
100102
Global
101103
GlobalSection(SolutionConfigurationPlatforms) = preSolution
102104
Debug|Any CPU = Debug|Any CPU
@@ -329,6 +331,14 @@ Global
329331
{3E4ABF07-7970-4BE6-B45B-A13D3C397545}.Release|Any CPU.Build.0 = Release|Any CPU
330332
{3E4ABF07-7970-4BE6-B45B-A13D3C397545}.Release-Intrinsics|Any CPU.ActiveCfg = Release|Any CPU
331333
{3E4ABF07-7970-4BE6-B45B-A13D3C397545}.Release-Intrinsics|Any CPU.Build.0 = Release|Any CPU
334+
{A5C185B3-514F-4594-B5DE-73A65EB47792}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
335+
{A5C185B3-514F-4594-B5DE-73A65EB47792}.Debug|Any CPU.Build.0 = Debug|Any CPU
336+
{A5C185B3-514F-4594-B5DE-73A65EB47792}.Debug-Intrinsics|Any CPU.ActiveCfg = Debug|Any CPU
337+
{A5C185B3-514F-4594-B5DE-73A65EB47792}.Debug-Intrinsics|Any CPU.Build.0 = Debug|Any CPU
338+
{A5C185B3-514F-4594-B5DE-73A65EB47792}.Release|Any CPU.ActiveCfg = Release|Any CPU
339+
{A5C185B3-514F-4594-B5DE-73A65EB47792}.Release|Any CPU.Build.0 = Release|Any CPU
340+
{A5C185B3-514F-4594-B5DE-73A65EB47792}.Release-Intrinsics|Any CPU.ActiveCfg = Release|Any CPU
341+
{A5C185B3-514F-4594-B5DE-73A65EB47792}.Release-Intrinsics|Any CPU.Build.0 = Release|Any CPU
332342
EndGlobalSection
333343
GlobalSection(SolutionProperties) = preSolution
334344
HideSolutionNode = FALSE
@@ -367,6 +377,7 @@ Global
367377
{BF66A305-DF10-47E4-8D81-42049B149D2B} = {D3D38B03-B557-484D-8348-8BADEE4DF592}
368378
{B4E55B2D-2A92-46E7-B72F-E76D6FD83440} = {7F13E156-3EBA-4021-84A5-CD56BA72F99E}
369379
{3E4ABF07-7970-4BE6-B45B-A13D3C397545} = {AED9C836-31E3-4F3F-8ABC-929555D3F3C4}
380+
{A5C185B3-514F-4594-B5DE-73A65EB47792} = {09EADF06-BE25-4228-AB53-95AE3E15B530}
370381
EndGlobalSection
371382
GlobalSection(ExtensibilityGlobals) = postSolution
372383
SolutionGuid = {41165AF1-35BB-4832-A189-73060F82B01D}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>netstandard2.0</TargetFramework>
5+
<IncludeInPackage>Microsoft.ML.AdditionalLearners</IncludeInPackage>
6+
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
7+
</PropertyGroup>
8+
9+
<ItemGroup>
10+
<ProjectReference Include="..\Microsoft.ML.Core\Microsoft.ML.Core.csproj" />
11+
<ProjectReference Include="..\Microsoft.ML.Data\Microsoft.ML.Data.csproj" />
12+
<ProjectReference Include="..\Microsoft.ML.StandardLearners\Microsoft.ML.StandardLearners.csproj" />
13+
<ProjectReference Include="..\Microsoft.ML\Microsoft.ML.csproj" />
14+
<PackageReference Include="MlNetMklDeps" Version="$(MlNetMklDepsPackageVersion)" />
15+
</ItemGroup>
16+
17+
</Project>

src/Microsoft.ML.StandardLearners/Standard/OlsLinearRegression.cs renamed to src/Microsoft.ML.AdditionalLearners/OlsLinearRegression.cs

+5-4
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,15 @@
77
using System;
88
using System.Collections.Generic;
99
using System.IO;
10-
using Microsoft.ML.Runtime.Internal.Internallearn;
1110
using Microsoft.ML.Runtime;
11+
using Microsoft.ML.Runtime.AdditionalLearners;
12+
using Microsoft.ML.Runtime.Internal.Internallearn;
13+
using Microsoft.ML.Runtime.Internal.Utilities;
1214
using Microsoft.ML.Runtime.CommandLine;
1315
using Microsoft.ML.Runtime.Data;
1416
using Microsoft.ML.Runtime.EntryPoints;
1517
using Microsoft.ML.Runtime.Learners;
1618
using Microsoft.ML.Runtime.Model;
17-
using Microsoft.ML.Runtime.Internal.Utilities;
1819
using Microsoft.ML.Runtime.Training;
1920
using System.Runtime.InteropServices;
2021

@@ -30,7 +31,7 @@
3031

3132
[assembly: LoadableClass(typeof(void), typeof(OlsLinearRegressionTrainer), null, typeof(SignatureEntryPointModule), OlsLinearRegressionTrainer.LoadNameValue)]
3233

33-
namespace Microsoft.ML.Runtime.Learners
34+
namespace Microsoft.ML.Runtime.AdditionalLearners
3435
{
3536
/// <include file='doc.xml' path='doc/members/member[@name="OLS"]/*' />
3637
public sealed class OlsLinearRegressionTrainer : TrainerBase<OlsLinearRegressionPredictor>
@@ -329,7 +330,7 @@ private OlsLinearRegressionPredictor TrainCore(IChannel ch, FloatLabelCursor.Fac
329330

330331
internal static class Mkl
331332
{
332-
private const string DllName = "Microsoft.ML.MklImports.dll";
333+
private const string DllName = "Microsoft.ML.MklImports";
333334

334335
public enum Layout
335336
{
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<doc>
3+
<members>
4+
5+
<member name="OLS">
6+
<summary>
7+
Train an OLS regression model.
8+
</summary>
9+
<remarks>
10+
<a href='https://en.wikipedia.org/wiki/Ordinary_least_squares'>Ordinary least squares (OLS)</a> is a parameterized regression method.
11+
It assumes that the conditional mean of the dependent variable follows a linear function of the dependent variables.
12+
The parameters of the regressor can be estimated by minimizing the squares of the difference between observed values and the predictions.
13+
</remarks>
14+
<example>
15+
<code language="csharp">
16+
new OrdinaryLeastSquaresRegressor
17+
{
18+
L2Weight = 0.1,
19+
PerParameterSignificance = false,
20+
NormalizeFeatures = Microsoft.ML.Models.NormalizeOption.Yes
21+
}
22+
</code>
23+
</example>
24+
</member>
25+
26+
</members>
27+
</doc>

src/Microsoft.ML.PCA/PcaTrainer.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ private static VBuffer<Float>[] GaussianMatrix(int k, int d, int seed)
179179
var rng = new SysRandom(seed);
180180

181181
// REVIEW: use a faster Gaussian random matrix generator
182-
//MKL has a fast vectorized random number generation.
182+
// MKL has a fast vectorized random number generation.
183183
for (var i = 0; i < k; ++i)
184184
{
185185
for (var j = 0; j < d; ++j)

src/Microsoft.ML.StandardLearners/Microsoft.ML.StandardLearners.csproj

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
<ProjectReference Include="..\Microsoft.ML.CpuMath\Microsoft.ML.CpuMath.csproj" />
1212
<ProjectReference Include="..\Microsoft.ML.Data\Microsoft.ML.Data.csproj" />
1313
<ProjectReference Include="..\Microsoft.ML\Microsoft.ML.csproj" />
14-
<PackageReference Include="MlNetMklDeps" Version="$(MlNetMklDepsPackageVersion)" />
1514
</ItemGroup>
1615

1716
</Project>

0 commit comments

Comments
 (0)