dotnet / machinelearning

ML.NET is an open source and cross-platform machine learning framework for .NET.
https://dot.net/ml
MIT License
9.05k stars 1.89k forks source link

Move public facing classes used in Samples into appropriate namespaces. #2075

Closed codemzs closed 5 years ago

codemzs commented 5 years ago

As part of the grand rename of namespaces, let's finalize the set of namespaces of public-facing components.

Class/Interface/Enum/Delegate Current Namespace New Namespace Current Path
TransformerScope Microsoft.ML.Data Microsoft.ML E:\machinelearning\src\Microsoft.ML.Data\DataLoadSave\TransformerChain.cs
ITransformerChainAccessor Microsoft.ML.Data Microsoft.ML E:\machinelearning\src\Microsoft.ML.Data\DataLoadSave\TransformerChain.cs
TransformerChain Microsoft.ML.Data Microsoft.ML E:\machinelearning\src\Microsoft.ML.Data\DataLoadSave\TransformerChain.cs
IDataView Microsoft.ML.Data Microsoft.ML E:\machinelearning\src\Microsoft.ML.Core\Data\IDataView.cs
ISchema Microsoft.ML.Data ? E:\machinelearning\src\Microsoft.ML.Core\Data\IDataView.cs
delegate void ValueGetter(ref TValue value); Microsoft.ML.Data ? E:\machinelearning\src\Microsoft.ML.Core\Data\IDataView.cs
abstract class Row Microsoft.ML.Data ? E:\machinelearning\src\Microsoft.ML.Core\Data\IDataView.cs
CursorState Microsoft.ML.Data ? E:\machinelearning\src\Microsoft.ML.Core\Data\IDataView.cs
abstract class RowCursor Microsoft.ML.Data ? E:\machinelearning\src\Microsoft.ML.Core\Data\IDataView.cs
interface IRowReadableAs Microsoft.ML.Data ? E:\machinelearning\src\Microsoft.ML.Data\DataView\TypedCursor.cs
class RowCursor Microsoft.ML.Data ? E:\machinelearning\src\Microsoft.ML.Data\DataView\TypedCursor.cs
interface ICursorable Microsoft.ML.Data ? E:\machinelearning\src\Microsoft.ML.Data\DataView\TypedCursor.cs
class TypedCursorable Microsoft.ML.Data ? E:\machinelearning\src\Microsoft.ML.Data\DataView\TypedCursor.cs
static class CursoringUtils Microsoft.ML.Data ? E:\machinelearning\src\Microsoft.ML.Data\DataView\TypedCursor.cs
MultiFileSource Microsoft.ML.Data ? E:\machinelearning\src\Microsoft.ML.Data\DataLoadSave\MultiFileSource.cs
VBuffer Microsoft.ML.Data ? E:\machinelearning\src\Microsoft.ML.Core\Data\VBuffer.cs
BinaryPredictionTransformer Microsoft.ML.Data Make a catalog entry in ML namespace? Or move to ML namespace E:\machinelearning\src\Microsoft.ML.Data\Scorers\PredictionTransformer.cs
PredictionTransformerBase<TModel, TScorer> Microsoft.ML.Data Make a catalog entry in ML namespace? Or move to ML namespace E:\machinelearning\src\Microsoft.ML.Data\Scorers\PredictionTransformer.cs
SingleFeaturePredictionTransformerBase<TModel, TScorer> Microsoft.ML.Data Make a catalog entry in ML namespace? Or move to ML namespace E:\machinelearning\src\Microsoft.ML.Data\Scorers\PredictionTransformer.cs
AnomalyPredictionTransformer Microsoft.ML.Data Make a catalog entry in ML namespace? Or move to ML namespace E:\machinelearning\src\Microsoft.ML.Data\Scorers\PredictionTransformer.cs
MulticlassPredictionTransformer Microsoft.ML.Data Make a catalog entry in ML namespace? Or move to ML namespace E:\machinelearning\src\Microsoft.ML.Data\Scorers\PredictionTransformer.cs
RegressionPredictionTransformer Microsoft.ML.Data Make a catalog entry in ML namespace? Or move to ML namespace E:\machinelearning\src\Microsoft.ML.Data\Scorers\PredictionTransformer.cs
RankingPredictionTransformer Microsoft.ML.Data Make a catalog entry in ML namespace? Or move to ML namespace E:\machinelearning\src\Microsoft.ML.Data\Scorers\PredictionTransformer.cs
interface Itransformer Microsoft.ML.Core.Data ? E:\machinelearning\src\Microsoft.ML.Core\Data\IEstimator.cs
interface IEstimator Microsoft.ML.Core.Data ? E:\machinelearning\src\Microsoft.ML.Core\Data\IEstimator.cs
interface IDataReaderEstimator<in TSource, out TReader> Microsoft.ML.Core.Data ? E:\machinelearning\src\Microsoft.ML.Core\Data\IEstimator.cs
interface IDataReader Microsoft.ML.Core.Data ? E:\machinelearning\src\Microsoft.ML.Core\Data\IEstimator.cs
class SchemaShape Microsoft.ML.Core.Data ? E:\machinelearning\src\Microsoft.ML.Core\Data\IEstimator.cs
RoleMappedData Microsoft.ML.Data ? E:\machinelearning\src\Microsoft.ML.Core\Data\RoleMappedSchema.cs
RoleMappedSchema Microsoft.ML.Data ? E:\machinelearning\src\Microsoft.ML.Core\Data\RoleMappedSchema.cs
ColumnCursorExtensions Microsoft.ML.Data ? E:\machinelearning\src\Microsoft.ML.Data\Utilities\ColumnCursor.cs

CC: @TomFinley

TomFinley commented 5 years ago

It seems like the core concepts of the API (IEstimator/ITransformer/IDataReader) should live in Microsoft.ML. I'd argue VBuffer as a core data type should also live there, since vector valued columns are very important. MultiFileSource should live in same namespace as whatever IDataReader winds up living in. That probably means Microsoft.ML.

IRowReadableAs and TypedCursorable are internal. So is ICursorable almost certainly could be internal. CursorUtils, like any utils, should be internal. Same with Role mapped data, and role mapped schema. Indeed it might be helpful when composing lists to check what things are already internal.

ColumnCursorExtensions is a fairly poor API that should be reviewed, but in principle if properly designed I'd probably, as an auxiliary method, put it in Microsoft.ML.Data.

Regarding specific transformers, I have no idea what "Make a catalog entry in ML namespace?" means. But I'm not sure whether this should be Microsoft.ML, Microsoft.ML.Data, or Microsoft.ML.Transformers, or something else altogether.

Note: to keep this helpful, might be nice if you could group the list, since obviously it is not scalable for you to list every individual class, and have someone have to tell you what to do with it. Instead maybe try to propose a general policy, some sort of set of rules that are consistent.

codemzs commented 5 years ago

@sfilipi Do we care about this anymore?

sfilipi commented 5 years ago

I believe this has been addressed from the other angles, of checking the namespaces directly to see what types they expose.

I'd just skim over the user facing samples, like the cookbook, Microsoft.ML.Samples and the Microsoft.ML.FunctionalTests before closing it.