Skip to content

Commit 70830ed

Browse files
authored
Example classes should be static (#2548)
1 parent 82fd7ea commit 70830ed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+78
-89
lines changed

docs/samples/Microsoft.ML.Samples/Dynamic/Calibrator.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ namespace Microsoft.ML.Samples.Dynamic
88
/// <summary>
99
/// This example first trains a StochasticDualCoordinateAscentBinary Classifier and then convert its output to probability via training a calibrator.
1010
/// </summary>
11-
public class CalibratorExample
11+
public static class Calibrator
1212
{
13-
public static void Calibration()
13+
public static void Example()
1414
{
1515
// Downloading the dataset from github.com/dotnet/machinelearning.
1616
// This will create a sentiment.tsv file in the filesystem.

docs/samples/Microsoft.ML.Samples/Dynamic/DataOperations/BootstrapSample.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
namespace Microsoft.ML.Samples.Dynamic
66
{
7-
public static class BootstrapSample
7+
public static class Bootstrap
88
{
99
public static void Example()
1010
{

docs/samples/Microsoft.ML.Samples/Dynamic/FastTreeRegression.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55
namespace Microsoft.ML.Samples.Dynamic
66
{
7-
public class FastTreeRegressionExample
7+
public static class FastTreeRegression
88
{
9-
public static void FastTreeRegression()
9+
public static void Example()
1010
{
1111
// Create a new ML context, for ML.NET operations. It can be used for exception tracking and logging,
1212
// as well as the source of randomness.

docs/samples/Microsoft.ML.Samples/Dynamic/FeatureContributionCalculationTransform.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
namespace Microsoft.ML.Samples.Dynamic
66
{
7-
public class FeatureContributionCalculationTransform
7+
public static class FeatureContributionCalculationTransform
88
{
99
public static void Example()
1010
{

docs/samples/Microsoft.ML.Samples/Dynamic/FeatureSelectionTransform.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55
namespace Microsoft.ML.Samples.Dynamic
66
{
7-
public class FeatureSelectionTransformExample
7+
public static class FeatureSelectionTransform
88
{
9-
public static void FeatureSelectionTransform()
9+
public static void Example()
1010
{
1111
// Downloading a classification dataset from github.com/dotnet/machinelearning.
1212
// It will be stored in the same path as the executable

docs/samples/Microsoft.ML.Samples/Dynamic/FieldAwareFactorizationMachine.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
using Microsoft.ML.Data;
33
namespace Microsoft.ML.Samples.Dynamic
44
{
5-
public class FFM_BinaryClassificationExample
5+
public static class FFMBinaryClassification
66
{
7-
public static void FFM_BinaryClassification()
7+
public static void Example()
88
{
99
// Downloading the dataset from github.com/dotnet/machinelearning.
1010
// This will create a sentiment.tsv file in the filesystem.

docs/samples/Microsoft.ML.Samples/Dynamic/GeneralizedAdditiveModels.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55
namespace Microsoft.ML.Samples.Dynamic
66
{
7-
public class GeneralizedAdditiveModels_RegressionExample
7+
public static class GeneralizedAdditiveModelsRegression
88
{
9-
public static void RunExample()
9+
public static void Example()
1010
{
1111
// Create a new context for ML.NET operations. It can be used for exception tracking and logging,
1212
// as a catalog of available operations and as the source of randomness.

docs/samples/Microsoft.ML.Samples/Dynamic/IidChangePointDetectorTransform.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
namespace Microsoft.ML.Samples.Dynamic
1212
{
13-
public partial class TransformSamples
13+
public static partial class TransformSamples
1414
{
1515
class ChangePointPrediction
1616
{

docs/samples/Microsoft.ML.Samples/Dynamic/IidSpikeDetectorTransform.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
namespace Microsoft.ML.Samples.Dynamic
88
{
9-
public partial class TransformSamples
9+
public static partial class TransformSamples
1010
{
1111
class IidSpikeData
1212
{

docs/samples/Microsoft.ML.Samples/Dynamic/ImageAnalytics/ConvertToGrayScale.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33

44
namespace Microsoft.ML.Samples.Dynamic
55
{
6-
public class ConvertToGrayscaleExample
6+
public static class ConvertToGrayscale
77
{
88
// Sample that loads images from the file system, and converts them to grayscale.
9-
public static void ConvertToGrayscale()
9+
public static void Example()
1010
{
1111
var mlContext = new MLContext();
1212

docs/samples/Microsoft.ML.Samples/Dynamic/ImageAnalytics/ExtractPixels.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33

44
namespace Microsoft.ML.Samples.Dynamic
55
{
6-
public class ExtractPixelsExample
6+
public static class ExtractPixels
77
{
88
// Sample that loads the images from the file system, resizes them (ExtractPixels requires a resizing operation), and extracts the
99
// values of the pixels as a vector.
10-
public static void ExtractPixels()
10+
public static void Example()
1111
{
1212
var mlContext = new MLContext();
1313

docs/samples/Microsoft.ML.Samples/Dynamic/ImageAnalytics/LoadImage.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33

44
namespace Microsoft.ML.Samples.Dynamic
55
{
6-
public class LoadImageExample
6+
public static class LoadImage
77
{
88
// Loads the images of the imagesFolder into an IDataView.
9-
public static void LoadImage()
9+
public static void Example()
1010
{
1111
var mlContext = new MLContext();
1212

docs/samples/Microsoft.ML.Samples/Dynamic/ImageAnalytics/ResizeImage.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33

44
namespace Microsoft.ML.Samples.Dynamic
55
{
6-
public class ResizeImageExample
6+
public static class ResizeImage
77
{
88
// Example on how to load the images from the file system, and resize them.
9-
public static void ResizeImage()
9+
public static void Example()
1010
{
1111
var mlContext = new MLContext();
1212

docs/samples/Microsoft.ML.Samples/Dynamic/KMeans.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33

44
namespace Microsoft.ML.Samples.Dynamic
55
{
6-
public class KMeans_example
6+
public class KMeans
77
{
8-
public static void KMeans()
8+
public static void Example()
99
{
1010
// Create a new ML context, for ML.NET operations. It can be used for exception tracking and logging,
1111
// as well as the source of randomness.

docs/samples/Microsoft.ML.Samples/Dynamic/KeyToValueValueToKey.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,12 @@
22
using System.Collections.Generic;
33
using Microsoft.ML.Data;
44
using Microsoft.ML.Transforms.Conversions;
5-
using Microsoft.ML.Transforms.Text;
65

76
namespace Microsoft.ML.Samples.Dynamic
87
{
9-
public class KeyToValueValueToKeyExample
8+
public class KeyToValueValueToKey
109
{
11-
public static void KeyToValueValueToKey()
10+
public static void Example()
1211
{
1312
// Create a new ML context, for ML.NET operations. It can be used for exception tracking and logging,
1413
// as well as the source of randomness.

docs/samples/Microsoft.ML.Samples/Dynamic/LdaTransform.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55
namespace Microsoft.ML.Samples.Dynamic
66
{
7-
public class LdaTransformExample
7+
public static class LdaTransform
88
{
9-
public static void LdaTransform()
9+
public static void Example()
1010
{
1111
// Create a new ML context, for ML.NET operations. It can be used for exception tracking and logging,
1212
// as well as the source of randomness.

docs/samples/Microsoft.ML.Samples/Dynamic/LogisticRegression.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55
namespace Microsoft.ML.Samples.Dynamic
66
{
7-
public class LogisticRegressionExample
7+
public static class LogisticRegressionExample
88
{
9-
public static void LogisticRegression()
9+
public static void Example()
1010
{
1111
var ml = new MLContext();
1212

docs/samples/Microsoft.ML.Samples/Dynamic/NgramExtraction.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
namespace Microsoft.ML.Samples.Dynamic
66
{
7-
public partial class NgramTransformSamples
7+
public static partial class TransformSamples
88
{
99
public static void NgramTransform()
1010
{

docs/samples/Microsoft.ML.Samples/Dynamic/Normalizer.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66

77
namespace Microsoft.ML.Samples.Dynamic
88
{
9-
public class NormalizerExample
9+
public static class NormalizerTransform
1010
{
11-
public static void Normalizer()
11+
public static void Example()
1212
{
1313
// Create a new ML context, for ML.NET operations. It can be used for exception tracking and logging,
1414
// as well as the source of randomness.

docs/samples/Microsoft.ML.Samples/Dynamic/OnnxTransform.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66

77
namespace Microsoft.ML.Samples.Dynamic
88
{
9-
class OnnxTransformExample
9+
public static class OnnxTransformExample
1010
{
1111
/// <summary>
1212
/// Example use of OnnxEstimator in an ML.NET pipeline
1313
/// </summary>
14-
public static void OnnxTransformSample()
14+
public static void Example()
1515
{
1616
// Download the squeeznet image model from ONNX model zoo, version 1.2
1717
// https://github.com/onnx/models/tree/master/squeezenet

docs/samples/Microsoft.ML.Samples/Dynamic/PermutationFeatureImportance/PFIHelper.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
using System;
22
using System.Linq;
33
using Microsoft.Data.DataView;
4-
using Microsoft.ML.Data;
54
using Microsoft.ML.Trainers;
65
using Microsoft.ML.SamplesUtils;
76
using Microsoft.ML.Trainers.HalLearners;
87

98
namespace Microsoft.ML.Samples.Dynamic.PermutationFeatureImportance
109
{
11-
public class PfiHelper
10+
public static class PfiHelper
1211
{
1312
public static IDataView GetHousingRegressionIDataView(MLContext mlContext, out string labelName, out string[] featureNames, bool binaryPrediction = false)
1413
{

docs/samples/Microsoft.ML.Samples/Dynamic/PermutationFeatureImportance/PFIRegressionExample.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33

44
namespace Microsoft.ML.Samples.Dynamic.PermutationFeatureImportance
55
{
6-
public class PfiRegressionExample
6+
public static class PfiRegression
77
{
8-
public static void RunExample()
8+
public static void Example()
99
{
1010
// Create a new context for ML.NET operations. It can be used for exception tracking and logging,
1111
// as a catalog of available operations and as the source of randomness.

docs/samples/Microsoft.ML.Samples/Dynamic/PermutationFeatureImportance/PfiBinaryClassificationExample.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55
namespace Microsoft.ML.Samples.Dynamic.PermutationFeatureImportance
66
{
7-
public class PfiBinaryClassificationExample
7+
public static class PfiBinaryClassification
88
{
9-
public static void RunExample()
9+
public static void Example()
1010
{
1111
// Create a new context for ML.NET operations. It can be used for exception tracking and logging,
1212
// as a catalog of available operations and as the source of randomness.

docs/samples/Microsoft.ML.Samples/Dynamic/ProjectionTransforms.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55

66
namespace Microsoft.ML.Samples.Dynamic
77
{
8-
public class ProjectionTransformsExample
8+
public static class ProjectionTransforms
99
{
10-
public static void ProjectionTransforms()
10+
public static void Example()
1111
{
1212
// Create a new ML context, for ML.NET operations. It can be used for exception tracking and logging,
1313
// as well as the source of randomness.

docs/samples/Microsoft.ML.Samples/Dynamic/SDCARegression.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55
namespace Microsoft.ML.Samples.Dynamic
66
{
7-
public class SDCARegressionExample
7+
public static class SDCARegression
88
{
9-
public static void SDCARegression()
9+
public static void Example()
1010
{
1111
// Create a new ML context, for ML.NET operations. It can be used for exception tracking and logging,
1212
// as well as the source of randomness.

docs/samples/Microsoft.ML.Samples/Dynamic/SsaChangePointDetectorTransform.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
namespace Microsoft.ML.Samples.Dynamic
88
{
9-
public partial class TransformSamples
9+
public static partial class TransformSamples
1010
{
1111
class SsaChangePointData
1212
{

docs/samples/Microsoft.ML.Samples/Dynamic/SsaSpikeDetectorTransform.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
namespace Microsoft.ML.Samples.Dynamic
88
{
9-
public partial class TransformSamples
9+
public static partial class TransformSamples
1010
{
1111
class SsaSpikeData
1212
{

docs/samples/Microsoft.ML.Samples/Dynamic/StopWordRemoverTransform.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55

66
namespace Microsoft.ML.Samples.Dynamic
77
{
8-
public class StopWordRemoverTransformExample
8+
public static class StopWordRemoverTransform
99
{
10-
public static void StopWordRemoverTransform()
10+
public static void Example()
1111
{
1212
// Create a new ML context, for ML.NET operations. It can be used for exception tracking and logging,
1313
// as well as the source of randomness.

docs/samples/Microsoft.ML.Samples/Dynamic/TensorFlow/ImageClassification.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44

55
namespace Microsoft.ML.Samples.Dynamic.TensorFlow
66
{
7-
class ImageClassification
7+
public static class ImageClassification
88
{
99
/// <summary>
1010
/// Example use of the TensorFlow image model in a ML.NET pipeline.
1111
/// </summary>
12-
public static void ScoringWithImageClassificationModelSample()
12+
public static void Example()
1313
{
1414
// Download the ResNet 101 model from the location below.
1515
// https://storage.googleapis.com/download.tensorflow.org/models/tflite_11_05_08/resnet_v2_101.tgz

docs/samples/Microsoft.ML.Samples/Dynamic/TensorFlow/TextClassification.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
using System;
22
using System.IO;
3-
using System.Linq;
43
using Microsoft.ML.Data;
54
using Microsoft.ML.Transforms.TensorFlow;
65

76
namespace Microsoft.ML.Samples.Dynamic.TensorFlow
87
{
9-
class TextClassification
8+
public static class TextClassification
109
{
1110
public const int MaxSentenceLenth = 600;
1211
/// <summary>
1312
/// Example use of the TensorFlow sentiment classification model.
1413
/// </summary>
15-
public static void ScoringWithTextClassificationModelSample()
14+
public static void Example()
1615
{
1716
string modelLocation = SamplesUtils.DatasetUtils.DownloadTensorFlowSentimentModel();
1817

docs/samples/Microsoft.ML.Samples/Dynamic/TextTransform.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55

66
namespace Microsoft.ML.Samples.Dynamic
77
{
8-
public class TextTransformExample
8+
public static class TextTransform
99
{
10-
public static void TextTransform()
10+
public static void Example()
1111
{
1212
// Create a new ML context, for ML.NET operations. It can be used for exception tracking and logging,
1313
// as well as the source of randomness.

docs/samples/Microsoft.ML.Samples/Dynamic/Trainers/BinaryClassification/SDCALogisticRegression.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
namespace Microsoft.ML.Samples.Dynamic
77
{
8-
public class SDCALogisticRegression
8+
public static class SDCALogisticRegression
99
{
1010
public static void Example()
1111
{

docs/samples/Microsoft.ML.Samples/Dynamic/Trainers/BinaryClassification/SDCASupportVectorMachine.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
namespace Microsoft.ML.Samples.Dynamic
66
{
7-
public class SDCASupportVectorMachine
7+
public static class SDCASupportVectorMachine
88
{
99
public static void Example()
1010
{

0 commit comments

Comments
 (0)