Summary
The train_from_stream method currently only accepts positional arguments:
classifier.train_from_stream(:spam, File.open("spam_corpus.txt"))
For API consistency with other methods like train and add, it would be nice to also support keyword arguments:
classifier.train_from_stream(spam: File.open("spam_corpus.txt"))
Affected Classes
Classifier::Bayes
Classifier::LSI
Classifier::KNN
Classifier::LogisticRegression
Current Behavior
classifier.train_from_stream(spam: File.open("corpus.txt"))
# => ArgumentError: wrong number of arguments (given 0, expected 2)
Expected Behavior
classifier.train_from_stream(spam: File.open("corpus.txt"))
# => Works, trains the :spam category from the stream
Summary
The
train_from_streammethod currently only accepts positional arguments:For API consistency with other methods like
trainandadd, it would be nice to also support keyword arguments:Affected Classes
Classifier::BayesClassifier::LSIClassifier::KNNClassifier::LogisticRegressionCurrent Behavior
Expected Behavior