Skip to content

Commit 99ad18c

Browse files
committed
iter
1 parent a66b4ed commit 99ad18c

File tree

10 files changed

+171
-75
lines changed

10 files changed

+171
-75
lines changed
Lines changed: 46 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,59 @@
11
@import url("theme.css");
22

33
.highlight a {
4-
text-decoration: underline;
4+
text-decoration: underline;
55
}
66

77
.deprecated p {
8-
padding: 10px 7px 10px 10px;
9-
color: #b94a48;
10-
background-color: #F3E5E5;
11-
border: 1px solid #eed3d7;
8+
padding: 10px 7px 10px 10px;
9+
color: #b94a48;
10+
background-color: #f3e5e5;
11+
border: 1px solid #eed3d7;
1212
}
1313

1414
.deprecated p span.versionmodified {
15-
font-weight: bold;
15+
font-weight: bold;
1616
}
1717

1818
.wy-nav-content {
19-
max-width: 1200px !important;
19+
max-width: 1200px !important;
20+
}
21+
22+
/* Override some aspects of the pydata-sphinx-theme */
23+
24+
/* Getting started index page */
25+
26+
.intro-card {
27+
background: #fff;
28+
border-radius: 0;
29+
padding: 30px 10px 10px 10px;
30+
margin: 10px 0px;
31+
}
32+
33+
.intro-card .card-text {
34+
margin: 20px 0px;
35+
/*min-height: 150px; */
36+
}
37+
38+
.custom-button {
39+
background-color: #dcdcdc;
40+
border: none;
41+
color: #484848;
42+
text-align: center;
43+
text-decoration: none;
44+
display: inline-block;
45+
font-size: 0.9rem;
46+
border-radius: 0.5rem;
47+
max-width: 220px;
48+
padding: 0.5rem 0rem;
49+
}
50+
51+
.custom-button a {
52+
color: #484848;
53+
}
54+
55+
.custom-button p {
56+
margin-top: 0;
57+
margin-bottom: 0rem;
58+
color: #484848;
2059
}

doc/conf.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,11 @@
7979
# The name of the Pygments (syntax highlighting) style to use.
8080
pygments_style = "sphinx"
8181

82+
# -- Options for math equations -----------------------------------------------
83+
84+
extensions.append("sphinx.ext.imgmath")
85+
imgmath_image_format = "svg"
86+
8287
# -- Options for HTML output ----------------------------------------------
8388

8489
# The theme to use for HTML and HTML Help pages. See the documentation for
@@ -87,6 +92,9 @@
8792
html_favicon = "_static/img/favicon.ico"
8893
html_logo = "_static/img/logo.png"
8994
html_style = "css/imbalanced-learn.css"
95+
html_css_files = [
96+
"css/imbalanced-learn.css",
97+
]
9098

9199
html_theme_options = {
92100
"github_url": "https://github.com/scikit-learn-contrib/imbalanced-learn",
@@ -127,11 +135,6 @@
127135
# see https://github.com/numpy/numpydoc/issues/69
128136
numpydoc_show_class_members = False
129137

130-
# -- Options for math equations -----------------------------------------------
131-
132-
extensions.append("sphinx.ext.imgmath")
133-
imgmath_image_format = "svg"
134-
135138
# -- Options for sphinxcontrib-bibtex -----------------------------------------
136139

137140
# bibtex file
@@ -149,6 +152,7 @@
149152
"scipy": ("https://docs.scipy.org/doc/scipy/reference", None),
150153
"matplotlib": ("https://matplotlib.org/", None),
151154
"sklearn": ("http://scikit-learn.org/stable", None),
155+
"pandas": ("http://pandas.pydata.org/pandas-docs/stable/", None),
152156
}
153157

154158
# -- Options for sphinx-gallery -----------------------------------------------

doc/datasets/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,4 +150,4 @@ It would also work with pandas dataframe::
150150
Counter({'Iris-virginica': 50, 'Iris-versicolor': 20, 'Iris-setosa': 10})
151151

152152
See :ref:`sphx_glr_auto_examples_datasets_plot_make_imbalance.py` and
153-
:ref:`sphx_glr_auto_examples_plot_sampling_strategy_usage.py`.
153+
:ref:`sphx_glr_auto_examples_api_plot_sampling_strategy_usage.py`.

doc/index.rst

Lines changed: 84 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -3,73 +3,108 @@
33
You can adapt this file completely to your liking, but it should at least
44
contain the root `toctree` directive.
55
6-
###############################
7-
imbalanced-learn documentation!
8-
###############################
6+
:notoc:
97

10-
.. toctree::
11-
:maxdepth: 2
12-
:hidden:
13-
:caption: Getting Started
8+
##############################
9+
imbalanced-learn documentation
10+
##############################
1411

15-
install
12+
**Date**: |today| **Version**: |version|
1613

17-
.. toctree::
18-
:maxdepth: 2
19-
:hidden:
20-
:caption: Documentation
14+
**Useful links**:
15+
`Binary Installers <https://pypi.org/project/imbalanced-learn>`__ |
16+
`Source Repository <https://github.com/scikit-learn-contrib/imbalanced-learn>`__ |
17+
`Issues & Ideas <https://github.com/scikit-learn-contrib/imbalanced-learn/issues>`__ |
18+
`Q&A Support <https://gitter.im/scikit-learn-contrib/imbalanced-learn>`__
2119

22-
user_guide
23-
references/index
20+
Imbalanced-learn (imported as :mod:`imblearn`) is an open source, MIT-licensed
21+
library relying on scikit-learn (imported as :mod:`sklearn`) and provides tools
22+
when dealing with classification with imbalanced classes.
2423

25-
.. toctree::
26-
:maxdepth: 2
27-
:hidden:
28-
:caption: Tutorial - Examples
24+
.. raw:: html
2925

30-
auto_examples/index
26+
<div class="container">
27+
<div class="row">
28+
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12 d-flex">
29+
<div class="card text-center intro-card shadow">
30+
<div class="card-body flex-fill">
31+
<i class="fas fa-download fa-7x"></i>
32+
<h5 class="card-title">Getting started</h5>
33+
<p class="card-text">Check out the getting started guides to install <em>imbalanced-learn</em>.
34+
Some extra information to get started with a new contribution is also provided.</p>
3135

32-
.. toctree::
33-
:maxdepth: 1
34-
:hidden:
35-
:caption: Addtional Information
36+
.. container:: custom-button
3637

37-
whats_new
38-
about
38+
:ref:`To the installation guideline<getting_started>`
3939

40-
`Getting started <install.html>`_
41-
---------------------------------
40+
.. raw:: html
4241

43-
Information to install, test, and contribute to the package.
42+
</div>
43+
</div>
44+
</div>
45+
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12 d-flex">
46+
<div class="card text-center intro-card shadow">
47+
<div class="card-body flex-fill">
48+
<i class="fas fa-book fa-7x"></i>
49+
<h5 class="card-title">User guide</h5>
50+
<p class="card-text">The user guide provides in-depth information on the
51+
key concepts of imbalanced-learn with useful background information and explanation.</p>
4452

45-
`User Guide <user_guide.html>`_
46-
-------------------------------
53+
.. container:: custom-button
4754

48-
The main documentation. This contains an in-depth description of all
49-
algorithms and how to apply them.
55+
:ref:`To the user guide<user_guide>`
5056

51-
`API Documentation <references/index.html>`_
52-
-------------------------------------------
57+
.. raw:: html
5358

54-
The exact API of all functions and classes, as given in the
55-
doctring. The API documents expected types and allowed features for
56-
all functions, and all parameters available for the algorithms.
59+
</div>
60+
</div>
61+
</div>
62+
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12 d-flex">
63+
<div class="card text-center intro-card shadow">
64+
<div class="card-body flex-fill">
65+
<i class="fas fa-code fa-7x"></i>
66+
<h5 class="card-title">API reference</h5>
67+
<p class="card-text">The reference guide contains a detailed description of
68+
the imbalanced-learn API. To known more about methods parameters.</p>
5769

58-
`Examples <auto_examples/index.html>`_
59-
--------------------------------------
70+
.. container:: custom-button
6071

61-
A set of examples illustrating the use of the different algorithms. It
62-
complements the `User Guide <user_guide.html>`_.
72+
:ref:`To the reference guide<api>`
6373

64-
`What's new <whats_new.html>`_
65-
------------------------------
74+
.. raw:: html
6675

67-
Log of the imbalanced-learn history.
76+
</div>
77+
</div>
78+
</div>
79+
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12 d-flex">
80+
<div class="card text-center intro-card shadow">
81+
<div class="card-body flex-fill">
82+
<i class="fas fa-chart-bar fa-7x"></i>
83+
<h5 class="card-title">Examples</h5>
84+
<p class="card-text">The gallery of examples is a good place to see imbalanced-learn in action.
85+
Select an example and dive in.</p>
6886

69-
`About imbalanced-learn <about.html>`_
70-
--------------------------------------
87+
.. container:: custom-button
7188

72-
Just to know about history of imbalanced-learn.
89+
:ref:`To the gallery of examples<general_examples>`
7390

74-
See the `README <https://github.com/scikit-learn-contrib/imbalanced-learn/blob/master/README.rst>`_
75-
for more information.
91+
.. raw:: html
92+
93+
</div>
94+
</div>
95+
</div>
96+
</div>
97+
</div>
98+
99+
100+
.. toctree::
101+
:maxdepth: 3
102+
:hidden:
103+
:titlesonly:
104+
105+
install
106+
user_guide
107+
references/index
108+
auto_examples/index
109+
whats_new
110+
about

doc/install.rst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
#######
2-
Install
3-
#######
1+
.. _getting_started:
2+
3+
###############
4+
Getting Started
5+
###############
46

57
Prerequisites
68
=============

doc/introduction.rst

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,29 @@ and adding a sampling functionality through the ``sample`` method:
2626

2727
Imbalanced-learn samplers accept the same inputs that in scikit-learn:
2828

29-
* ``data``: array-like (2-D list, pandas.Dataframe, numpy.array) or sparse
30-
matrices;
31-
* ``targets``: array-like (1-D list, pandas.Series, numpy.array).
29+
* `data`:
30+
* 2-D :class:`list`,
31+
* 2-D :class:`numpy.ndarray`,
32+
* :class:`pandas.DataFrame`,
33+
* :class:`scipy.sparse.csr_matrix` or :class:`scipy.sparse.csc_matrix`;
34+
* `targets`:
35+
* 1-D :class:`numpy.ndarray`,
36+
* :class:`pandas.Series`.
3237

3338
The output will be of the following type:
3439

35-
* ``data_resampled``: array-like (2-D list, pandas.Dataframe, numpy.array) or
36-
sparse matrices;
37-
* ``targets_resampled``: 1-D numpy.array or pd.Series.
40+
* `data_resampled`:
41+
* 2-D :class:`numpy.ndarray`,
42+
* :class:`pandas.DataFrame`,
43+
* :class:`scipy.sparse.csr_matrix` or :class:`scipy.sparse.csc_matrix`;
44+
* `targets_resampled`:
45+
* 1-D :class:`numpy.ndarray`,
46+
* :class:`pandas.Series`.
47+
48+
.. topic:: Pandas in/out
49+
50+
Unlike scikit-learn, imbalanced-learn provides support for pandas in/out.
51+
Therefore providing a dataframe, will output as well a dataframe.
3852

3953
.. topic:: Sparse input
4054

doc/miscellaneous.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ sampling for regression targets.
5454
We illustrate the use of such sampler to implement an outlier rejection
5555
estimator which can be easily used within a
5656
:class:`~imblearn.pipeline.Pipeline`:
57-
:ref:`sphx_glr_auto_examples_plot_outlier_rejections.py`
57+
:ref:`sphx_glr_auto_examples_applications_plot_outlier_rejections.py`
5858

5959
.. _generators:
6060

doc/references/index.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
.. _api:
2+
13
#############
24
API reference
35
#############
@@ -17,4 +19,4 @@ This is the full API documentation of the `imbalanced-learn` toolbox.
1719
pipeline
1820
metrics
1921
datasets
20-
Utilities
22+
utils

imblearn/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ class FunctionSampler(BaseSampler):
167167
Notes
168168
-----
169169
See
170-
:ref:`sphx_glr_auto_examples_plot_outlier_rejections.py`
170+
:ref:`sphx_glr_auto_examples_applications_plot_outlier_rejections.py`
171171
172172
Examples
173173
--------

imblearn/datasets/_imbalance.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def make_imbalance(
6969
See
7070
:ref:`sphx_glr_auto_examples_applications_plot_multi_class_under_sampling.py`,
7171
:ref:`sphx_glr_auto_examples_datasets_plot_make_imbalance.py`, and
72-
:ref:`sphx_glr_auto_examples_plot_sampling_strategy_usage.py`.
72+
:ref:`sphx_glr_auto_examples_api_plot_sampling_strategy_usage.py`.
7373
7474
Examples
7575
--------

0 commit comments

Comments
 (0)