Skip to main content

CLONAL SELECTION ALGORITHM AND ARTIFICIAL BEE COLONY ALGORITHM WITH LOGISTIC REGRESSION (CSA-ABC-LR)

CSA-ABC-LR is a binary classification method in which the ABC algorithm is used instead of the Gradient Descent algorithm to train the weights in the Logistic Regression classification model. The purpose of the CSA-ABC algorithm in the CSA-ABC-LR method is to minimize the value of the cost function. The ABC algorithm is a very popular metaheuristic method that can search for solutions both locally and globally in the solution space. In addition, it has been shown in the study that the CSA-ABC-LR classification method achieves superior classification success compared to the LR classification method.

Although the ABC-LR classification method can handle complex and high-dimensional data, its runtime can be high. Therefore, CPU and GPU parallelized versions of the ABC-LR classification method are presented here, and significant improvements in runtime can be achieved.

ABC-LR is written in Python3 and continuously tested with Python 3.7 and 3.10.

Installation

Install ABC-LR via PyPI:

pip install csa_abc_lr

Or alternatively, clone the environment:

git clone https://github.com/kagandedeturk/CSA-ABC-LR.git

CPU Version Usage

import numpy as np
parallelType = np
from abcLR import ABC_LR_Model
from sklearn.datasets import load_breast_cancer
X, y = load_breast_cancer(return_X_y=True)
y = y.reshape(-1,1)

lb = -16
ub = 16
evaluationNumber = 80000
# FVS = trainData.shape[1]
limit = 50
P = 60
MR = 0.3
L2 = 0

model = ABC_LR_Model(lb=lb, ub=ub, evaluationNumber=evaluationNumber, limit=limit, P=P, MR=MR, L2=L2, parallelType=parallelType)
#start_time = dt.datetime.now()
model.fit(X, y)
#print(f"Run time: {dt.datetime.now()-start_time}")
print(f"Result: {model.score(X, y)}")

GPU Version Usage

import cupy as cp
parallelType = cp
from abcLR import ABC_LR_Model
from sklearn.datasets import load_breast_cancer
X, y = load_breast_cancer(return_X_y=True)

X = parallelType.array(X)
y = parallelType.array(y.reshape(-1,1))

lb = -16
ub = 16
evaluationNumber = 80000
# FVS = trainData.shape[1]
limit = 50
P = 60
MR = 0.3
L2 = 0

model = ABC_LR_Model(lb=lb, ub=ub, evaluationNumber=evaluationNumber, limit=limit, P=P, MR=MR, L2=L2, parallelType=parallelType)
#start_time = dt.datetime.now()
model.fit(X, y)
#print(f"Run time: {dt.datetime.now()-start_time}")
print(f"Result: {model.score(X, y)}")

License

This program is free software: you can redistribute it and/or modify it under the terms of the 3-clause BSD license (please see the LICENSE file).

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

You should have received a copy of the 3-clause BSD license along with this program (see LICENSE file). If not, see here.

Copyright (c) 2022, Bilge Kagan Dedeturk (kagandedeturk@gmail.com)

Metadata

Release files for csa-abcLR 1.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for csa-abcLR 1.0.2
File Size Uploaded Provenance
csa_abcLR-1.0.2.tar.gz 6.3 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for csa-abcLR 1.0.2
File Interpreter ABI Platform
csa_abcLR-1.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 12.9 kB

Release files / csa_abcLR-1.0.2.tar.gz

Download URL csa_abcLR-1.0.2.tar.gz
Size 6.3 kB
Tags Source
SHA-256 checksum
How to use checksums
a90d031c436de748429d337def82185a64b76155fcb8864965beca75f5c450e7
BLAKE2b-256 checksum
How to use checksums
50cf6c49546d1bd5573d897b78784c65eb7e31c2de80a12e6283487a0be7102a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.1

Release files / csa_abcLR-1.0.2-py3-none-any.whl

Download URL csa_abcLR-1.0.2-py3-none-any.whl
Size 6.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ad5f93084602bc33a7d8c7a4cb7d0953266b0cd5a24be63981b8fa997b8c9f27
BLAKE2b-256 checksum
How to use checksums
3cf104cef8f5dc90c71e5946ae2fb3c18a9e218d7e106baaf85ff6c3f1ba2e91
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.1

Security for csa-abcLR 1.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page