mirror of
https://github.com/Doctorado-ML/FImdlp.git
synced 2025-08-17 16:35:52 +00:00
Compare commits
12 Commits
Author | SHA1 | Date | |
---|---|---|---|
d8066ea274
|
|||
a2c1b07525
|
|||
05c12561ac
|
|||
8f4bdd262a
|
|||
0740d1f515
|
|||
eb7f3dc092
|
|||
cfc18adf06
|
|||
3ae0d67884
|
|||
0ca507c692
|
|||
|
70b3af94cc | ||
a5dc2d7162
|
|||
67726bf219
|
6
.github/workflows/codeql.yml
vendored
6
.github/workflows/codeql.yml
vendored
@@ -32,13 +32,15 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
language: ["cpp", "python"]
|
||||
language: ["python"]
|
||||
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
|
||||
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
@@ -61,6 +63,8 @@ jobs:
|
||||
- if: matrix.language == 'cpp'
|
||||
name: Build CPP
|
||||
run: |
|
||||
pip install -q --upgrade pip
|
||||
pip install -q scikit-learn cython
|
||||
make install
|
||||
# ℹ️ Command-line programs to run using the OS shell.
|
||||
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
|
||||
|
10
.github/workflows/main.yml
vendored
10
.github/workflows/main.yml
vendored
@@ -2,9 +2,9 @@ name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master, ci]
|
||||
branches: [main]
|
||||
pull_request:
|
||||
branches: [master]
|
||||
branches: [main]
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
@@ -16,7 +16,9 @@ jobs:
|
||||
python: ["3.10"]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: recursive
|
||||
- name: Set up Python ${{ matrix.python }}
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
@@ -24,7 +26,7 @@ jobs:
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
pip install -q --upgrade pip
|
||||
pip install -q scikit-learn
|
||||
pip install -q scikit-learn cython
|
||||
pip install -q --upgrade codecov coverage black flake8 codacy-coverage
|
||||
- name: Build and install
|
||||
run: |
|
||||
|
3
.gitmodules
vendored
Normal file
3
.gitmodules
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
[submodule "src/cppmdlp"]
|
||||
path = src/cppmdlp
|
||||
url = https://github.com/rmontanana/mdlp.git
|
4
Makefile
4
Makefile
@@ -15,6 +15,10 @@ coverage:
|
||||
make test
|
||||
coverage report -m
|
||||
|
||||
submodule:
|
||||
git submodule update --remote src/cppmdlp
|
||||
git submodule update --merge
|
||||
|
||||
lint: ## Lint and static-check
|
||||
black src
|
||||
flake8 --per-file-ignores="__init__.py:F401" src
|
||||
|
12
README.md
12
README.md
@@ -1,6 +1,10 @@
|
||||
# FImdlp
|
||||
|
||||
[](https://github.com/Doctorado-ML/FImdlp/actions/workflows/main.yml)
|
||||
[](https://github.com/Doctorado-ML/FImdlp/actions/workflows/codeql.yml)
|
||||
[](https://www.codacy.com/gh/Doctorado-ML/FImdlp/dashboard?utm_source=github.com&utm_medium=referral&utm_content=Doctorado-ML/FImdlp&utm_campaign=Badge_Grade)
|
||||
[](https://codecov.io/gh/Doctorado-ML/FImdlp)
|
||||
[](https://img.shields.io/pypi/v/FImdlp?color=g)
|
||||

|
||||
|
||||
Discretization algorithm based on the paper by Usama M. Fayyad and Keki B. Irani
|
||||
|
||||
@@ -8,6 +12,12 @@ Discretization algorithm based on the paper by Usama M. Fayyad and Keki B. Irani
|
||||
Multi-Interval Discretization of Continuous-Valued Attributes for Classification Learning. In Proceedings of the 13th International Joint Conference on Artificial Intelligence (IJCAI-95), pages 1022-1027, Montreal, Canada, August 1995.
|
||||
```
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
git clone --recurse-submodules https://github.com/doctorado-ml/FImdlp.git
|
||||
```
|
||||
|
||||
## Build and usage sample
|
||||
|
||||
### Python sample
|
||||
|
@@ -50,9 +50,5 @@ int main(int argc, char** argv)
|
||||
cout << item << endl;
|
||||
}
|
||||
}
|
||||
mdlp::indices_t indices = test.sortIndices(X[0]);
|
||||
for (auto item : indices) {
|
||||
cout << setw(3) << item << " " << X[0][item] << " " << y[item] << endl;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
1
src/cppmdlp
Submodule
1
src/cppmdlp
Submodule
Submodule src/cppmdlp added at e21482900b
@@ -60,11 +60,12 @@ class FImdlpTest(unittest.TestCase):
|
||||
self.assertEqual(clf.n_features_, 4)
|
||||
self.assertTrue(np.array_equal(X, clf.X_))
|
||||
self.assertTrue(np.array_equal(y, clf.y_))
|
||||
|
||||
expected = [
|
||||
[5.5, 5.800000190734863],
|
||||
[3.0999999046325684],
|
||||
[2.450000047683716, 4.800000190734863, 5.099999904632568],
|
||||
[0.800000011920929, 1.7000000476837158],
|
||||
[2.9000000953674316, 3.3499999046325684],
|
||||
[2.450000047683716, 4.800000190734863],
|
||||
[0.800000011920929, 1.7999999523162842],
|
||||
]
|
||||
self.assertListEqual(expected, clf.get_cut_points())
|
||||
self.assertListEqual([0, 1, 2, 3], clf.features_)
|
||||
@@ -108,11 +109,11 @@ class FImdlpTest(unittest.TestCase):
|
||||
)
|
||||
expected = [
|
||||
[0, 0, 1, 1],
|
||||
[2, 0, 1, 1],
|
||||
[2, 1, 1, 1],
|
||||
[1, 0, 1, 1],
|
||||
[0, 0, 1, 1],
|
||||
[1, 0, 1, 1],
|
||||
[1, 0, 1, 1],
|
||||
[1, 1, 1, 1],
|
||||
[1, 0, 1, 1],
|
||||
]
|
||||
self.assertTrue(np.array_equal(clf.transform(X[90:97]), expected))
|
||||
|
Reference in New Issue
Block a user