Skip to content

Commit 96ec842

Browse files
authored
Microsoft.ML.Internal.Internallearn namespace requires certain internalization. (#2667)
* Microsoft.ML.Internal.Internallearn namespace requires certain internalization. * PR feedback. * PR feedback.
1 parent a1b66ac commit 96ec842

File tree

5 files changed

+7
-118
lines changed

5 files changed

+7
-118
lines changed

src/Microsoft.ML.Data/Dirty/PredictionUtils.cs

+2-13
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ namespace Microsoft.ML.Internal.Internallearn
1616
/// <summary>
1717
/// Various utilities
1818
/// </summary>
19-
public static class PredictionUtil
19+
[BestFriend]
20+
internal static class PredictionUtil
2021
{
2122
/// <summary>
2223
/// generic method for parsing arguments using CommandLine. If there's a problem, it throws an InvalidOperationException, with a message giving usage.
@@ -152,16 +153,4 @@ public static char SepCharFromString(string s)
152153
}
153154
}
154155
}
155-
156-
/// <summary>
157-
/// A generic reverse Comparer (for use in Array.Sort)
158-
/// </summary>
159-
public sealed class ReverseComparer<T> : IComparer<T>
160-
where T : IComparable<T>
161-
{
162-
public int Compare(T x, T y)
163-
{
164-
return -x.CompareTo(y);
165-
}
166-
}
167156
}

src/Microsoft.ML.Data/Dirty/PredictorInterfaces.cs

+2-7
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,6 @@
1111

1212
namespace Microsoft.ML.Internal.Internallearn
1313
{
14-
15-
/// <summary>
16-
/// Signature for loading from a file name.
17-
/// </summary>
18-
public delegate void SignaturePredictorFromFile(string fileName);
19-
2014
/// <summary>
2115
/// A generic interface for models that can average parameters from multiple instance of self
2216
/// </summary>
@@ -146,7 +140,8 @@ internal interface ICanSaveInSourceCode
146140
/// <summary>
147141
/// Signature for trainers that produce predictors that in turn can be use to score features.
148142
/// </summary>
149-
public delegate void SignatureFeatureScorerTrainer();
143+
[BestFriend]
144+
internal delegate void SignatureFeatureScorerTrainer();
150145

151146
/// <summary>
152147
/// Interface implemented by components that can assign weights to features.

src/Microsoft.ML.Data/Training/EarlyStoppingCriteria.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
namespace Microsoft.ML.Internal.Internallearn
2525
{
26-
public delegate void SignatureEarlyStoppingCriterion(bool lowerIsBetter);
26+
internal delegate void SignatureEarlyStoppingCriterion(bool lowerIsBetter);
2727

2828
// These criteria will be used in FastTree and NeuralNets.
2929
public interface IEarlyStoppingCriterion

src/Microsoft.ML.Data/Utilities/SlotDropper.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ namespace Microsoft.ML.Internal.Internallearn
1212
/// <summary>
1313
/// Drops slots from a fixed or variable sized column based on slot ranges.
1414
/// </summary>
15-
public sealed class SlotDropper
15+
[BestFriend]
16+
internal sealed class SlotDropper
1617
{
1718
private readonly int[] _lengthReduction;
1819

src/Microsoft.ML.Data/Utilities/TypeUtils.cs

-96
This file was deleted.

0 commit comments

Comments
 (0)