Skip to content

Obsolete API #1686

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 12 commits into from
Nov 26, 2018
Merged
Show file tree
Hide file tree
Changes from 5 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
11 changes: 0 additions & 11 deletions Microsoft.ML.sln
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML.Core.Tests", "
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML.CpuMath", "src\Microsoft.ML.CpuMath\Microsoft.ML.CpuMath.csproj", "{46F2F967-C23F-4076-858D-33F7DA9BD2DA}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML.PipelineInference", "src\Microsoft.ML.PipelineInference\Microsoft.ML.PipelineInference.csproj", "{2D7391C9-8254-4B8F-BF26-FADAF8F02F44}"
Copy link
Member

@eerhardt eerhardt Nov 20, 2018

Choose a reason for hiding this comment

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

Doing this will make it not build anymore. Is that what we intend? If yes, we may as well delete the code IMO. Someone can get it from source control history if they need it. #Resolved

Copy link
Member Author

@wschin wschin Nov 21, 2018

Choose a reason for hiding this comment

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

Yes, InferencePipeline needs to be removed. I can build my changes locally. Do you mean that CI will still crash? #Resolved

Copy link
Contributor

Choose a reason for hiding this comment

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

I think "will not build" is meant literally, as in, it will not build, not it cannot build. But of course either way removing it is as @eerhardt suggests is the right thing to do.


In reply to: 235221248 [](ancestors = 235221248)

Copy link
Member Author

Choose a reason for hiding this comment

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

It's removed in my PR now.


In reply to: 235445964 [](ancestors = 235445964,235221248)

EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML.Data", "src\Microsoft.ML.Data\Microsoft.ML.Data.csproj", "{AD92D96B-0E96-4F22-8DCE-892E13B1F282}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML.Onnx", "src\Microsoft.ML.Onnx\Microsoft.ML.Onnx.csproj", "{65D0603E-B96C-4DFC-BDD1-705891B88C18}"
Expand Down Expand Up @@ -165,14 +163,6 @@ Global
{46F2F967-C23F-4076-858D-33F7DA9BD2DA}.Release|Any CPU.Build.0 = Release|Any CPU
{46F2F967-C23F-4076-858D-33F7DA9BD2DA}.Release-Intrinsics|Any CPU.ActiveCfg = Release-Intrinsics|Any CPU
{46F2F967-C23F-4076-858D-33F7DA9BD2DA}.Release-Intrinsics|Any CPU.Build.0 = Release-Intrinsics|Any CPU
{2D7391C9-8254-4B8F-BF26-FADAF8F02F44}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2D7391C9-8254-4B8F-BF26-FADAF8F02F44}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2D7391C9-8254-4B8F-BF26-FADAF8F02F44}.Debug-Intrinsics|Any CPU.ActiveCfg = Debug-Intrinsics|Any CPU
{2D7391C9-8254-4B8F-BF26-FADAF8F02F44}.Debug-Intrinsics|Any CPU.Build.0 = Debug-Intrinsics|Any CPU
{2D7391C9-8254-4B8F-BF26-FADAF8F02F44}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2D7391C9-8254-4B8F-BF26-FADAF8F02F44}.Release|Any CPU.Build.0 = Release|Any CPU
{2D7391C9-8254-4B8F-BF26-FADAF8F02F44}.Release-Intrinsics|Any CPU.ActiveCfg = Release-Intrinsics|Any CPU
{2D7391C9-8254-4B8F-BF26-FADAF8F02F44}.Release-Intrinsics|Any CPU.Build.0 = Release-Intrinsics|Any CPU
{AD92D96B-0E96-4F22-8DCE-892E13B1F282}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AD92D96B-0E96-4F22-8DCE-892E13B1F282}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AD92D96B-0E96-4F22-8DCE-892E13B1F282}.Debug-Intrinsics|Any CPU.ActiveCfg = Debug-Intrinsics|Any CPU
Expand Down Expand Up @@ -509,7 +499,6 @@ Global
{A6CA6CC6-5D7C-4D7F-A0F5-35E14B383B0A} = {09EADF06-BE25-4228-AB53-95AE3E15B530}
{EC743D1D-7691-43B7-B9B0-5F2F7018A8F6} = {AED9C836-31E3-4F3F-8ABC-929555D3F3C4}
{46F2F967-C23F-4076-858D-33F7DA9BD2DA} = {09EADF06-BE25-4228-AB53-95AE3E15B530}
{2D7391C9-8254-4B8F-BF26-FADAF8F02F44} = {09EADF06-BE25-4228-AB53-95AE3E15B530}
{AD92D96B-0E96-4F22-8DCE-892E13B1F282} = {09EADF06-BE25-4228-AB53-95AE3E15B530}
{65D0603E-B96C-4DFC-BDD1-705891B88C18} = {09EADF06-BE25-4228-AB53-95AE3E15B530}
{707BB22C-7E5F-497A-8C2F-74578F675705} = {09EADF06-BE25-4228-AB53-95AE3E15B530}
Expand Down
1 change: 0 additions & 1 deletion src/Microsoft.ML.Console/Microsoft.ML.Console.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
<ProjectReference Include="..\Microsoft.ML.OnnxTransform\Microsoft.ML.OnnxTransform.csproj" />
<ProjectReference Include="..\Microsoft.ML.Onnx\Microsoft.ML.Onnx.csproj" />
<ProjectReference Include="..\Microsoft.ML.PCA\Microsoft.ML.PCA.csproj" />
<ProjectReference Include="..\Microsoft.ML.PipelineInference\Microsoft.ML.PipelineInference.csproj" />
<ProjectReference Include="..\Microsoft.ML.Recommender\Microsoft.ML.Recommender.csproj" />
<ProjectReference Include="..\Microsoft.ML.ResultProcessor\Microsoft.ML.ResultProcessor.csproj" />
<ProjectReference Include="..\Microsoft.ML.StandardLearners\Microsoft.ML.StandardLearners.csproj" />
Expand Down
3,291 changes: 3,291 additions & 0 deletions src/Microsoft.ML.Legacy/CSharpApi.cs

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion src/Microsoft.ML.Legacy/Data/CollectionDataSource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,20 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System.Collections.Generic;
using Microsoft.ML.Runtime;
using Microsoft.ML.Runtime.Api;
using Microsoft.ML.Runtime.Data;
using Microsoft.ML.Runtime.EntryPoints;
using Microsoft.ML.Runtime.Internal.Utilities;
using System;
using System.Collections.Generic;

namespace Microsoft.ML.Legacy.Data
{
/// <summary>
/// Creates data source for pipeline based on provided collection of data.
/// </summary>
[Obsolete]
public static class CollectionDataSource
{
/// <summary>
Expand Down
1 change: 0 additions & 1 deletion src/Microsoft.ML.Legacy/Data/TextLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using Microsoft.CSharp;
using Microsoft.ML.Runtime;
using Microsoft.ML.Runtime.Api;
using Microsoft.ML.Runtime.Data;
Expand Down
6 changes: 6 additions & 0 deletions src/Microsoft.ML.Legacy/ILearningPipelineItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@
using Microsoft.ML.Runtime;
using Microsoft.ML.Runtime.Data;
using Microsoft.ML.Runtime.EntryPoints;
using System;

namespace Microsoft.ML.Legacy
{
/// <summary>
/// An item that can be added to the Learning Pipeline.
/// </summary>
[Obsolete]
public interface ILearningPipelineItem
{
ILearningPipelineStep ApplyStep(ILearningPipelineStep previousStep, Experiment experiment);
Expand All @@ -25,6 +27,7 @@ public interface ILearningPipelineItem
/// <summary>
/// A data loader that can be added to the Learning Pipeline.
/// </summary>
[Obsolete]
public interface ILearningPipelineLoader : ILearningPipelineItem
{
void SetInput(IHostEnvironment environment, Experiment experiment);
Expand All @@ -35,16 +38,19 @@ public interface ILearningPipelineLoader : ILearningPipelineItem
/// This encapsulates an IDataView(input) and ITransformModel(output) object for a transform and
/// for a learner it will encapsulate IDataView(input) and IPredictorModel(output).
/// </summary>
[Obsolete]
public interface ILearningPipelineStep
{
}

[Obsolete]
public interface ILearningPipelineDataStep : ILearningPipelineStep
{
Var<IDataView> Data { get; }
Var<ITransformModel> Model { get; }
}

[Obsolete]
public interface ILearningPipelinePredictorStep : ILearningPipelineStep
{
Var<IPredictorModel> Model { get; }
Expand Down
2 changes: 2 additions & 0 deletions src/Microsoft.ML.Legacy/LearningPipeline.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

namespace Microsoft.ML.Legacy
{
[Obsolete]
public sealed class ScorerPipelineStep : ILearningPipelineDataStep
{
public ScorerPipelineStep(Var<IDataView> data, Var<ITransformModel> model)
Expand Down Expand Up @@ -44,6 +45,7 @@ public ScorerPipelineStep(Var<IDataView> data, Var<ITransformModel> model)
/// var model = pipeline.Train&lt;SentimentData, SentimentPrediction&gt;();
/// </code>
/// </example>
[Obsolete]
[DebuggerTypeProxy(typeof(LearningPipelineDebugProxy))]
public class LearningPipeline : ICollection<ILearningPipelineItem>
{
Expand Down
3 changes: 3 additions & 0 deletions src/Microsoft.ML.Legacy/LearningPipelineDebugProxy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ namespace Microsoft.ML.Legacy
/// The debug proxy class for a LearningPipeline.
/// Displays the current columns and values in the debugger Watch window.
/// </summary>
[Obsolete]
internal sealed class LearningPipelineDebugProxy
{
// load more rows than we display in order for transforms like CategoricalOneHotVectorizer
Expand Down Expand Up @@ -221,6 +222,7 @@ private static List<int> GetColIndices(IDataView dataView)
}
}

[Obsolete]
[DebuggerDisplay("{Name} {Type}{SlotNames}")]
internal class PipelineItemDebugColumn
{
Expand All @@ -234,6 +236,7 @@ public PipelineItemDebugColumn()
}
}

[Obsolete]
[DebuggerDisplay("{Values}")]
internal class PipelineItemDebugRow
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using Microsoft.ML.Runtime.Data;
using Microsoft.ML.Legacy.Transforms;

#pragma warning disable 612
namespace Microsoft.ML.Legacy.Models
{
public sealed partial class BinaryClassificationEvaluator
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ namespace Microsoft.ML.Legacy.Models
/// <summary>
/// This class contains the overall metrics computed by binary classification evaluators.
/// </summary>
[Obsolete]
public sealed class BinaryClassificationMetrics
{
private BinaryClassificationMetrics()
Expand Down
1 change: 1 addition & 0 deletions src/Microsoft.ML.Legacy/Models/ClassificationEvaluator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using Microsoft.ML.Runtime;
using Microsoft.ML.Runtime.Data;
using Microsoft.ML.Legacy.Transforms;
using System;

namespace Microsoft.ML.Legacy.Models
{
Expand Down
2 changes: 2 additions & 0 deletions src/Microsoft.ML.Legacy/Models/ClassificationMetrics.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using Microsoft.ML.Runtime;
using Microsoft.ML.Runtime.Api;
using Microsoft.ML.Runtime.Data;
using System;
using System.Collections.Generic;
using static Microsoft.ML.Runtime.Data.MetricKinds;

Expand All @@ -13,6 +14,7 @@ namespace Microsoft.ML.Legacy.Models
/// <summary>
/// This class contains the overall metrics computed by multi-class classification evaluators.
/// </summary>
[Obsolete]
public sealed class ClassificationMetrics
{
private ClassificationMetrics()
Expand Down
1 change: 1 addition & 0 deletions src/Microsoft.ML.Legacy/Models/ClusterEvaluator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using Microsoft.ML.Runtime;
using Microsoft.ML.Runtime.Data;

#pragma warning disable 612
namespace Microsoft.ML.Legacy.Models
{
public sealed partial class ClusterEvaluator
Expand Down
1 change: 1 addition & 0 deletions src/Microsoft.ML.Legacy/Models/ClusterMetrics.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ namespace Microsoft.ML.Legacy.Models
/// <summary>
/// This class contains the overall metrics computed by cluster evaluators.
/// </summary>
[Obsolete]
public sealed class ClusterMetrics
{
private ClusterMetrics()
Expand Down
1 change: 1 addition & 0 deletions src/Microsoft.ML.Legacy/Models/ConfusionMatrix.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ namespace Microsoft.ML.Legacy.Models
/// Each row of the matrix represents the instances in a predicted class
/// while each column represents the instances in the actual class.
/// </summary>
[Obsolete]
public sealed class ConfusionMatrix
{
private readonly double[,] _elements;
Expand Down
2 changes: 2 additions & 0 deletions src/Microsoft.ML.Legacy/Models/CrossValidator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using Microsoft.ML.Runtime.Api;
using Microsoft.ML.Runtime.Data;
using Microsoft.ML.Runtime.EntryPoints;
using System;
using System.Collections.Generic;
using System.IO;

Expand Down Expand Up @@ -177,6 +178,7 @@ public CrossValidationOutput<TInput, TOutput> CrossValidate<TInput, TOutput>(Lea
}
}

[Obsolete]
public class CrossValidationOutput<TInput, TOutput>
where TInput : class
where TOutput : class, new()
Expand Down
2 changes: 1 addition & 1 deletion src/Microsoft.ML.Legacy/Models/OneVersusAll.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System;
using Microsoft.ML.Runtime;
using Microsoft.ML.Runtime.Data;
using Microsoft.ML.Runtime.EntryPoints;
using System;
using static Microsoft.ML.Runtime.EntryPoints.CommonInputs;

namespace Microsoft.ML.Legacy.Models
Expand Down
2 changes: 1 addition & 1 deletion src/Microsoft.ML.Legacy/Models/OnnxConverter.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.Runtime;
using Microsoft.ML.Runtime.Data;
using System;

namespace Microsoft.ML.Legacy.Models
{
Expand Down
1 change: 1 addition & 0 deletions src/Microsoft.ML.Legacy/Models/RegressionEvaluator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using Microsoft.ML.Runtime;
using Microsoft.ML.Runtime.Data;
using Microsoft.ML.Legacy.Transforms;
using System;

namespace Microsoft.ML.Legacy.Models
{
Expand Down
1 change: 1 addition & 0 deletions src/Microsoft.ML.Legacy/Models/RegressionMetrics.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ namespace Microsoft.ML.Legacy.Models
/// <summary>
/// This class contains the overall metrics computed by regression evaluators.
/// </summary>
[Obsolete]
public sealed class RegressionMetrics
{
private RegressionMetrics()
Expand Down
2 changes: 2 additions & 0 deletions src/Microsoft.ML.Legacy/Models/TrainTestEvaluator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using Microsoft.ML.Runtime.Api;
using Microsoft.ML.Runtime.Data;
using Microsoft.ML.Runtime.EntryPoints;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
Expand Down Expand Up @@ -174,6 +175,7 @@ public TrainTestEvaluatorOutput<TInput, TOutput> TrainTestEvaluate<TInput, TOutp
}
}

[Obsolete]
public class TrainTestEvaluatorOutput<TInput, TOutput>
where TInput : class
where TOutput : class, new()
Expand Down
2 changes: 2 additions & 0 deletions src/Microsoft.ML.Legacy/PredictionModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

namespace Microsoft.ML.Legacy
{
[Obsolete]
public class PredictionModel
{
private readonly IHostEnvironment _env;
Expand Down Expand Up @@ -167,6 +168,7 @@ public Task WriteAsync(Stream stream)
}
}

[Obsolete]
public class PredictionModel<TInput, TOutput> : PredictionModel
where TInput : class
where TOutput : class, new()
Expand Down
4 changes: 4 additions & 0 deletions src/Microsoft.ML.Legacy/Runtime/EntryPoints/CVSplit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,19 @@
using Microsoft.ML.Runtime.Data;
using Microsoft.ML.Runtime.EntryPoints;
using Microsoft.ML.Transforms;
using System;

#pragma warning disable 612
[assembly: LoadableClass(typeof(void), typeof(CVSplit), null, typeof(SignatureEntryPointModule), "CVSplit")]
#pragma warning restore 612

namespace Microsoft.ML.Runtime.EntryPoints
{
/// <summary>
/// The module that splits the input dataset into the specified number of cross-validation folds, and outputs the 'training'
/// and 'testing' portion of the input for each fold.
/// </summary>
[Obsolete]
public static class CVSplit
{
public sealed class Input
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ protected override void GenerateContent(IndentedTextWriter writer, string prefix
GenerateModuleAttribute(writer, prefix, component, moduleId);
GenerateOutputPort(writer);
GenerateModuleType(writer, component);
writer.WriteLine("[Obsolete]");
GenerateMethodSignature(writer, prefix, component);
GenerateImplCall(writer, prefix, component);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ protected override void GenerateMethodSignature(IndentedTextWriter w, string pre
w.WriteLine("/// Creates a {0}", component.LoadNames[0]);
w.WriteLine("/// </summary>");
w.WriteLine("/// <returns>A tuple containing learner name and settings.</returns>");
w.WriteLine("[Obsolete]");
w.WriteLine("public Tuple<string, string> GetTlcSettings()");
}

Expand Down Expand Up @@ -103,6 +104,7 @@ protected override void GenerateOutputPort(IndentedTextWriter w)

protected override void GenerateMethodSignature(IndentedTextWriter w, string prefix, ComponentCatalog.LoadableClassInfo component)
{
w.WriteLine("[Obsolete]");
w.Write("public static Tuple<ITrainer> Create{0}{1}(", prefix, component.LoadNames[0]);
using (w.Nest())
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ private void GenerateFile(ComponentCatalog.LoadableClassInfo info, string filena
{
if (info.IsOfType(kvp.Key))
{
writer.WriteLine("[Obsolete]");
kvp.Value.Generate(writer, _modulePrefix, _regenerate, info,
_moduleId ?? Guid.NewGuid().ToString(), _moduleName, _moduleOwner, _moduleVersion, _moduleState,
_moduleType, _moduleDeterminism, _moduleCategory, _exclude, _namespaces);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ protected override void GenerateMethodSignature(IndentedTextWriter w, string pre
w.WriteLine("/// <param name=\"env\">The environment</param>");
w.WriteLine("/// <param name=\"data\">The data set</param>");
w.WriteLine("/// <returns>The transformed data.</returns>");
w.WriteLine("[Obsolete]");
w.WriteLine("public IDataView Create{0}{1}Impl(", prefix, component.LoadNames[0]);
using (w.Nest())
{
Expand Down Expand Up @@ -129,6 +130,7 @@ protected override void GenerateOutputPort(IndentedTextWriter w)
protected override void GenerateMethodSignature(IndentedTextWriter w, string prefix,
ComponentCatalog.LoadableClassInfo component)
{
w.WriteLine("[Obsolete]");
w.WriteLine("public static Tuple<IDataView, DataTransform> Create{0}{1}(", prefix, component.LoadNames[0]);
using (w.Nest())
{
Expand Down Expand Up @@ -191,6 +193,7 @@ protected override void GenerateClassName(IndentedTextWriter w, string prefix, C
w.WriteLine();
var className = prefix + component.LoadNames[0];
w.WriteLine("/// <summary>Module: {0}</summary>", className);
w.WriteLine("[Obsolete]");
w.WriteLine("public static class {0}EntryPoint", className);
w.WriteLine("{");
}
Expand All @@ -212,6 +215,7 @@ protected override void GenerateContent(IndentedTextWriter writer, string prefix
writer.WriteLine("Determinism = Determinism.{0},", Determinism);
writer.WriteLine("Category = @\"{0}\")]", Category);
}
writer.WriteLine("[Obsolete]");
writer.WriteLine("public static IModule Create{0}(", _compName);
using (writer.Nest())
{
Expand Down Expand Up @@ -254,6 +258,7 @@ protected override void GenerateContent(IndentedTextWriter writer, string prefix
}
writer.WriteLine("}");
writer.WriteLine();
writer.WriteLine("[Obsolete]");
writer.WriteLine("public class {0}Module : ModuleBase", _compName);
writer.WriteLine("{");
using (writer.Nest())
Expand Down
Loading