Skip to content

Commit eae20a4

Browse files
author
cezary.maszczyk
committed
Merge branch 'develop'
2 parents 7d0f0ae + a3c0dfd commit eae20a4

20 files changed

+22596
-314
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,7 @@ tests/resources
283283

284284
*.pickle
285285

286+
doc/doc_env/
286287
doc/build/html
287288
doc/build/html/.buildinfo
288289
doc/build/html/.buildinfo

README.md

+3-5
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,11 @@ from rulekit import RuleKit
3838
from rulekit.classification import RuleClassifier
3939
from sklearn.datasets import load_iris
4040

41-
RuleKit.init()
42-
43-
x, y = load_iris(return_X_y=True)
41+
X, y = load_iris(return_X_y=True)
4442

4543
clf = RuleClassifier()
46-
clf.fit(x, y)
47-
prediction = clf.predict(x)
44+
clf.fit(X, y)
45+
prediction = clf.predict(X)
4846

4947
print(prediction)
5048
```

doc/requirements.txt

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
Sphinx==3.5.3
2-
sphinx-rtd-theme==0.5.1
3-
nbsphinx==0.8.2
4-
sphinx-copybutton==0.3.1
1+
Jinja2<3.1
2+
Sphinx==7.2.6
3+
sphinx-rtd-theme==2.0.0
4+
nbsphinx==0.9.3
5+
sphinx-copybutton==0.5.2
56
ipykernel==5.5.0
6-
pandoc==1.0.2
7+
pandoc~=2.3
78
../
89

doc/source/conf.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,20 @@
1313
import os
1414
import sys
1515
import re
16+
from datetime import datetime
1617
sys.path.insert(0, os.path.abspath('../..'))
1718

1819
current_path = os.path.dirname(os.path.realpath(__file__))
1920

21+
import rulekit
2022

2123
# -- Project information -----------------------------------------------------
2224

23-
project = 'rulekit'
24-
copyright = '2023, ADAA'
25+
project = f'rulekit v{rulekit.__VERSION__}'
26+
copyright = f'{datetime.now().year}, ADAA'
2527

2628
release = open(f'{current_path}/../../rulekit/__init__.py', mode='r').read().strip()
27-
version_regex = r'__version__\s*=\s*\'{0,1}"{0,1}([^\'"]+)\'{0,1}"{0,1}'
29+
version_regex = r'__VERSION__\s*=\s*\'{0,1}"{0,1}([^\'"]+)\'{0,1}"{0,1}'
2830
release = re.search(version_regex, release)[1]
2931
master_doc = 'index'
3032

doc/source/index.rst

+1
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,6 @@ All package models are writen to be compatible with scikit learn library.
2020
:caption: Table of contents:
2121

2222
Quick start <./rst/quick_start.rst>
23+
Whats new <./rst/whats_new.rst>
2324
Tutorials <./rst/tutorials.rst>
2425
Code documentation <./rst/autodoc.rst>

doc/source/rst/quick_start.rst

-25
Original file line numberDiff line numberDiff line change
@@ -28,28 +28,6 @@ To check if everything was installed correctly call:
2828
2929
It should run without errors and print package version.
3030

31-
Initializing package
32-
--------------------
33-
34-
Before you start using any of rulelkit package functionality you need to initialize it first. This step should be done only
35-
once at the beginning of the program, no need to initialize before every usage.
36-
37-
.. code-block:: python
38-
39-
from rulekit import RuleKit
40-
41-
RuleKit.init()
42-
43-
print(RuleKit.version)
44-
45-
If this step failed it probably means one of two things:
46-
47-
- you do not have java installed on your computer. Run :code:`'java -version'` and check for error and JRE version (it should be 1.8.0)
48-
49-
- there is no *'rulekit-*-all.jar'* file in *'jar'* directory of the package. You can get jar file from `here <https://github.com/adaa-polsl/RuleKit/releases>`_ (download file ending with *'-all.jar'*).
50-
51-
If everything worked fine it should print RuleKit jar version on the screen. You may wonder what is the difference between this version and the one printed at the beginning of this section. The first one is a version of python wrapper itself whereas the second on is a version of the `RuleKit <https://github.com/adaa-polsl/RuleKit>`_ library that is being used by the wrapper.
52-
5331
Package usage
5432
--------------------
5533

@@ -65,9 +43,6 @@ Now we are finally ready to use rulekit package and its models.
6543
X=iris.data
6644
y=iris.target
6745
68-
# don't forget to call init!
69-
RuleKit.init()
70-
7146
classifier = RuleClassifier()
7247
classifier.fit(X, y)
7348

doc/source/rst/tutorials/bmt.arff

+295
Large diffs are not rendered by default.

doc/source/rst/tutorials/classification.ipynb

+22-22
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@
312312
},
313313
{
314314
"cell_type": "code",
315-
"execution_count": 3,
315+
"execution_count": 2,
316316
"metadata": {},
317317
"outputs": [],
318318
"source": [
@@ -329,7 +329,7 @@
329329
},
330330
{
331331
"cell_type": "code",
332-
"execution_count": 4,
332+
"execution_count": 5,
333333
"metadata": {},
334334
"outputs": [],
335335
"source": [
@@ -459,9 +459,9 @@
459459
" <tbody>\n",
460460
" <tr>\n",
461461
" <th>C2</th>\n",
462-
" <td>2.462655</td>\n",
463-
" <td>2.153342</td>\n",
464-
" <td>0.239038</td>\n",
462+
" <td>3.784658</td>\n",
463+
" <td>3.268134</td>\n",
464+
" <td>0.394257</td>\n",
465465
" <td>178</td>\n",
466466
" <td>5.005618</td>\n",
467467
" <td>14.382022</td>\n",
@@ -477,9 +477,9 @@
477477
" </tr>\n",
478478
" <tr>\n",
479479
" <th>Correlation</th>\n",
480-
" <td>2.600227</td>\n",
481-
" <td>2.167673</td>\n",
482-
" <td>0.411161</td>\n",
480+
" <td>3.130663</td>\n",
481+
" <td>2.592273</td>\n",
482+
" <td>0.492708</td>\n",
483483
" <td>58</td>\n",
484484
" <td>6.000000</td>\n",
485485
" <td>54.293103</td>\n",
@@ -495,9 +495,9 @@
495495
" </tr>\n",
496496
" <tr>\n",
497497
" <th>RSS</th>\n",
498-
" <td>2.868707</td>\n",
499-
" <td>2.345742</td>\n",
500-
" <td>0.503246</td>\n",
498+
" <td>3.186367</td>\n",
499+
" <td>2.761221</td>\n",
500+
" <td>0.402097</td>\n",
501501
" <td>60</td>\n",
502502
" <td>4.216667</td>\n",
503503
" <td>46.200000</td>\n",
@@ -518,9 +518,9 @@
518518
"text/plain": [
519519
" time_total_s time_growing_s time_pruning_s rules_count \\\n",
520520
"Measure \n",
521-
"C2 2.462655 2.153342 0.239038 178 \n",
522-
"Correlation 2.600227 2.167673 0.411161 58 \n",
523-
"RSS 2.868707 2.345742 0.503246 60 \n",
521+
"C2 3.784658 3.268134 0.394257 178 \n",
522+
"Correlation 3.130663 2.592273 0.492708 58 \n",
523+
"RSS 3.186367 2.761221 0.402097 60 \n",
524524
"\n",
525525
" conditions_per_rule induced_conditions_per_rule \\\n",
526526
"Measure \n",
@@ -1335,7 +1335,7 @@
13351335
},
13361336
{
13371337
"cell_type": "code",
1338-
"execution_count": 9,
1338+
"execution_count": 3,
13391339
"metadata": {},
13401340
"outputs": [],
13411341
"source": [
@@ -1388,15 +1388,15 @@
13881388
},
13891389
{
13901390
"cell_type": "code",
1391-
"execution_count": 11,
1391+
"execution_count": 7,
13921392
"metadata": {},
13931393
"outputs": [
13941394
{
13951395
"data": {
13961396
"text/plain": [
1397-
"time_total_s 1.644584\n",
1398-
"time_growing_s 1.443856\n",
1399-
"time_pruning_s 0.174255\n",
1397+
"time_total_s 1.843947\n",
1398+
"time_growing_s 1.635322\n",
1399+
"time_pruning_s 0.174192\n",
14001400
"rules_count 166.400000\n",
14011401
"conditions_per_rule 4.947738\n",
14021402
"induced_conditions_per_rule 13.622816\n",
@@ -1429,7 +1429,7 @@
14291429
},
14301430
{
14311431
"cell_type": "code",
1432-
"execution_count": 13,
1432+
"execution_count": 8,
14331433
"metadata": {},
14341434
"outputs": [
14351435
{
@@ -1479,7 +1479,7 @@
14791479
},
14801480
{
14811481
"cell_type": "code",
1482-
"execution_count": 14,
1482+
"execution_count": 9,
14831483
"metadata": {},
14841484
"outputs": [
14851485
{
@@ -1547,7 +1547,7 @@
15471547
},
15481548
{
15491549
"cell_type": "code",
1550-
"execution_count": 16,
1550+
"execution_count": 10,
15511551
"metadata": {},
15521552
"outputs": [
15531553
{

0 commit comments

Comments
 (0)