Skip to content

Commit

Permalink
Internalize more stray members in the data assembly (#2936)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivanidzo4ka authored and TomFinley committed Mar 13, 2019
1 parent 9d9a3d9 commit b455174
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 11 deletions.
5 changes: 3 additions & 2 deletions src/Microsoft.ML.Data/Commands/EvaluateCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ namespace Microsoft.ML.Data
/// This class contains information about an overall metric, namely its name and whether it is a vector
/// metric or not.
/// </summary>
public sealed class MetricColumn
[BestFriend]
internal sealed class MetricColumn
{
/// <summary>
/// An enum specifying whether the metric should be maximized or minimized while sweeping. 'Info' should be
Expand Down Expand Up @@ -186,7 +187,7 @@ public sealed class Arguments : DataCommand.ArgumentsBase
public string NameColumn = DefaultColumnNames.Name;

[Argument(ArgumentType.LastOccurenceWins, HelpText = "Columns with custom kinds declared through key assignments, for example, col[Kind]=Name to assign column named 'Name' kind 'Kind'",
Name ="CustomColumn", ShortName = "col", SortOrder = 10)]
Name = "CustomColumn", ShortName = "col", SortOrder = 10)]
public KeyValuePair<string, string>[] CustomColumns;

[Argument(ArgumentType.Multiple, HelpText = "Evaluator to use", ShortName = "eval", SignatureType = typeof(SignatureMamlEvaluator))]
Expand Down
3 changes: 2 additions & 1 deletion src/Microsoft.ML.Data/Commands/TrainCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ namespace Microsoft.ML.Data
{
using ColumnRole = RoleMappedSchema.ColumnRole;

public enum NormalizeOption
[BestFriend]
internal enum NormalizeOption
{
No,
Warn,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace Microsoft.ML.Data
/// <summary>
/// The trivial wrapper for a <see cref="IDataLoader{TSource}"/> that acts as an estimator and ignores the source.
/// </summary>
public sealed class TrivialLoaderEstimator<TSource, TLoader> : IDataLoaderEstimator<TSource, TLoader>
internal sealed class TrivialLoaderEstimator<TSource, TLoader> : IDataLoaderEstimator<TSource, TLoader>
where TLoader : IDataLoader<TSource>
{
public TLoader Loader { get; }
Expand Down
3 changes: 2 additions & 1 deletion src/Microsoft.ML.Data/Transforms/SlotsDroppingTransformer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ namespace Microsoft.ML.Transforms
/// If all the slots are to be dropped, a vector valued column will be changed to a vector of length 1 (a scalar column will retain its type) and
/// the value will be the default value.
/// </summary>
public sealed class SlotsDroppingTransformer : OneToOneTransformerBase
[BestFriend]
internal sealed class SlotsDroppingTransformer : OneToOneTransformerBase
{
internal sealed class Options
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,9 +241,10 @@ private static VersionInfo GetVersionInfo()
/// <see cref="Softmax"/>: Generate probability by feeding raw outputs to softmax function. Output is [z_1, ..., z_n], where z_i is exp(y_i) / (exp(y_1) + ... + exp(y_n)).
/// </para>
/// </summary>
public enum OutputFormula { Raw = 0, ProbabilityNormalization = 1, Softmax = 2 };
private readonly DataViewType _outputType;
private DataViewType DistType => _outputType;
[BestFriend]
internal enum OutputFormula { Raw = 0, ProbabilityNormalization = 1, Softmax = 2 };

private DataViewType DistType { get; }

bool ICanSavePfa.CanSavePfa => _impl.CanSavePfa;

Expand Down Expand Up @@ -313,7 +314,7 @@ private OneVersusAllModelParameters(IHostEnvironment env, ImplBase impl)
Host.Assert(Utils.Size(impl.Predictors) > 0);

_impl = impl;
_outputType = new VectorType(NumberDataViewType.Single, _impl.Predictors.Length);
DistType = new VectorType(NumberDataViewType.Single, _impl.Predictors.Length);
}

private OneVersusAllModelParameters(IHostEnvironment env, ModelLoadContext ctx)
Expand All @@ -339,7 +340,7 @@ private OneVersusAllModelParameters(IHostEnvironment env, ModelLoadContext ctx)
_impl = new ImplRaw(predictors);
}

_outputType = new VectorType(NumberDataViewType.Single, _impl.Predictors.Length);
DistType = new VectorType(NumberDataViewType.Single, _impl.Predictors.Length);
}

private static OneVersusAllModelParameters Create(IHostEnvironment env, ModelLoadContext ctx)
Expand Down Expand Up @@ -389,7 +390,7 @@ DataViewType IValueMapper.InputType

DataViewType IValueMapper.OutputType
{
get { return _outputType; }
get { return DistType; }
}
ValueMapper<TIn, TOut> IValueMapper.GetMapper<TIn, TOut>()
{
Expand Down

0 comments on commit b455174

Please sign in to comment.