Skip to content

transform and trainer namespaces don't need to follow the catalogs #2755

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Feb 27, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using System.Collections.Generic;
using Microsoft.ML.Data;
using Microsoft.ML.Transforms.Conversions;
using Microsoft.ML.Transforms;

namespace Microsoft.ML.Samples.Dynamic
{
Expand Down
2 changes: 1 addition & 1 deletion docs/samples/Microsoft.ML.Samples/Dynamic/Normalizer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.Collections.Generic;
using System.Linq;
using Microsoft.ML.Data;
using Microsoft.ML.Transforms.Normalizers;
using Microsoft.ML.Transforms;

namespace Microsoft.ML.Samples.Dynamic
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public static void Example()
//0.165 0.117 -0.547 0.014

// A pipeline to project Features column into L-p normalized vector.
var lpNormalizePipeline = ml.Transforms.Projection.LpNormalize(nameof(SamplesUtils.DatasetUtils.SampleVectorOfNumbersData.Features), normKind: Transforms.Projections.LpNormalizingEstimatorBase.NormalizerKind.L1Norm);
var lpNormalizePipeline = ml.Transforms.Projection.LpNormalize(nameof(SamplesUtils.DatasetUtils.SampleVectorOfNumbersData.Features), normKind: Transforms.LpNormalizingEstimatorBase.NormalizerKind.L1Norm);
// The transformed (projected) data.
transformedData = lpNormalizePipeline.Fit(trainData).Transform(trainData);
// Getting the data of the newly created column, so we can preview it.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Microsoft.ML;
using Microsoft.ML.Trainers.Online;
using Microsoft.ML.Trainers;

namespace Microsoft.ML.Samples.Dynamic.Trainers.BinaryClassification
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using System.Linq;
using Microsoft.ML.Data;
using Microsoft.ML.Trainers.FactorizationMachine;
using Microsoft.ML.Trainers;

namespace Microsoft.ML.Samples.Dynamic
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Microsoft.ML.Transforms.Categorical;
using Microsoft.ML.Transforms;

namespace Microsoft.ML.Samples.Dynamic.Trainers.BinaryClassification
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public static void Example()

// A pipeline to project Features column into white noise vector.
var whiteningPipeline = ml.Transforms.Projection.VectorWhiten(nameof(SamplesUtils.DatasetUtils.SampleVectorOfNumbersData.Features),
kind: Transforms.Projections.WhiteningKind.Zca);
kind: Transforms.WhiteningKind.Zca);
// The transformed (projected) data.
var transformedData = whiteningPipeline.Fit(trainData).Transform(trainData);
// Getting the data of the newly created column, so we can preview it.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ public static void Example()


// A pipeline to project Features column into white noise vector.
var whiteningPipeline = ml.Transforms.Projection.VectorWhiten(new Transforms.Projections.VectorWhiteningEstimator.ColumnOptions(
nameof(SamplesUtils.DatasetUtils.SampleVectorOfNumbersData.Features), kind: Transforms.Projections.WhiteningKind.Pca, pcaNum: 4));
var whiteningPipeline = ml.Transforms.Projection.VectorWhiten(new Transforms.VectorWhiteningEstimator.ColumnOptions(
nameof(SamplesUtils.DatasetUtils.SampleVectorOfNumbersData.Features), kind: Transforms.WhiteningKind.Pca, pcaNum: 4));
// The transformed (projected) data.
var transformedData = whiteningPipeline.Fit(trainData).Transform(trainData);
// Getting the data of the newly created column, so we can preview it.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
using System;
using System.Collections.Generic;
using Microsoft.Data.DataView;
using Microsoft.ML.Data;
using Microsoft.ML.Transforms.Conversions;

namespace Microsoft.ML.Samples.Dynamic
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
using System;
using System.Collections.Generic;
using Microsoft.Data.DataView;
using Microsoft.ML.Data;
using Microsoft.ML.Transforms.Conversions;

namespace Microsoft.ML.Samples.Dynamic
{
Expand Down
1 change: 0 additions & 1 deletion src/Microsoft.ML.Data/Commands/CrossValidationCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
using Microsoft.ML.Data;
using Microsoft.ML.Internal.Utilities;
using Microsoft.ML.Transforms;
using Microsoft.ML.Transforms.Conversions;

[assembly: LoadableClass(typeof(CrossValidationCommand), typeof(CrossValidationCommand.Arguments), typeof(SignatureCommand),
"Cross Validation", CrossValidationCommand.LoadName)]
Expand Down
2 changes: 1 addition & 1 deletion src/Microsoft.ML.Data/Commands/TrainCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
using Microsoft.ML.Data.IO;
using Microsoft.ML.Internal.Utilities;
using Microsoft.ML.Model;
using Microsoft.ML.Transforms.Normalizers;
using Microsoft.ML.Transforms;

[assembly: LoadableClass(TrainCommand.Summary, typeof(TrainCommand), typeof(TrainCommand.Arguments), typeof(SignatureCommand),
"Train Predictor", "Train")]
Expand Down
3 changes: 1 addition & 2 deletions src/Microsoft.ML.Data/Evaluators/ClusteringEvaluator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@
using Microsoft.ML.Data;
using Microsoft.ML.EntryPoints;
using Microsoft.ML.Internal.Utilities;
using Microsoft.ML.Model;
using Microsoft.ML.Numeric;
using Microsoft.ML.Transforms.FeatureSelection;
using Microsoft.ML.Transforms;

[assembly: LoadableClass(typeof(ClusteringEvaluator), typeof(ClusteringEvaluator), typeof(ClusteringEvaluator.Arguments), typeof(SignatureEvaluator),
"Clustering Evaluator", ClusteringEvaluator.LoadName, "Clustering")]
Expand Down
1 change: 0 additions & 1 deletion src/Microsoft.ML.Data/Evaluators/EvaluatorUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
using Microsoft.ML.Data.IO;
using Microsoft.ML.Internal.Utilities;
using Microsoft.ML.Transforms;
using Microsoft.ML.Transforms.Conversions;

namespace Microsoft.ML.Data
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@
using Microsoft.ML.Data;
using Microsoft.ML.EntryPoints;
using Microsoft.ML.Internal.Utilities;
using Microsoft.ML.Model;
using Microsoft.ML.Transforms;
using Microsoft.ML.Transforms.FeatureSelection;

[assembly: LoadableClass(typeof(MultiClassClassifierEvaluator), typeof(MultiClassClassifierEvaluator), typeof(MultiClassClassifierEvaluator.Arguments), typeof(SignatureEvaluator),
"Multi-Class Classifier Evaluator", MultiClassClassifierEvaluator.LoadName, "MultiClassClassifier", "MultiClass")]
Expand Down
1 change: 0 additions & 1 deletion src/Microsoft.ML.Data/TrainCatalog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
using Microsoft.Data.DataView;
using Microsoft.ML.Data;
using Microsoft.ML.Transforms;
using Microsoft.ML.Transforms.Conversions;

namespace Microsoft.ML
{
Expand Down
2 changes: 1 addition & 1 deletion src/Microsoft.ML.Data/Transforms/ColumnBindingsBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
using Microsoft.Data.DataView;
using Microsoft.ML.CommandLine;
using Microsoft.ML.Internal.Utilities;
using Microsoft.ML.Transforms.Conversions;
using Microsoft.ML.Transforms;

namespace Microsoft.ML.Data
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using System.Collections.Generic;
using Microsoft.Data.DataView;
using Microsoft.ML.Data;
using Microsoft.ML.Transforms.Conversions;
using Microsoft.ML.Transforms;

namespace Microsoft.ML
{
Expand Down
1 change: 1 addition & 0 deletions src/Microsoft.ML.Data/Transforms/ExplainabilityCatalog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

using Microsoft.ML.Data;
using Microsoft.ML.Model;
using Microsoft.ML.Transforms;

namespace Microsoft.ML
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
using Microsoft.ML.CommandLine;
using Microsoft.ML.Data;
using Microsoft.ML.EntryPoints;
using Microsoft.ML.Internal.Internallearn;
using Microsoft.ML.Internal.Utilities;
using Microsoft.ML.Model;
using Microsoft.ML.Transforms;

[assembly: LoadableClass(FeatureContributionCalculatingTransformer.Summary, typeof(FeatureContributionCalculatingTransformer), null, typeof(SignatureLoadModel),
FeatureContributionCalculatingTransformer.FriendlyName, FeatureContributionCalculatingTransformer.LoaderSignature)]
Expand All @@ -22,7 +22,7 @@

[assembly: LoadableClass(typeof(void), typeof(FeatureContributionEntryPoint), null, typeof(SignatureEntryPointModule), FeatureContributionCalculatingTransformer.LoaderSignature)]

namespace Microsoft.ML.Data
namespace Microsoft.ML.Transforms
Copy link
Member Author

@sfilipi sfilipi Feb 27, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note, this is the only class that moved from ML.Data ->ML.Transforms.

Everythign else was a sub-namespace of ML.Transforms or ML.Trainers #WontFix

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh geez. That's good that you caught it!

{
/// <summary>
/// The FeatureContributionCalculationTransformer computes model-specific per-feature contributions to the score of each example.
Expand Down
5 changes: 2 additions & 3 deletions src/Microsoft.ML.Data/Transforms/Hashing.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
using Microsoft.ML.CommandLine;
using Microsoft.ML.Data;
using Microsoft.ML.Internal.Utilities;
using Microsoft.ML.Model;
using Microsoft.ML.Transforms.Conversions;
using Microsoft.ML.Transforms;

[assembly: LoadableClass(HashingTransformer.Summary, typeof(IDataTransform), typeof(HashingTransformer), typeof(HashingTransformer.Options), typeof(SignatureDataTransform),
"Hash Transform", "HashTransform", "Hash", DocName = "transform/HashTransform.md")]
Expand All @@ -27,7 +26,7 @@
[assembly: LoadableClass(typeof(IRowMapper), typeof(HashingTransformer), null, typeof(SignatureLoadRowMapper),
"Hash Transform", HashingTransformer.LoaderSignature)]

namespace Microsoft.ML.Transforms.Conversions
namespace Microsoft.ML.Transforms
{
/// <summary>
/// This transformer can hash either single valued columns or vector columns. For vector columns,
Expand Down
1 change: 0 additions & 1 deletion src/Microsoft.ML.Data/Transforms/InvertHashUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
using Microsoft.Data.DataView;
using Microsoft.ML.Data.IO;
using Microsoft.ML.Internal.Utilities;
using Microsoft.ML.Model;

namespace Microsoft.ML.Data
{
Expand Down
5 changes: 2 additions & 3 deletions src/Microsoft.ML.Data/Transforms/KeyToValue.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@
using Microsoft.ML.Data;
using Microsoft.ML.EntryPoints;
using Microsoft.ML.Internal.Utilities;
using Microsoft.ML.Model;
using Microsoft.ML.Model.Pfa;
using Microsoft.ML.Transforms.Conversions;
using Microsoft.ML.Transforms;
using Newtonsoft.Json.Linq;

[assembly: LoadableClass(typeof(IDataTransform), typeof(KeyToValueMappingTransformer), typeof(KeyToValueMappingTransformer.Options), typeof(SignatureDataTransform),
Expand All @@ -30,7 +29,7 @@
[assembly: LoadableClass(typeof(IRowMapper), typeof(KeyToValueMappingTransformer), null, typeof(SignatureLoadRowMapper),
KeyToValueMappingTransformer.UserName, KeyToValueMappingTransformer.LoaderSignature)]

namespace Microsoft.ML.Transforms.Conversions
namespace Microsoft.ML.Transforms
{
/// <summary>
/// KeyToValueTransform utilizes KeyValues metadata to map key indices to the corresponding values in the KeyValues metadata.
Expand Down
5 changes: 2 additions & 3 deletions src/Microsoft.ML.Data/Transforms/KeyToVector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,9 @@
using Microsoft.ML.CommandLine;
using Microsoft.ML.Data;
using Microsoft.ML.Internal.Utilities;
using Microsoft.ML.Model;
using Microsoft.ML.Model.OnnxConverter;
using Microsoft.ML.Model.Pfa;
using Microsoft.ML.Transforms.Conversions;
using Microsoft.ML.Transforms;
using Newtonsoft.Json.Linq;

[assembly: LoadableClass(KeyToVectorMappingTransformer.Summary, typeof(IDataTransform), typeof(KeyToVectorMappingTransformer), typeof(KeyToVectorMappingTransformer.Options), typeof(SignatureDataTransform),
Expand All @@ -29,7 +28,7 @@
[assembly: LoadableClass(typeof(IRowMapper), typeof(KeyToVectorMappingTransformer), null, typeof(SignatureLoadRowMapper),
KeyToVectorMappingTransformer.UserName, KeyToVectorMappingTransformer.LoaderSignature)]

namespace Microsoft.ML.Transforms.Conversions
namespace Microsoft.ML.Transforms
{
/// <summary>
/// Converts the key types back to their original vectors.
Expand Down
5 changes: 2 additions & 3 deletions src/Microsoft.ML.Data/Transforms/NormalizeColumn.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@
using Microsoft.ML.Data;
using Microsoft.ML.EntryPoints;
using Microsoft.ML.Internal.Internallearn;
using Microsoft.ML.Model;
using Microsoft.ML.Model.OnnxConverter;
using Microsoft.ML.Model.Pfa;
using Microsoft.ML.Transforms.Normalizers;
using Microsoft.ML.Transforms;
using Newtonsoft.Json.Linq;

[assembly: LoadableClass(NormalizeTransform.MinMaxNormalizerSummary, typeof(IDataTransform), typeof(NormalizeTransform), typeof(NormalizeTransform.MinMaxArguments), typeof(SignatureDataTransform),
Expand All @@ -40,7 +39,7 @@
[assembly: LoadableClass(NormalizeTransform.BinNormalizerSummary, typeof(NormalizeTransform.BinColumnFunction), null, typeof(SignatureLoadColumnFunction),
"Bin Normalizer", NormalizeTransform.BinColumnFunction.LoaderSignature)]

namespace Microsoft.ML.Transforms.Normalizers
namespace Microsoft.ML.Transforms
{
/// <summary>
/// The normalize transform for support of normalization via the <see cref="IDataTransform"/> mechanism.
Expand Down
3 changes: 1 addition & 2 deletions src/Microsoft.ML.Data/Transforms/NormalizeColumnDbl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@
using Microsoft.Data.DataView;
using Microsoft.ML.Data;
using Microsoft.ML.Internal.Utilities;
using Microsoft.ML.Model;
using Microsoft.ML.Model.OnnxConverter;
using Microsoft.ML.Model.Pfa;
using Newtonsoft.Json.Linq;

namespace Microsoft.ML.Transforms.Normalizers
namespace Microsoft.ML.Transforms
{
// !!! WARNING !!!
// This file contains the Double version for normalizers and is almost identical with NormalizeColumnSng.cs
Expand Down
3 changes: 1 addition & 2 deletions src/Microsoft.ML.Data/Transforms/NormalizeColumnSng.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@
using Microsoft.Data.DataView;
using Microsoft.ML.Data;
using Microsoft.ML.Internal.Utilities;
using Microsoft.ML.Model;
using Microsoft.ML.Model.OnnxConverter;
using Microsoft.ML.Model.Pfa;
using Newtonsoft.Json.Linq;

namespace Microsoft.ML.Transforms.Normalizers
namespace Microsoft.ML.Transforms
{
// !!! WARNING !!!
// This file contains the Single version for normalizers and is almost identical with NormalizeColumnDbl.cs
Expand Down
3 changes: 1 addition & 2 deletions src/Microsoft.ML.Data/Transforms/NormalizeUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@
using Microsoft.ML;
using Microsoft.ML.Data;
using Microsoft.ML.EntryPoints;
using Microsoft.ML.Model;
using Microsoft.ML.Model.OnnxConverter;
using Microsoft.ML.Model.Pfa;
using Microsoft.ML.Transforms.Normalizers;
using Microsoft.ML.Transforms;
using Newtonsoft.Json.Linq;

[assembly: LoadableClass(typeof(void), typeof(Normalize), null, typeof(SignatureEntryPointModule), "Normalize")]
Expand Down
5 changes: 2 additions & 3 deletions src/Microsoft.ML.Data/Transforms/Normalizer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@
using Microsoft.Data.DataView;
using Microsoft.ML;
using Microsoft.ML.Data;
using Microsoft.ML.Model;
using Microsoft.ML.Model.OnnxConverter;
using Microsoft.ML.Model.Pfa;
using Microsoft.ML.Transforms.Normalizers;
using Microsoft.ML.Transforms;
using Newtonsoft.Json.Linq;

[assembly: LoadableClass(typeof(NormalizingTransformer), null, typeof(SignatureLoadModel),
Expand All @@ -25,7 +24,7 @@
[assembly: LoadableClass(typeof(IDataTransform), typeof(NormalizingTransformer), null, typeof(SignatureLoadDataTransform),
"", NormalizingTransformer.LoaderSignature, "NormalizeTransform")]

namespace Microsoft.ML.Transforms.Normalizers
namespace Microsoft.ML.Transforms
{
public sealed class NormalizingEstimator : IEstimator<NormalizingTransformer>
{
Expand Down
2 changes: 1 addition & 1 deletion src/Microsoft.ML.Data/Transforms/NormalizerCatalog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// See the LICENSE file in the project root for more information.

using Microsoft.ML.Data;
using Microsoft.ML.Transforms.Normalizers;
using Microsoft.ML.Transforms;

namespace Microsoft.ML
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using System;
using System.Collections.Generic;
using Microsoft.Data.DataView;
using Microsoft.ML.Model;

namespace Microsoft.ML.Data
{
Expand Down
1 change: 0 additions & 1 deletion src/Microsoft.ML.Data/Transforms/PerGroupTransformBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
using System.Collections.Generic;
using System.Linq;
using Microsoft.Data.DataView;
using Microsoft.ML.Model;

namespace Microsoft.ML.Data
{
Expand Down
5 changes: 2 additions & 3 deletions src/Microsoft.ML.Data/Transforms/SlotsDroppingTransformer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
using Microsoft.ML.Data;
using Microsoft.ML.Internal.Internallearn;
using Microsoft.ML.Internal.Utilities;
using Microsoft.ML.Model;
using Microsoft.ML.Transforms.FeatureSelection;
using Microsoft.ML.Transforms;

[assembly: LoadableClass(SlotsDroppingTransformer.Summary, typeof(IDataTransform), typeof(SlotsDroppingTransformer), typeof(SlotsDroppingTransformer.Options), typeof(SignatureDataTransform),
SlotsDroppingTransformer.FriendlyName, SlotsDroppingTransformer.LoaderSignature, "DropSlots")]
Expand All @@ -28,7 +27,7 @@
[assembly: LoadableClass(typeof(IRowMapper), typeof(SlotsDroppingTransformer), null, typeof(SignatureLoadRowMapper),
SlotsDroppingTransformer.FriendlyName, SlotsDroppingTransformer.LoaderSignature)]

namespace Microsoft.ML.Transforms.FeatureSelection
namespace Microsoft.ML.Transforms
{
/// <summary>
/// Transform to drop slots from columns. If the column is scalar, the only slot that can be dropped is slot 0.
Expand Down
1 change: 0 additions & 1 deletion src/Microsoft.ML.Data/Transforms/TransformBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
using System.Reflection;
using Microsoft.Data.DataView;
using Microsoft.ML.Internal.Utilities;
using Microsoft.ML.Model;
using Microsoft.ML.Model.OnnxConverter;
using Microsoft.ML.Model.Pfa;
using Newtonsoft.Json.Linq;
Expand Down
Loading