Skip to content

Commit

Permalink
Release v0.3.1 #232 from WEgeophysics/develop
Browse files Browse the repository at this point in the history
v0.3.1 (March 7, 2024)
-------------------------

Changes and enhancements have been made to the API since version ``v0.3.0``, leading to the introduction of new features and the resolution of various bugs.

- |API change| From now on, only the selected utilities listed below are available as the public API, which has led to shorter loading times for the package. The available 
  public API functions include: 

    - :func:`watex.utils.bi_selector` available publicly as :func:`watex.bi_selector`
    - :func:`watex.utils.cleaner` available publicly as :func:`watex.cleaner`
    - :func:`watex.utils.erpSelector` available publicly as :func:`watex.erpSelector`
    - :func:`watex.utils.erpSmartDetector` available publicly as :func:`watex.erpSmartDetector`
    - :func:`watex.utils.fetch_data` available publicly as :func:`watex.fetch_data`
    - :func:`watex.utils.fittensor` available publicly as :func:`watex.fittensor`
    - :func:`watex.utils.get2dtensor` available publicly as :func:`watex.get2dtensor`
    - :func:`watex.utils.make_erp` available publicly as :func:`watex.make_erp`
    - :func:`watex.utils.make_naive_pipe` available publicly as :func:`watex.make_naive_pipe`
    - :func:`watex.utils.make_ves` available publicly as :func:`watex.make_ves`
    - :func:`watex.utils.magnitude` available publicly as :func:`watex.magnitude`
    - :func:`watex.utils.naive_imputer` available publicly as :func:`watex.naive_imputer`
    - :func:`watex.utils.naive_scaler` available publicly as :func:`watex.naive_scaler`
    - :func:`watex.utils.ohmicArea` available publicly as :func:`watex.ohmicArea`
    - :func:`watex.utils.plotAnomaly` available publicly as :func:`watex.plotAnomaly`
    - :func:`watex.utils.plot_confidence_in` available publicly as :func:`watex.plot_confidence_in`
    - :func:`watex.utils.plotOhmicArea` available publicly as :func:`watex.plotOhmicArea`
    - :func:`watex.utils.plot_sfi` available publicly as :func:`watex.plot_sfi`
    - :func:`watex.utils.power` available publicly as :func:`watex.power`
    - :func:`watex.utils.qc` available publicly as :func:`watex.qc`
    - :func:`watex.utils.read_data` available publicly as :func:`watex.read_data`
    - :func:`watex.utils.selectfeatures` available publicly as :func:`watex.selectfeatures`
    - :func:`watex.utils.sfi` available publicly as :func:`watex.sfi`
    - :func:`watex.utils.shape` available publicly as :func:`watex.shape`
    - :func:`watex.utils.smart_label_classifier` available publicly as :func:`watex.smart_label_classifier`
    - :func:`watex.utils.to_numeric_dtypes` available publicly as :func:`watex.to_numeric_dtypes`
    - :func:`watex.utils.type_` available publicly as :func:`watex.type_`
    - :func:`watex.utils.vesSelector` available publicly as :func:`watex.vesSelector`

- |API change| The parameter ``edi_obj`` in :func:`watex.utils.plot_skew` has been deprecated and replaced by ``edis_list``, which refers to either a collection of :term:`EDI` files or a full path to EDI files. Two-dimensional skewness, represented as :math:`eta`, can now be visualized by setting the parameter ``view='2D'``.

- |API change| The ``xgboost`` library is no longer automatically installed as a dependency. Users must install it separately for complete model functionality or use the ``dev`` option as shown below:

  .. code-block:: bash 

    pip install watex[dev]

- |Fix| The :class:`watex.em.EM` module now throws a :class:`watex.exceptions.EDIError` instead of an ``AttributeError`` when an EDI file is expected but an object is passed.

- |Fix| The `base_estimator` parameter is no longer available in scikit-learn versions greater than 1.2; it has been renamed to `estimator`. Consequently, :mod:`watex.models` and :mod:`watex.models.premodels` have been updated to reflect this change.

- |Feature| The :func:`watex.utils.plotutils.plot_l_curve` function has been introduced to plot the Hansen L-curve, with an option to highlight the Hansen point. This feature uses the L-curve criterion to determine the most suitable model after performing multiple inversions with different :math:`\tau` values.
  • Loading branch information
earthai-tech authored Mar 8, 2024
2 parents d6e2bbe + d3ff6b3 commit b488cfe
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 7 deletions.
2 changes: 2 additions & 0 deletions docs/whatsnew/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Version 0.3
.. toctree::
:maxdepth: 2

v0.3.1
v0.3.0


Expand All @@ -22,6 +23,7 @@ Version 0.2
.. toctree::
:maxdepth: 2

v0.2.8
v0.2.7
v0.2.6
v0.2.5
Expand Down
4 changes: 2 additions & 2 deletions watex/methods/em.py
Original file line number Diff line number Diff line change
Expand Up @@ -3947,7 +3947,7 @@ def filter_noises (
kind of filtering technique to smooth data. Can be:
- 'base': for simple moving-average using convolution strategy
- 'ama': for naive adapttive moving average
- 'ama': for naive adaptative moving average
- 'butter': for Butterworth filter using bandpass strategy. (lowcut
highcut) can be set using the `frange` parameters.
- 'tv': for Torres-Verdin filter [1]_
Expand Down Expand Up @@ -4510,7 +4510,7 @@ def _ss_auto_regulator (

init_freq = len(edi_obj_init.Z.freq)
half_two = (init_freq -2) //2
nfreq = half_two + (half_two//2 )
nfreq = round ( + (half_two//2 ))
skipfreq = half_two * 2 -nfreq

else:
Expand Down
16 changes: 14 additions & 2 deletions watex/utils/plotutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3942,6 +3942,9 @@ def plot_voronoi(
line_width=1. ,
line_alpha=1.,
fig_size = (7, 7),
cmap='set1',
show_grid=True,
alpha=0.2,
fig_title = ''
):
"""Plots the Voronoi diagram of the k-means clusters overlaid with
Expand Down Expand Up @@ -3991,18 +3994,27 @@ def plot_voronoi(

from scipy.spatial import Voronoi, voronoi_plot_2d

ax.scatter(X[:, 0], X[:, 1], c=y, cmap='Set1', alpha=0.2,
ax.scatter(X[:, 0], X[:, 1], c=y, cmap=cmap, alpha=0.2,
label = 'Voronoi plot')
vor = Voronoi(cluster_centers)
voronoi_plot_2d(vor, ax=ax, show_vertices=show_vertices,
alpha=0.5,
alpha=alpha,
line_colors=line_colors,
line_width=line_width ,
line_alpha=line_alpha,
)
#ax.legend()
ax.set_title (fig_title , fontsize=20)
#fig.suptitle(fig_title, fontsize=20)
# Make the right and bottom spines thicker and black
ax.spines['left'].set_linewidth(2)
ax.spines['left'].set_color('black')
ax.spines['bottom'].set_linewidth(2)
ax.spines['bottom'].set_color('black')

if show_grid: plt.grid()
else: ax.grid(False)

return ax


Expand Down
12 changes: 9 additions & 3 deletions watex/view/mlplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -2887,12 +2887,18 @@ def plotLearningInspections (

if not is_iterable( axes) :
axes =[axes ]
cscores =[]; vscores =[]
for kk, model in enumerate ( models ) :
title = titles[kk] or get_estimator_name (model )
plotLearningInspection(model, X=X , y=y, axes = axes [:, kk],
_, csc, vsc = plotLearningInspection(model, X=X , y=y, axes = axes [:, kk],
title =title,
**kws)

cscores.append(csc); vscores.append (vsc)
print("*"*77)
print("Convergence scores =", np.around(np.mean(cscores), 4))
print("validation scores =", np.around (np.nanmean(vscores), 4))
print("*"*77)

if savefig :
fig.savefig (savefig , dpi = 300 )
plt.show () if savefig is None else plt.close ()
Expand Down Expand Up @@ -3098,7 +3104,7 @@ def plotLearningInspection(
axes[2].set_ylabel("Score")
axes[2].set_title(f"Performance of {title_name}")

return axes
return axes , np.mean([train_scores[-1], test_scores[-1]]),test_scores_mean
#XXX
def plot_matshow(
arr, / , labelx:List[str] =None, labely:List[str]=None,
Expand Down

0 comments on commit b488cfe

Please sign in to comment.