# InstanceSelection
InstanceSelection is a Python module for reducing number of instances in datasets used in classification problems.
The module is implemented as part of an engineering project.
# Instalation
```
pip install data_reduction
```
# Usage
## Data loading and preparation
The first step is to load and prepare data using DataPreparation:
```
data = DataPreparation('iris')
```
## Instance selection with selected algoritm
For all algorithms required parameter is instance of DataPreparation. Then you can reduce instances and prepare raport.
```
alg = DROP1(data, k=3)
alg.reduce_instances()
```
## Creating raport
After reduction with selected algorithm you can create raport:
```
rap = Raport(data, alg.red_data, alg.red_lab)
rap.print_raport(c_type = 'knn')
```
# Results of raporting
```
=============
Classifier: knn
=============
Raport for original dataset
Count of instances: 105
precision recall f1-score support
Iris-setosa 1.0000 1.0000 1.0000 19
Iris-versicolor 1.0000 1.0000 1.0000 13
Iris-virginica 1.0000 1.0000 1.0000 13
accuracy 1.0000 45
macro avg 1.0000 1.0000 1.0000 45
weighted avg 1.0000 1.0000 1.0000 45
Cohen's Kappa: 1.00
===
Training time: 0.0008822999999997805
Predicting time: 0.003322799999999848
Raport for reduced dataset
Count of instances: 21
precision recall f1-score support
Iris-setosa 1.0000 1.0000 1.0000 19
Iris-versicolor 0.7647 1.0000 0.8667 13
Iris-virginica 1.0000 0.6923 0.8182 13
accuracy 0.9111 45
macro avg 0.9216 0.8974 0.8949 45
weighted avg 0.9320 0.9111 0.9090 45
Cohen's Kappa: 0.86
===
Training time: 0.0006775000000001086
Predicting time: 0.0024793999999999095
Reduction factor: 80.00 %
```
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
共32个文件
py:24个
txt:4个
pkg-info:2个
资源分类:Python库 所属语言:Python 资源全名:data_reduction-0.0.1.tar.gz 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059
资源推荐
资源详情
资源评论
收起资源包目录
data_reduction-0.0.1.tar.gz (32个子文件)
data_reduction-0.0.1
PKG-INFO 3KB
InstanceReduction
Reduction
_NNGraph.py 5KB
ENN.py 5KB
MSS.py 5KB
__init__.py 0B
ICF.py 7KB
_Reduction.py 819B
PSC.py 14KB
DROP1.py 5KB
__init__.py 0B
Raport.py 13KB
DataPreparation.py 12KB
data_reduction.egg-info
PKG-INFO 3KB
requires.txt 50B
SOURCES.txt 865B
top_level.txt 24B
dependency_links.txt 1B
tests
ENN_test.py 147B
const.py 1KB
DROP1_test.py 766B
DataPreparation_load_test.py 3KB
MSS_test.py 1KB
__init__.py 0B
PCS_test.py 3KB
Raport_test.py 1KB
DataPreparation_prepar_test.py 3KB
ICF_test.py 2KB
test_reduction.py 2KB
NNGraph_test.py 3KB
setup.cfg 42B
setup.py 1012B
README.md 2KB
共 32 条
- 1
资源评论
挣扎的蓝藻
- 粉丝: 13w+
- 资源: 15万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功