Skip to content

Commit

Permalink
Fix error in SVM extensions for conformance to classification protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinCoble committed Feb 5, 2017
1 parent dfee9ad commit aa6bef2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions AIToolbox/SVMExtensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ extension SVMModel : Classifier {
public func trainClassifier(_ trainData: MLClassificationDataSet) throws
{
// Verify the SVMModel is the right type
if type != .c_SVM_Classification || type != .ν_SVM_Classification { throw SVMError.invalidModelType }
if type != .c_SVM_Classification && type != .ν_SVM_Classification { throw SVMError.invalidModelType }

// Verify the data set is the right type
if (trainData.dataType != .classification) { throw DataTypeError.invalidDataType }
if (trainData.dataType == .regression) { throw DataTypeError.invalidDataType }

// Train on the data (ignore initialization, as SVM's do single-batch training)
if (trainData is DataSet) {
Expand Down

0 comments on commit aa6bef2

Please sign in to comment.