
Security News
Follow-up and Clarification on Recent Malicious Ruby Gems Campaign
A clarification on our recent research investigating 60 malicious Ruby gems.
= SVM Toolkit
source:: https://notabug.org/peterlane/svm_toolkit/
== Description
Support-vector machines are a popular tool in data mining. This package includes an amended version of the Java implementation of the libsvm library (version 3.11). Additional methods and examples are provided to support standard training techniques, such as cross-validation, and simple visualisations. Training/testing of models can use a variety of built-in or user-defined evaluation methods, including overall accuracy, geometric mean, precision and recall.
== Features
== Example
The following example illustrates how a dataset can be constructed in code, and an SVM model created and tested against the different kernels.
require "svm_toolkit" include SvmToolkit
puts "Classification with LIBSVM" puts "--------------------------"
Labels = [0, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0]
Instances = [ [0.0,1.0,1.0,0.0], [0.0,1.0,1.0,1.0], [0.5,1.0,1.0,0.0], [1.0,0.5,1.0,0.0], [1.0,0.0,0.0,0.0], [1.0,0.0,0.0,1.0], [0.5,0.0,0.0,1.0], [0.0,0.5,1.0,0.0], [0.0,0.0,0.0,0.0], [1.0,0.5,0.0,0.0], [0.0,0.5,0.0,1.0], [0.5,0.5,1.0,1.0], [0.5,1.0,0.0,0.0], [1.0,0.5,1.0,1.0] ]
TrainingSet = Problem.from_array(Instances.slice(0, 10), Labels.slice(0, 10)) TestSet = Problem.from_array(Instances.slice(10, 4), Labels.slice(10, 4))
Parameter.kernels.each do |kernel|
# -- train model for this kernel type
params = Parameter.new(
:svm_type => Parameter::C_SVC,
:kernel_type => kernel,
:cost => 10,
:degree => 1,
:gamma => 100
)
model = Svm.svm_train(TrainingSet, params)
# -- test kernel performance on the training set
errors = model.evaluate_dataset(TrainingSet, :print_results => true)
puts "Kernel #{Parameter.kernel_name(kernel)} has #{errors} on the training set"
# -- test kernel performance on the test set
errors = model.evaluate_dataset(TestSet, :print_results => true)
puts "Kernel #{Parameter.kernel_name(kernel)} has #{errors} on the test set"
end
More examples can be found in the source code, linked above.
== Acknowledgements
The svm_toolkit is based on LibSVM, which is available from: http://www.csie.ntu.edu.tw/~cjlin/libsvm/
The contour plot uses the PlotPackage library, available from: http://thehuwaldtfamily.org/java/Packages/Plot/PlotPackage.html
FAQs
Unknown package
We found that svm_toolkit demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A clarification on our recent research investigating 60 malicious Ruby gems.
Security News
ESLint now supports parallel linting with a new --concurrency flag, delivering major speed gains and closing a 10-year-old feature request.
Research
/Security News
A malicious Go module posing as an SSH brute forcer exfiltrates stolen credentials to a Telegram bot controlled by a Russian-speaking threat actor.