Skip to main content

A fast canonical-correlation-based feature selection method

Project description

conda Codecov CI Doc PythonVersion PyPi Black ruff pixi

FastCan is a feature selection method, which has following advantages:

  1. Extremely fast.

  2. Support unsupervised feature selection.

  3. Support multioutput feature selection.

  4. Skip redundant features.

  5. Evaluate relative usefulness of features.

Check Home Page for more information.

Installation

Install FastCan via PyPi:

  • Run pip install fastcan

Or via conda-forge:

  • Run conda install -c conda-forge fastcan

Getting Started

>>> from fastcan import FastCan
>>> X = [[ 0.87, -1.34,  0.31 ],
...     [-2.79, -0.02, -0.85 ],
...     [-1.34, -0.48, -2.55 ],
...     [ 1.92,  1.48,  0.65 ]]
>>> y = [[0, 0], [1, 1], [0, 0], [1, 0]] # Multioutput feature selection
>>> selector = FastCan(n_features_to_select=2, verbose=0).fit(X, y)
>>> selector.get_support()
array([ True,  True, False])
>>> selector.get_support(indices=True) # Sorted indices
array([0, 1])
>>> selector.indices_ # Indices in selection order
array([1, 0], dtype=int32)
>>> selector.scores_ # Scores for selected features in selection order
array([0.91162413, 0.71089547])
>>> # Here Feature 2 must be included
>>> selector = FastCan(n_features_to_select=2, indices_include=[2], verbose=0).fit(X, y)
>>> # We can find the feature which is useful when working with Feature 2
>>> selector.indices_
array([2, 0], dtype=int32)
>>> selector.scores_
array([0.34617598, 0.95815008])

Citation

FastCan is a Python implementation of the following papers.

If you use the h-correlation method in your work please cite the following reference:

@article{ZHANG2022108419,
   title = {Orthogonal least squares based fast feature selection for linear classification},
   journal = {Pattern Recognition},
   volume = {123},
   pages = {108419},
   year = {2022},
   issn = {0031-3203},
   doi = {https://doi.org/10.1016/j.patcog.2021.108419},
   url = {https://www.sciencedirect.com/science/article/pii/S0031320321005951},
   author = {Sikai Zhang and Zi-Qiang Lang},
   keywords = {Feature selection, Orthogonal least squares, Canonical correlation analysis, Linear discriminant analysis, Multi-label, Multivariate time series, Feature interaction},
   }

If you use the eta-cosine method in your work please cite the following reference:

@article{ZHANG2025111895,
   title = {Canonical-correlation-based fast feature selection for structural health monitoring},
   journal = {Mechanical Systems and Signal Processing},
   volume = {223},
   pages = {111895},
   year = {2025},
   issn = {0888-3270},
   doi = {https://doi.org/10.1016/j.ymssp.2024.111895},
   url = {https://www.sciencedirect.com/science/article/pii/S0888327024007933},
   author = {Sikai Zhang and Tingna Wang and Keith Worden and Limin Sun and Elizabeth J. Cross},
   keywords = {Multivariate feature selection, Filter method, Canonical correlation analysis, Feature interaction, Feature redundancy, Structural health monitoring},
   }

Project details


Download files

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

Source Distribution

fastcan-0.2.7.tar.gz (236.2 kB view details)

Uploaded Source

Built Distributions

fastcan-0.2.7-cp313-cp313-win_amd64.whl (98.4 kB view details)

Uploaded CPython 3.13 Windows x86-64

fastcan-0.2.7-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (194.9 kB view details)

Uploaded CPython 3.13 manylinux: glibc 2.17+ x86-64

fastcan-0.2.7-cp313-cp313-macosx_11_0_arm64.whl (94.1 kB view details)

Uploaded CPython 3.13 macOS 11.0+ ARM64

fastcan-0.2.7-cp313-cp313-macosx_10_13_x86_64.whl (100.7 kB view details)

Uploaded CPython 3.13 macOS 10.13+ x86-64

fastcan-0.2.7-cp312-cp312-win_amd64.whl (98.7 kB view details)

Uploaded CPython 3.12 Windows x86-64

fastcan-0.2.7-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (193.9 kB view details)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

fastcan-0.2.7-cp312-cp312-macosx_11_0_arm64.whl (95.2 kB view details)

Uploaded CPython 3.12 macOS 11.0+ ARM64

fastcan-0.2.7-cp312-cp312-macosx_10_13_x86_64.whl (101.9 kB view details)

Uploaded CPython 3.12 macOS 10.13+ x86-64

fastcan-0.2.7-cp311-cp311-win_amd64.whl (96.9 kB view details)

Uploaded CPython 3.11 Windows x86-64

fastcan-0.2.7-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (197.1 kB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

fastcan-0.2.7-cp311-cp311-macosx_11_0_arm64.whl (93.1 kB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

fastcan-0.2.7-cp311-cp311-macosx_10_9_x86_64.whl (99.4 kB view details)

Uploaded CPython 3.11 macOS 10.9+ x86-64

fastcan-0.2.7-cp310-cp310-win_amd64.whl (96.8 kB view details)

Uploaded CPython 3.10 Windows x86-64

fastcan-0.2.7-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (198.0 kB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

fastcan-0.2.7-cp310-cp310-macosx_11_0_arm64.whl (93.7 kB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

fastcan-0.2.7-cp310-cp310-macosx_10_9_x86_64.whl (99.5 kB view details)

Uploaded CPython 3.10 macOS 10.9+ x86-64

fastcan-0.2.7-cp39-cp39-win_amd64.whl (97.4 kB view details)

Uploaded CPython 3.9 Windows x86-64

fastcan-0.2.7-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (198.5 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

fastcan-0.2.7-cp39-cp39-macosx_11_0_arm64.whl (94.2 kB view details)

Uploaded CPython 3.9 macOS 11.0+ ARM64

fastcan-0.2.7-cp39-cp39-macosx_10_9_x86_64.whl (100.1 kB view details)

Uploaded CPython 3.9 macOS 10.9+ x86-64

File details

Details for the file fastcan-0.2.7.tar.gz.

File metadata

  • Download URL: fastcan-0.2.7.tar.gz
  • Upload date:
  • Size: 236.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for fastcan-0.2.7.tar.gz
Algorithm Hash digest
SHA256 7e506c31bba483751f6e6ef4c29c6c57c45b937d5fd3b0c67fd13870bf55ee94
MD5 a0634bca8d642e1b71a9f37355ba4816
BLAKE2b-256 88de001430649966451025f647e40b6c1b0070176442d07ed88f6f104fe97a4a

See more details on using hashes here.

File details

Details for the file fastcan-0.2.7-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: fastcan-0.2.7-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 98.4 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for fastcan-0.2.7-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 79eeb6db18aee082702395813fdb9c5340d5048703931b044b783ef5f81741fb
MD5 7fbb32cfde3c91a333b993dafd548084
BLAKE2b-256 62b7ea4da18907ce29294f49c66880f8d2603299802c7e7044acefa7525ca938

See more details on using hashes here.

File details

Details for the file fastcan-0.2.7-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for fastcan-0.2.7-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 cd2641d3c671ecada4156d8565175325c1b3841b0d38fb025ff8e13cbae76547
MD5 d8446d3e30e7c334d24814e7b86570b6
BLAKE2b-256 ec95ad78649ef9b74ca12761af037fd6f880a5feccb8a0cc2af97a34359d10ea

See more details on using hashes here.

File details

Details for the file fastcan-0.2.7-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for fastcan-0.2.7-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 fee0e68af8a80a0f09644209b71313d545ca5dcb2d254259ceb5d9bc3097d096
MD5 359d9c11d861feba758248a0eb430954
BLAKE2b-256 fc2cc554311d75d7646977e27204bd13d675e77cdc7e2071e458db01ce913daf

See more details on using hashes here.

File details

Details for the file fastcan-0.2.7-cp313-cp313-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for fastcan-0.2.7-cp313-cp313-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 77332ddd537a23d38778ed4eca6365b7e6980b768a61e102f029c8771f6e7cb9
MD5 31cfbe9c03b3e94fcc8259801efd464f
BLAKE2b-256 1a8d373044c914761aa5b9e3a4d09172e1359d75e11a32e0fdaafdce1ca229fd

See more details on using hashes here.

File details

Details for the file fastcan-0.2.7-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: fastcan-0.2.7-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 98.7 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for fastcan-0.2.7-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 b4f73ac5cc0f063ab60386ade340a3881638691955e23a3efd7be9730dde079d
MD5 c62cde3196949c10e5e0f1d9842815a2
BLAKE2b-256 76b13b4687e34e3b7557027b24c18271a105150b6bfbdbf573e7dc30a38bb174

See more details on using hashes here.

File details

Details for the file fastcan-0.2.7-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for fastcan-0.2.7-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 cd40b939ffba25f7af01ebd11072bd98d2ff7021665286cae31d2c90ed8e3c9c
MD5 5cbbf0f490bde9ed4e2b661a4a79ba9a
BLAKE2b-256 251c8a543e6c5deda35470f989da596d8479e790a0ac8a9eca5f9043e1864e95

See more details on using hashes here.

File details

Details for the file fastcan-0.2.7-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for fastcan-0.2.7-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 178bfc1f3a7192cf2fd851beddb5b0c7e4a33502fb1c816f9339ae9194155626
MD5 4362f72b22aeda5130ebde584e688b15
BLAKE2b-256 3d51950c4bf40443eee0dd4fc5488bc217b21b0ce92c37fce98d4a16aa33b2d0

See more details on using hashes here.

File details

Details for the file fastcan-0.2.7-cp312-cp312-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for fastcan-0.2.7-cp312-cp312-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 721ccadd90036a00b4fbbecb13754948249dc933e6cbb9f4dcab82e967c803e0
MD5 cac0816f7f893fe3629938d1f1eea76a
BLAKE2b-256 bdbffad124ef17cd0582071c5383560f7b4510c92451a3f48c181ccf8455faa9

See more details on using hashes here.

File details

Details for the file fastcan-0.2.7-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: fastcan-0.2.7-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 96.9 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for fastcan-0.2.7-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 eb35f83b534127e393a3a552afdf51ee2f811f7a33706717e30d3b7ba615aec0
MD5 8b07af880ab101550ec58f2c55d1d033
BLAKE2b-256 9d224fd1e44394639c03ff9823eb414d5d780e942002759cb3d5e18e6d4205ed

See more details on using hashes here.

File details

Details for the file fastcan-0.2.7-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for fastcan-0.2.7-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1f75d06e3e1da5ec97e67cdf149970239fe40a32fddfa95eb27af0469024e1cf
MD5 83ba6615fce24bdf52aca51e2161ff1d
BLAKE2b-256 635aa870d5dc0b3822ddb53166cdef9449b50b07cc93b92d4ecbd9fb7e50f510

See more details on using hashes here.

File details

Details for the file fastcan-0.2.7-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for fastcan-0.2.7-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 90a213a25ff98664856034b9ef651f7f997810485b958ce4f37e42ea6f5d5438
MD5 d8a99acac8a4df124fe38ecda1c6b14b
BLAKE2b-256 0948ba84949b6308d945a2c8d708f39c935e05bf817ecb2a8001333b85e74ba6

See more details on using hashes here.

File details

Details for the file fastcan-0.2.7-cp311-cp311-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for fastcan-0.2.7-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 cf1c5bbd043a26f2c383cd8e2c7ed02eeeb67dce7c8077bfdf3c158b3cf86c5b
MD5 b9f39960b3ed2896340cc2c19eb24fb4
BLAKE2b-256 2828fd222b256aa990dd740a40983fc70615a5c223a52a2a3a657047c499c32a

See more details on using hashes here.

File details

Details for the file fastcan-0.2.7-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: fastcan-0.2.7-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 96.8 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for fastcan-0.2.7-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 efea2d57f7f8e12ee4ce578f93e2b87a0bc1afd52f74dac04a614514b80b1413
MD5 41c37582e4856e3e233a5bf1102eaf1a
BLAKE2b-256 29815a98de20c05147798cc6b0cffad6698c607500926ee151bda74bc97f46a8

See more details on using hashes here.

File details

Details for the file fastcan-0.2.7-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for fastcan-0.2.7-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 5d595adcf6df11158449d025cf479520feb6331ab90452ba5b27412a40e6997a
MD5 69e86e0b8ee292d32f31f855e2808e7d
BLAKE2b-256 78c5eb92cf47b4664b4fa6418de225a4c04522fec663e8eea9ff743b3e343dee

See more details on using hashes here.

File details

Details for the file fastcan-0.2.7-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for fastcan-0.2.7-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 76b74a8bad8f16d924d1ad724a9ed83083fbf8aba99a17f48596f2a864a775c3
MD5 cb12a517079ef1ff5026b37e9a5d4089
BLAKE2b-256 082ba6a7bb17c62512f4e1e8bebbfbfb522ce9e9ff0401b20e9a2a92a32724da

See more details on using hashes here.

File details

Details for the file fastcan-0.2.7-cp310-cp310-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for fastcan-0.2.7-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 87671d0c839960b0abd612f4486cb36ef232bb19a5ed6e3b6a9c66ddc9d6d0b6
MD5 3537105c185a8288099a79aeb68efc5e
BLAKE2b-256 bbf575b66a46f0f9a562725fc54697c095ee9c173e27c8d5b2d5d80d08cb109d

See more details on using hashes here.

File details

Details for the file fastcan-0.2.7-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: fastcan-0.2.7-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 97.4 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for fastcan-0.2.7-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 6f78c44b87356cd461d689367885c8e41a5ec7500bde00bc5d2f36e745deee7a
MD5 0072a207af2893508bcc3e7a4e7cb647
BLAKE2b-256 13aefcb4dc38d85a58e999c1542ab0b1795d4a74edf497ea901b65ae725a148d

See more details on using hashes here.

File details

Details for the file fastcan-0.2.7-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for fastcan-0.2.7-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 485304f7a0c6f66beaaf6dbd069bd2d3c3d6539c761cbd53bc12a4eb17eef2d3
MD5 5cb0bcc0361d8ec9737acdbdac2eaec7
BLAKE2b-256 129ac2506bbff0260729658b494544d81a27c486ffe5598b6dc9f6fdbb3fc5a0

See more details on using hashes here.

File details

Details for the file fastcan-0.2.7-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for fastcan-0.2.7-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 91dbb6a6f94fcbb0fbd7fbba357010b0085624fef01b80191ce3ec8a51f7d147
MD5 d6ac352bd5e9c3ced8a843cccf1d2416
BLAKE2b-256 f9a23c0dc35ea78e83d549417d7d3dac90a72979a3a9eadbbcc3c5579ffdd2f2

See more details on using hashes here.

File details

Details for the file fastcan-0.2.7-cp39-cp39-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for fastcan-0.2.7-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 40db34a8b22d904b02a8c920f6f2d774db31b5688587fe1e470d4eb5d1fa99fc
MD5 458f02aa5c2b7a3899b6dd0c35a2daf8
BLAKE2b-256 cbe89937cea329b39ac643243f6fc69f4ebffcfd8eba74dc6750ac3e6d998fec

See more details on using hashes here.

Supported by

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