nareshmlx/opencv-pr huggingface dataset:
**File:** modules/ml/src/svmsgd.cpp
**Change Type:** added
**Context:** PR #6096: Mn/svmsgd to opencv3 0 - **Merge with extra**: https://github.com/Itseez/opencv_extra/pull/288 Implemented SVMSGD classifier.

**Code Changes:**
```diff
@@ -0,0 +1,510 @@
+/*M///////////////////////////////////////////////////////////////////////////////////////
+//
+//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
+//
+//  By downloading, copying, installing or using the software you agree to this license.
+//  If you do not agree to this license, do not download, install,
+//  copy or use the software.
+//
+//
```

Review comment:
Only at this point I figured that firstClass and secondClass are the classes of the classifier. Why not to use a more conventional naming - positives and negatives? Or maybe there's another conventional name.
**File:** modules/ml/src/svmsgd.cpp
**Change Type:** added
**Context:** PR #6096: Mn/svmsgd to opencv3 0 - **Merge with extra**: https://github.com/Itseez/opencv_extra/pull/288 Implemented SVMSGD classifier.

**Code Changes:**
```diff
@@ -0,0 +1,510 @@
+/*M///////////////////////////////////////////////////////////////////////////////////////
+//
+//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
+//
+//  By downloading, copying, installing or using the software you agree to this license.
+//  If you do not agree to this license, do not download, install,
+//  copy or use the software.
+//
+//
```

Review comment:
The comments for those 3 lines are useless. You can safely remove them.
**File:** modules/ml/src/svmsgd.cpp
**Change Type:** added
**Context:** PR #6096: Mn/svmsgd to opencv3 0 - **Merge with extra**: https://github.com/Itseez/opencv_extra/pull/288 Implemented SVMSGD classifier.
**Review Line:** 348

**Code Changes:**
```diff
+    }
+
+    return result;
+}
+
+bool SVMSGDImpl::isClassifier() const
+{
+    return (params.svmsgdType == SGD || params.svmsgdType == ASGD)
+            &&
+            (params.marginType == SOFT_MARGIN || params.marginType == HARD_MARGIN)
+            &&
```

Review comment:
So, first we introduce 'illegal' states and then check that they're not used? =)
**File:** modules/ml/src/svmsgd.cpp
**Change Type:** added
**Context:** PR #6096: Mn/svmsgd to opencv3 0 - **Merge with extra**: https://github.com/Itseez/opencv_extra/pull/288 Implemented SVMSGD classifier.
**Review Line:** 481

**Code Changes:**
```diff
+{
+    clear();
+    setOptimalParameters();
+}
+
+void SVMSGDImpl::setOptimalParameters(int svmsgdType, int marginType)
+{
+    switch (svmsgdType)
+    {
+    case SGD:
+        params.svmsgdType = SGD;
```

Review comment:
I would think, that this function should be called in constructor. Is there a reason not to?
**File:** modules/ml/test/test_svmsgd.cpp
**Change Type:** added
**Context:** PR #6096: Mn/svmsgd to opencv3 0 - **Merge with extra**: https://github.com/Itseez/opencv_extra/pull/288 Implemented SVMSGD classifier.

**Code Changes:**
```diff
@@ -0,0 +1,318 @@
+/*M///////////////////////////////////////////////////////////////////////////////////////
+//
+//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
+//
+//  By downloading, copying, installing or using the software you agree to this license.
+//  If you do not agree to this license, do not download, install,
+//  copy or use the software.
+//
+//
```

Review comment:
Is there any difference between `makeTestData` and `makeTrainData`?
**File:** samples/cpp/train_svmsgd.cpp
**Change Type:** added
**Context:** PR #6096: Mn/svmsgd to opencv3 0 - **Merge with extra**: https://github.com/Itseez/opencv_extra/pull/288 Implemented SVMSGD classifier.
**Review Line:** 97

**Code Changes:**
```diff
+    int yMax = std::max(segment.first.y, segment.second.y);
+
+    CV_Assert(weights.type() == CV_32FC1);
+    CV_Assert(xMin == xMax || yMin == yMax);
+
+    if (xMin == xMax && weights.at<float>(1) != 0)
+    {
+        x = xMin;
+        y = static_cast<int>(std::floor( - (weights.at<float>(0) * x + shift) / weights.at<float>(1)));
+        if (y >= yMin && y <= yMax)
+        {
```

Review comment:
You have xMin and xMax here, but the weights index is 1 (not 0). Is this inteded?
**File:** samples/cpp/train_svmsgd.cpp
**Change Type:** added
**Context:** PR #6096: Mn/svmsgd to opencv3 0 - **Merge with extra**: https://github.com/Itseez/opencv_extra/pull/288 Implemented SVMSGD classifier.

**Code Changes:**
```diff
@@ -0,0 +1,210 @@
+#include <opencv2/opencv.hpp>
+#include "opencv2/video/tracking.hpp"
+#include "opencv2/imgproc/imgproc.hpp"
+#include "opencv2/highgui/highgui.hpp"
+
+using namespace cv;
+using namespace cv::ml;
+
+
```

Review comment:
C'mon! What's up with defines?
**File:** samples/cpp/train_svmsgd.cpp
**Change Type:** added
**Context:** PR #6096: Mn/svmsgd to opencv3 0 - **Merge with extra**: https://github.com/Itseez/opencv_extra/pull/288 Implemented SVMSGD classifier.
**Review Line:** 178

**Code Changes:**
```diff
+    float shift = 0;
+
+    if (doTrain(data.samples, data.responses, weights, shift))
+    {
+        Point points[2];
+        findPointsForLine(weights, shift, points, data.img.cols, data.img.rows);
+
+        redraw(data, points);
+    }
+}
+
```

Review comment:
Having looked through this all, I don't think `shift` is the appropriate name. Don't you think so?
**File:** samples/cpp/train_svmsgd.cpp
**Change Type:** added
**Context:** PR #6096: Mn/svmsgd to opencv3 0 - **Merge with extra**: https://github.com/Itseez/opencv_extra/pull/288 Implemented SVMSGD classifier.

**Code Changes:**
```diff
@@ -0,0 +1,210 @@
+#include <opencv2/opencv.hpp>
+#include "opencv2/video/tracking.hpp"
+#include "opencv2/imgproc/imgproc.hpp"
+#include "opencv2/highgui/highgui.hpp"
+
+using namespace cv;
+using namespace cv::ml;
+
+
```

Review comment:
`Point (&points)[2]` is equivalent to `Point points[2]` in your use case and is preferable.
**File:** modules/ml/test/test_svmsgd.cpp
**Change Type:** added
**Context:** PR #6096: Mn/svmsgd to opencv3 0 - **Merge with extra**: https://github.com/Itseez/opencv_extra/pull/288 Implemented SVMSGD classifier.

**Code Changes:**
```diff
@@ -0,0 +1,318 @@
+/*M///////////////////////////////////////////////////////////////////////////////////////
+//
+//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
+//
+//  By downloading, copying, installing or using the software you agree to this license.
+//  If you do not agree to this license, do not download, install,
+//  copy or use the software.
+//
+//
```

Review comment:
Does the test need to print it?
**File:** samples/cpp/train_svmsgd.cpp
**Change Type:** added
**Context:** PR #6096: Mn/svmsgd to opencv3 0 - **Merge with extra**: https://github.com/Itseez/opencv_extra/pull/288 Implemented SVMSGD classifier.
**Review Line:** 97

**Code Changes:**
```diff
+    int yMax = std::max(segment.first.y, segment.second.y);
+
+    CV_Assert(weights.type() == CV_32FC1);
+    CV_Assert(xMin == xMax || yMin == yMax);
+
+    if (xMin == xMax && weights.at<float>(1) != 0)
+    {
+        x = xMin;
+        y = static_cast<int>(std::floor( - (weights.at<float>(0) * x + shift) / weights.at<float>(1)));
+        if (y >= yMin && y <= yMax)
+        {
```

Review comment:
There is no mistake. The first condition (xMin == xMax) check that the consider border is horizontal. The second condition (weights.at<float>(1) != 0) check that the line wx = 0 isn't horizontal. Thus they have cross point.
**File:** modules/ml/src/svmsgd.cpp
**Change Type:** added
**Context:** PR #6096: Mn/svmsgd to opencv3 0 - **Merge with extra**: https://github.com/Itseez/opencv_extra/pull/288 Implemented SVMSGD classifier.
**Review Line:** 156

**Code Changes:**
```diff
+        samples.row(sampleIndex) -= average;
+    }
+
+    double normValue = norm(samples);
+
+    multiplier = static_cast<float>(sqrt(samples.total()) / normValue);
+
+    samples *= multiplier;
+}
+
+void SVMSGDImpl::makeExtendedTrainSamples(const Mat &trainSamples, Mat &extendedTrainSamples, Mat &average, float &multiplier)
```

Review comment:
Shouldn't, because the metric of the original space will change so that the optimal decision in the resulting space won't be equivalent to the optimal decision in the original space.
**File:** modules/ml/include/opencv2/ml.hpp
**Change Type:** modified
**Context:** PR #6096: Mn/svmsgd to opencv3 0 - **Merge with extra**: https://github.com/Itseez/opencv_extra/pull/288 Implemented SVMSGD classifier.
**Review Line:** 1560

**Code Changes:**
```diff
+To use SVMSGD algorithm do as follows:
+
+- first, create the SVMSGD object. The algoorithm will set optimal parameters by default, but you can set your own parameters via functions setSvmsgdType(),
+  setMarginType(), setMarginRegularization(), setInitialStepSize(), and setStepDecreasingPower().
+
+- then the SVM model can be trained using the train features and the correspondent labels by the method train().
+
+- after that, the label of a new feature vector can be predicted using the method predict().
+
+@code
+// Create empty object
```

Review comment:
Of course. trainData format is specified in "ml.hpp", line 137.
**File:** modules/ml/src/svmsgd.cpp
**Change Type:** added
**Context:** PR #6096: Mn/svmsgd to opencv3 0 - **Merge with extra**: https://github.com/Itseez/opencv_extra/pull/288 Implemented SVMSGD classifier.

**Code Changes:**
```diff
@@ -0,0 +1,510 @@
+/*M///////////////////////////////////////////////////////////////////////////////////////
+//
+//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
+//
+//  By downloading, copying, installing or using the software you agree to this license.
+//  If you do not agree to this license, do not download, install,
+//  copy or use the software.
+//
+//
```

Review comment:
Fixed. See commit https://github.com/mnoskova/opencv/commit/ff549527697af8a66889c5a7d010fe6a768b1076
**File:** modules/ml/include/opencv2/ml.hpp
**Change Type:** modified
**Context:** PR #6096: Mn/svmsgd to opencv3 0 - **Merge with extra**: https://github.com/Itseez/opencv_extra/pull/288 Implemented SVMSGD classifier.

**Code Changes:**
```diff
@@ -1496,6 +1496,165 @@ class CV_EXPORTS_W LogisticRegression : public StatModel
     CV_WRAP static Ptr<LogisticRegression> create();
 };
 
+
+/****************************************************************************************\
+*                        Stochastic Gradient Descent SVM Classifier                      *
+\****************************************************************************************/
+
+/*!
```

Review comment:
Fixed. See commit https://github.com/mnoskova/opencv/commit/ff549527697af8a66889c5a7d010fe6a768b1076
**File:** modules/ml/src/svmsgd.cpp
**Change Type:** added
**Context:** PR #6096: Mn/svmsgd to opencv3 0 - **Merge with extra**: https://github.com/Itseez/opencv_extra/pull/288 Implemented SVMSGD classifier.

**Code Changes:**
```diff
@@ -0,0 +1,510 @@
+/*M///////////////////////////////////////////////////////////////////////////////////////
+//
+//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
+//
+//  By downloading, copying, installing or using the software you agree to this license.
+//  If you do not agree to this license, do not download, install,
+//  copy or use the software.
+//
+//
```

Review comment:
Fixed. See commit https://github.com/mnoskova/opencv/commit/ff549527697af8a66889c5a7d010fe6a768b1076.
**File:** modules/ml/test/test_svmsgd.cpp
**Change Type:** added
**Context:** PR #6096: Mn/svmsgd to opencv3 0 - **Merge with extra**: https://github.com/Itseez/opencv_extra/pull/288 Implemented SVMSGD classifier.

**Code Changes:**
```diff
@@ -0,0 +1,318 @@
+/*M///////////////////////////////////////////////////////////////////////////////////////
+//
+//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
+//
+//  By downloading, copying, installing or using the software you agree to this license.
+//  If you do not agree to this license, do not download, install,
+//  copy or use the software.
+//
+//
```

Review comment:
Fixed. See commit https://github.com/mnoskova/opencv/commit/ff549527697af8a66889c5a7d010fe6a768b1076.
**File:** samples/cpp/train_svmsgd.cpp
**Change Type:** added
**Context:** PR #6096: Mn/svmsgd to opencv3 0 - **Merge with extra**: https://github.com/Itseez/opencv_extra/pull/288 Implemented SVMSGD classifier.

**Code Changes:**
```diff
@@ -0,0 +1,210 @@
+#include <opencv2/opencv.hpp>
+#include "opencv2/video/tracking.hpp"
+#include "opencv2/imgproc/imgproc.hpp"
+#include "opencv2/highgui/highgui.hpp"
+
+using namespace cv;
+using namespace cv::ml;
+
+
```

Review comment:
Fixed. See commit https://github.com/mnoskova/opencv/commit/ff549527697af8a66889c5a7d010fe6a768b1076.
**File:** modules/ml/include/opencv2/ml.hpp
**Change Type:** modified
**Context:** PR #6096: Mn/svmsgd to opencv3 0 - **Merge with extra**: https://github.com/Itseez/opencv_extra/pull/288 Implemented SVMSGD classifier.

**Code Changes:**
```diff
@@ -1496,6 +1496,165 @@ class CV_EXPORTS_W LogisticRegression : public StatModel
     CV_WRAP static Ptr<LogisticRegression> create();
 };
 
+
+/****************************************************************************************\
+*                        Stochastic Gradient Descent SVM Classifier                      *
+\****************************************************************************************/
+
+/*!
```

Review comment:
Fixed. See commit https://github.com/mnoskova/opencv/commit/02cd8cf039bf475b24f86709e0d42911844ece35.
**File:** modules/ml/src/svmsgd.cpp
**Change Type:** added
**Context:** PR #6096: Mn/svmsgd to opencv3 0 - **Merge with extra**: https://github.com/Itseez/opencv_extra/pull/288 Implemented SVMSGD classifier.

**Code Changes:**
```diff
@@ -0,0 +1,510 @@
+/*M///////////////////////////////////////////////////////////////////////////////////////
+//
+//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
+//
+//  By downloading, copying, installing or using the software you agree to this license.
+//  If you do not agree to this license, do not download, install,
+//  copy or use the software.
+//
+//
```

Review comment:
Fixed. See commit https://github.com/mnoskova/opencv/commit/02cd8cf039bf475b24f86709e0d42911844ece35.
**File:** modules/ml/src/svmsgd.cpp
**Change Type:** added
**Context:** PR #6096: Mn/svmsgd to opencv3 0 - **Merge with extra**: https://github.com/Itseez/opencv_extra/pull/288 Implemented SVMSGD classifier.
**Review Line:** 348

**Code Changes:**
```diff
+    }
+
+    return result;
+}
+
+bool SVMSGDImpl::isClassifier() const
+{
+    return (params.svmsgdType == SGD || params.svmsgdType == ASGD)
+            &&
+            (params.marginType == SOFT_MARGIN || params.marginType == HARD_MARGIN)
+            &&
```

Review comment:
Fixed. See commit https://github.com/mnoskova/opencv/commit/02cd8cf039bf475b24f86709e0d42911844ece35.
**File:** modules/ml/include/opencv2/ml.hpp
**Change Type:** modified
**Context:** PR #6096: Mn/svmsgd to opencv3 0 - **Merge with extra**: https://github.com/Itseez/opencv_extra/pull/288 Implemented SVMSGD classifier.

**Code Changes:**
```diff
@@ -1496,6 +1496,165 @@ class CV_EXPORTS_W LogisticRegression : public StatModel
     CV_WRAP static Ptr<LogisticRegression> create();
 };
 
+
+/****************************************************************************************\
+*                        Stochastic Gradient Descent SVM Classifier                      *
+\****************************************************************************************/
+
+/*!
```

Review comment:
Fixed. See commit https://github.com/mnoskova/opencv/commit/f3c4a6aab8c1d60e72e696fa524c01ba644d42fe.
**File:** modules/ml/src/svmsgd.cpp
**Change Type:** added
**Context:** PR #6096: Mn/svmsgd to opencv3 0 - **Merge with extra**: https://github.com/Itseez/opencv_extra/pull/288 Implemented SVMSGD classifier.

**Code Changes:**
```diff
@@ -0,0 +1,510 @@
+/*M///////////////////////////////////////////////////////////////////////////////////////
+//
+//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
+//
+//  By downloading, copying, installing or using the software you agree to this license.
+//  If you do not agree to this license, do not download, install,
+//  copy or use the software.
+//
+//
```

Review comment:
Fixed. See commit https://github.com/mnoskova/opencv/commit/f3c4a6aab8c1d60e72e696fa524c01ba644d42fe.
**File:** samples/cpp/train_svmsgd.cpp
**Change Type:** added
**Context:** PR #6096: Mn/svmsgd to opencv3 0 - **Merge with extra**: https://github.com/Itseez/opencv_extra/pull/288 Implemented SVMSGD classifier.

**Code Changes:**
```diff
@@ -0,0 +1,210 @@
+#include <opencv2/opencv.hpp>
+#include "opencv2/video/tracking.hpp"
+#include "opencv2/imgproc/imgproc.hpp"
+#include "opencv2/highgui/highgui.hpp"
+
+using namespace cv;
+using namespace cv::ml;
+
+
```

Review comment:
Fixed. See commit https://github.com/mnoskova/opencv/commit/f3c4a6aab8c1d60e72e696fa524c01ba644d42fe.
**File:** modules/ml/test/test_svmsgd.cpp
**Change Type:** added
**Context:** PR #6096: Mn/svmsgd to opencv3 0 - **Merge with extra**: https://github.com/Itseez/opencv_extra/pull/288 Implemented SVMSGD classifier.

**Code Changes:**
```diff
@@ -0,0 +1,318 @@
+/*M///////////////////////////////////////////////////////////////////////////////////////
+//
+//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
+//
+//  By downloading, copying, installing or using the software you agree to this license.
+//  If you do not agree to this license, do not download, install,
+//  copy or use the software.
+//
+//
```

Review comment:
Fixed. See commit https://github.com/mnoskova/opencv/commit/f3c4a6aab8c1d60e72e696fa524c01ba644d42fe.
**File:** modules/ml/include/opencv2/ml.hpp
**Change Type:** modified
**Context:** PR #6096: Mn/svmsgd to opencv3 0 - **Merge with extra**: https://github.com/Itseez/opencv_extra/pull/288 Implemented SVMSGD classifier.

**Code Changes:**
```diff
@@ -1496,6 +1496,165 @@ class CV_EXPORTS_W LogisticRegression : public StatModel
     CV_WRAP static Ptr<LogisticRegression> create();
 };
 
+
+/****************************************************************************************\
+*                        Stochastic Gradient Descent SVM Classifier                      *
+\****************************************************************************************/
+
+/*!
```

Review comment:
If I counted correctly, there are slightly more than 5 parameters
**File:** modules/ml/include/opencv2/ml.hpp
**Change Type:** modified
**Context:** PR #6096: Mn/svmsgd to opencv3 0 - **Merge with extra**: https://github.com/Itseez/opencv_extra/pull/288 Implemented SVMSGD classifier.
**Review Line:** 1513

**Code Changes:**
```diff
+as presented in @cite bottou2010large.
+
+The classifier has following parameters:
+- model type,
+- margin type,
+- margin regularization (\f$\lambda\f$),
+- initial step size (\f$\gamma_0\f$),
+- step decreasing power (\f$c\f$),
+- and termination criteria.
+
+The model type may have one of the following values: \ref SGD and \ref ASGD.
```

Review comment:
margin regularization -> regularization margin?
**File:** modules/ml/include/opencv2/ml.hpp
**Change Type:** modified
**Context:** PR #6096: Mn/svmsgd to opencv3 0 - **Merge with extra**: https://github.com/Itseez/opencv_extra/pull/288 Implemented SVMSGD classifier.

**Code Changes:**
```diff
@@ -1496,6 +1496,165 @@ class CV_EXPORTS_W LogisticRegression : public StatModel
     CV_WRAP static Ptr<LogisticRegression> create();
 };
 
+
+/****************************************************************************************\
+*                        Stochastic Gradient Descent SVM Classifier                      *
+\****************************************************************************************/
+
+/*!
```

Review comment:
amazing -> super mega over-the-top
**File:** modules/ml/include/opencv2/ml.hpp
**Change Type:** modified
**Context:** PR #6096: Mn/svmsgd to opencv3 0 - **Merge with extra**: https://github.com/Itseez/opencv_extra/pull/288 Implemented SVMSGD classifier.
**Review Line:** 1513

**Code Changes:**
```diff
+as presented in @cite bottou2010large.
+
+The classifier has following parameters:
+- model type,
+- margin type,
+- margin regularization (\f$\lambda\f$),
+- initial step size (\f$\gamma_0\f$),
+- step decreasing power (\f$c\f$),
+- and termination criteria.
+
+The model type may have one of the following values: \ref SGD and \ref ASGD.
```

Review comment:
It is margin regularization.
**File:** modules/ml/include/opencv2/ml.hpp
**Change Type:** modified
**Context:** PR #6096: Mn/svmsgd to opencv3 0 - **Merge with extra**: https://github.com/Itseez/opencv_extra/pull/288 Implemented SVMSGD classifier.

**Code Changes:**
```diff
@@ -1496,6 +1496,165 @@ class CV_EXPORTS_W LogisticRegression : public StatModel
     CV_WRAP static Ptr<LogisticRegression> create();
 };
 
+
+/****************************************************************************************\
+*                        Stochastic Gradient Descent SVM Classifier                      *
+\****************************************************************************************/
+
+/*!
```

Review comment:
Fixed. See commit https://github.com/mnoskova/opencv/commit/068677ad50a72b911445ed7a2c7472b70906a882.
**File:** modules/ml/src/svmsgd.cpp
**Change Type:** added
**Context:** PR #6096: Mn/svmsgd to opencv3 0 - **Merge with extra**: https://github.com/Itseez/opencv_extra/pull/288 Implemented SVMSGD classifier.

**Code Changes:**
```diff
@@ -0,0 +1,510 @@
+/*M///////////////////////////////////////////////////////////////////////////////////////
+//
+//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
+//
+//  By downloading, copying, installing or using the software you agree to this license.
+//  If you do not agree to this license, do not download, install,
+//  copy or use the software.
+//
+//
```

Review comment:
|| responses.type() == CV_32FC1 ?
**File:** modules/ml/src/svmsgd.cpp
**Change Type:** added
**Context:** PR #6096: Mn/svmsgd to opencv3 0 - **Merge with extra**: https://github.com/Itseez/opencv_extra/pull/288 Implemented SVMSGD classifier.

**Code Changes:**
```diff
@@ -0,0 +1,510 @@
+/*M///////////////////////////////////////////////////////////////////////////////////////
+//
+//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
+//
+//  By downloading, copying, installing or using the software you agree to this license.
+//  If you do not agree to this license, do not download, install,
+//  copy or use the software.
+//
+//
```

Review comment:
I wonder, if something like `any(responses > 0) && any(responses < 0)` would do the thing
**File:** modules/ml/src/svmsgd.cpp
**Change Type:** added
**Context:** PR #6096: Mn/svmsgd to opencv3 0 - **Merge with extra**: https://github.com/Itseez/opencv_extra/pull/288 Implemented SVMSGD classifier.
**Review Line:** 139

**Code Changes:**
```diff
+    return makePtr<SVMSGDImpl>();
+}
+
+void SVMSGDImpl::normalizeSamples(Mat &samples, Mat &average, float &multiplier)
+{
+    int featuresCount = samples.cols;
+    int samplesCount = samples.rows;
+
+    average = Mat(1, featuresCount, samples.type());
+    CV_Assert(average.type() ==  CV_32FC1);
+    for (int featureIndex = 0; featureIndex < featuresCount; featureIndex++)
```

Review comment:
`CV_Assert(samples.type() == CV_32FC1);` ?
**File:** modules/ml/src/svmsgd.cpp
**Change Type:** added
**Context:** PR #6096: Mn/svmsgd to opencv3 0 - **Merge with extra**: https://github.com/Itseez/opencv_extra/pull/288 Implemented SVMSGD classifier.

**Code Changes:**
```diff
@@ -0,0 +1,510 @@
+/*M///////////////////////////////////////////////////////////////////////////////////////
+//
+//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
+//
+//  By downloading, copying, installing or using the software you agree to this license.
+//  If you do not agree to this license, do not download, install,
+//  copy or use the software.
+//
+//
```

Review comment:
`firstClass` -> `positive` ?