Skip to content

Commit e7a57a1

Browse files
daholsteDmitry-A
authored andcommitted
Seal API classes (and make EnableCaching internal) (dotnet#217)
1 parent b0b0e87 commit e7a57a1

9 files changed

+12
-14
lines changed

src/Microsoft.ML.Auto/API/AutoInferenceCatalog.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
namespace Microsoft.ML.Auto
88
{
9-
public class AutoInferenceCatalog
9+
public sealed class AutoInferenceCatalog
1010
{
1111
private readonly MLContext _context;
1212

src/Microsoft.ML.Auto/API/BinaryClassificationExperiment.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
namespace Microsoft.ML.Auto
1212
{
13-
public class BinaryExperimentSettings : ExperimentSettings
13+
public sealed class BinaryExperimentSettings : ExperimentSettings
1414
{
1515
public IProgress<RunResult<BinaryClassificationMetrics>> ProgressCallback;
1616
public BinaryClassificationMetric OptimizingMetric = BinaryClassificationMetric.Accuracy;
@@ -42,7 +42,7 @@ public enum BinaryClassificationTrainer
4242
SymbolicStochasticGradientDescent,
4343
}
4444

45-
public class BinaryClassificationExperiment
45+
public sealed class BinaryClassificationExperiment
4646
{
4747
private readonly MLContext _context;
4848
private readonly BinaryExperimentSettings _settings;

src/Microsoft.ML.Auto/API/ColumnInference.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77

88
namespace Microsoft.ML.Auto
99
{
10-
public class ColumnInferenceResults
10+
public sealed class ColumnInferenceResults
1111
{
1212
public TextLoader.Arguments TextLoaderArgs { get; set; }
1313
public ColumnInformation ColumnInformation { get; set; }
1414
}
1515

16-
public class ColumnInformation
16+
public sealed class ColumnInformation
1717
{
1818
public string LabelColumn = DefaultColumnNames.Label;
1919
public string WeightColumn;

src/Microsoft.ML.Auto/API/ExperimentSettings.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ namespace Microsoft.ML.Auto
99
public class ExperimentSettings
1010
{
1111
public uint MaxInferenceTimeInSeconds = 24 * 60 * 60;
12-
public bool EnableCaching;
1312
public CancellationToken CancellationToken;
1413

14+
internal bool EnableCaching;
1515
internal int MaxModels = int.MaxValue;
1616
internal IDebugLogger DebugLogger;
1717
}

src/Microsoft.ML.Auto/API/InferenceException.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public enum InferenceType
1313
Label,
1414
}
1515

16-
public class InferenceException : Exception
16+
public sealed class InferenceException : Exception
1717
{
1818
public InferenceType InferenceType;
1919

src/Microsoft.ML.Auto/API/MLContextExtension.cs

-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// See the LICENSE file in the project root for more information.
44

5-
using System.Threading;
6-
75
namespace Microsoft.ML.Auto
86
{
97
public static class MLContextExtension

src/Microsoft.ML.Auto/API/MulticlassClassificationExperiment.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
namespace Microsoft.ML.Auto
1212
{
13-
public class MulticlassExperimentSettings : ExperimentSettings
13+
public sealed class MulticlassExperimentSettings : ExperimentSettings
1414
{
1515
public IProgress<RunResult<MultiClassClassifierMetrics>> ProgressCallback;
1616
public MulticlassClassificationMetric OptimizingMetric = MulticlassClassificationMetric.AccuracyMicro;
@@ -40,7 +40,7 @@ public enum MulticlassClassificationTrainer
4040
SymbolicStochasticGradientDescentOVA,
4141
}
4242

43-
public class MulticlassClassificationExperiment
43+
public sealed class MulticlassClassificationExperiment
4444
{
4545
private readonly MLContext _context;
4646
private readonly MulticlassExperimentSettings _settings;

src/Microsoft.ML.Auto/API/RegressionExperiment.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
namespace Microsoft.ML.Auto
1212
{
13-
public class RegressionExperimentSettings : ExperimentSettings
13+
public sealed class RegressionExperimentSettings : ExperimentSettings
1414
{
1515
public IProgress<RunResult<RegressionMetrics>> ProgressCallback;
1616
public RegressionMetric OptimizingMetric = RegressionMetric.RSquared;
@@ -37,7 +37,7 @@ public enum RegressionTrainer
3737
StochasticDualCoordinateAscent,
3838
}
3939

40-
public class RegressionExperiment
40+
public sealed class RegressionExperiment
4141
{
4242
private readonly MLContext _context;
4343
private readonly RegressionExperimentSettings _settings;

src/Microsoft.ML.Auto/API/RunResult.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
namespace Microsoft.ML.Auto
99
{
10-
public class RunResult<T>
10+
public sealed class RunResult<T>
1111
{
1212
public readonly T Metrics;
1313
public readonly ITransformer Model;

0 commit comments

Comments
 (0)