Socket
Book a DemoInstallSign in
Socket

feature_selection

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

feature_selection

0.0.3
bundlerRubygems
Version published
Maintainers
1
Created
Source

= Feature Selection

Feature Selection is a library of feature selection algorithms.

http://en.wikipedia.org/wiki/Feature_selection

== Install

gem sources -a http://gemcutter.org sudo gem install feature_selection

== How To Use

There are currently 3 implemented feature collections: Chi-Squared, Mutual Information and Frequency Based.

Each return a hash that looks similar to:

{klass => {term => score, term => score}, klass => {term => score}}

Example:

data = { :spam => [['this', 'is', 'some', 'information'], ['this', 'is', 'something', 'that', 'is', 'information']], :ham => [['this', 'test', 'some', 'more', 'information'], ['there', 'are', 'some', 'things']], }

a = FeatureSelection::ChiSquared.new(data)

You can also use...

FeatureSelection::MutualInformation

FeatureSelection::FrequencyBased

a.rank_features #=> {:spam => {term => score, term => score}, :ham => {term => score}}

== Logging

There are two ways to log the activity:

Provide a path of somewhere to log to

log = File.expand_path(File.dirname(FILE) + '/log.txt') FeatureSelection::MutualInformation.new(data, :log_to => log)

Provide an existing Logger object

log = Logger.new('log.txt') FeatureSelection::MutualInformation.new(data, :log_to => log)

== Copyright

Copyright (c) 2009 reddavis. See LICENSE for details.

FAQs

Package last updated on 12 Jan 2010

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.