Skip to main content

activeSVC

ActiveSVC selects features for large matrix data with reduced computational complexity or limited data acquisition. It approaches Sequential Feature Selection through an active learning strategy with a support vector machine classifier. At each round of iteration, the procedure analyzes only the samples that classify poorly with the current feature set, and the procedure extends the feature set by identifying features within incorrectly classified samples that will maximally shift the classification margin. There are two strategy, min_complexity and min_acquisition. Min_complexity strategy tends to use less samples each iteration while min_acquisition strategy tends to re-use samples used in previous iterations to minimize the total samples we acquired during the procedure.

Why is activeSVC better than other feature selection methods?

  • Easy to use
  • Good for large datasets
  • Reduce computational complexity
  • Minimize the data size we need

Usage

ActiveSVC processes a datasets with training set and test set and returns the features selected, training accuracy, test accuracy, training mean squared error, test mean squared error, the number of samples acquired after every features are selected. We highly recommend to do l2-normalization for each sample before activeSVC to improve accuracy and speed up model training.

Requires

numpy, random, math, os, time, multiprocessing, sklearn, matplotlib

Import

from activeSVC import min_complexity
from activeSVC import min_acquisition

Function

  • min_complexity
  • min_acquisition

min_complexity

Parameters

X_train: {ndarray, sparse matrix} of shape {n_samples_X, n_features}
        Input data of training set.
y_train: ndarray of shape {n_samples_X,}
        Input classification labels of training set.
X_test: {ndarray, sparse matrix} of shape {n_samples_X, n_features}
        Input data of test set.
y_test: ndarray of shape {n_samples_X,}
        Input classification labels of test set.
num_features: integer
        The total number of features to select.
num_samples: integer
        The number of samples to use in each iteration (for each feature).
init_samples: integer, default=None
        The number of samples to use in the first iteration.
balance: bool, default=False
        Balance samples of each classes when sampling misclassified samples at each iteration or randomly sample misclassified samples.

Return

feature_selected: list of integer
        The sequence of features selected.
num_samples_list: list of integer
        The number of unique samples acquired totally after every features are selected.
train_errors: list of float
        Mean squared error of training set after every features are selected.
test_errors: list of float
        Mean squared error of test set after every features are selected.
train_accuracy: list of float
        Classification accuracy of training set after every features are selected.
test_accuracy: list of float
        Classification accuracy of test set after every features are selected.

min_acquisition

Parameters

X_train: {ndarray, sparse matrix} of shape {n_samples_X, n_features}
        Input data of training set.
y_train: ndarray of shape {n_samples_X,}
        Input classification labels of training set.
X_test: {ndarray, sparse matrix} of shape {n_samples_X, n_features}
        Input data of test set.
y_test: ndarray of shape {n_samples_X,}
        Input classification labels of test set.
num_features: integer
        The total number of features to select.
num_samples: integer
        The number of misclassified samples randomly sampled, which are taken union with samples already acquired before. The union of samples are used for next ietration.
init_samples: integer, default=None
        The number of samples to use in the first iteration.

Return

feature_selected: list of integer
        The sequence of features selected.
num_samples_list: list of integer
        The number of unique samples acquired totally after every features are selected.
samples_global: list of integer
        The indices of samples that are acquired.
train_errors: list of float
        Mean squared error of training set after every features are selected.
test_errors: list of float
        Mean squared error of test set after every features are selected.
train_accuracy: list of float
        Classification accuracy of training set after every features are selected.
test_accuracy: list of float
        Classification accuracy of test set after every features are selected.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

activeSVC-2.0.1.tar.gz (16.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

activeSVC-2.0.1-py3-none-any.whl (16.8 kB view details)

Uploaded Python 3

File details

Details for the file activeSVC-2.0.1.tar.gz.

File metadata

  • Download URL: activeSVC-2.0.1.tar.gz
  • Upload date:
  • Size: 16.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.7.9

File hashes

Hashes for activeSVC-2.0.1.tar.gz
Algorithm Hash digest
SHA256 a92e1de8a45d8cb2ffa69d8aef407db783eb8668316cdb5f6df07d35cdf81fbd
MD5 757040a9d1087c53c05ff8a056c3e6ea
BLAKE2b-256 6711e93275b5173869c4e50b8c8b1b1f79d51b4b254da0a0059ee1470400bd30

See more details on using hashes here.

File details

Details for the file activeSVC-2.0.1-py3-none-any.whl.

File metadata

  • Download URL: activeSVC-2.0.1-py3-none-any.whl
  • Upload date:
  • Size: 16.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.7.9

File hashes

Hashes for activeSVC-2.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 62c014aad29dfcd3e2da17480234e3260fd0af63f37d14efb222f37c900f479c
MD5 170016b65969f6a99643fdeec393a48a
BLAKE2b-256 ce68d4074f2af7c1d811f44e5df5a2e8f5669cd5735135f974e4839556f19b58

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page