Skip to content

Commit

Permalink
Multiple changes (#862)
Browse files Browse the repository at this point in the history
- warning for old deprecated imports (we could not cover all of them)
 - updating changelogs
 - making plotly the main plotting lib
 - now %load_ext verticapy.chart works
  • Loading branch information
oualib authored Nov 14, 2023
1 parent 7a17d59 commit 0a6f164
Show file tree
Hide file tree
Showing 30 changed files with 326 additions and 37 deletions.
6 changes: 3 additions & 3 deletions docs/source/chart_gallery_corr.rst
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ Please click on the tabs to view the various graphics generated by the different

.. code-block:: python
%load_ext verticapy.hchart
%load_ext verticapy.chart
We write the SQL query using Jupyter magic cells.

Expand Down Expand Up @@ -161,7 +161,7 @@ Please click on the tabs to view the various graphics generated by the different

.. code-block:: python
%load_ext verticapy.hchart
%load_ext verticapy.chart
We write the SQL query using Jupyter magic cells.

Expand Down Expand Up @@ -231,7 +231,7 @@ Please click on the tabs to view the various graphics generated by the different

.. code-block:: python
%load_ext verticapy.hchart
%load_ext verticapy.chart
We write the SQL query using Jupyter magic cells.

Expand Down
92 changes: 61 additions & 31 deletions docs/source/whats_new_v1_0_0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,69 @@
Version 1.0.0
===============



This release contains some major changes, including:


- Micro Focus is now OpenText. All the documentation containing copyright information has been updated to represent the new ownership of Vertica and its associated products.


- Requirements update: Python version 3.13 is now supported.
- Minimum supported Python version is 3.8.
- Requirements update: Python version 3.10-3.12 are now supported.
- Minimum supported Python version is 3.9.

.. note::

An internal minimum function python decorator (@check_minimum_version)
warns users if any of the Vertica modules do not meet the requirement for the function in use.

Versioning Guidelines
----------------------

We highly recommend transitioning to the syntax of version 1.0.0, as the previous versions were in beta and subject to potential changes at any moment. Our current versioning process follows a systematic approach:

- **Major Version Increment:** This is reserved for substantial changes that involve a significant shift in syntax and may deprecate multiple elements. Users should be prepared for a notable adjustment in how they interact with the software.
- **Minor Version Increment:** Occurs when introducing new functionalities and making substantial improvements. Users can anticipate enhanced features and capabilities without major disruptions to their existing workflows.
- **Last Digit Increment:** Reserved for bug fixes and changes that do not influence the syntax or functionality of the previous version. These updates are aimed at enhancing stability and addressing issues without requiring users to adapt to a new syntax.

By adhering to this versioning strategy, users can effectively navigate updates, ensuring a smooth transition while benefiting from the latest features, improvements, and bug fixes.

Upcoming Changes: Deprecated Modules
-------------------------------------

Several modules have been deprecated as part of a code restructuring initiative. Please be aware that the following import will soon be unsupported:

.. code-block:: python
# Moved to verticapy.sql.geo
import verticapy.geo
# Moved to verticapy.machine_learning
# And also restructured
import verticapy.learn
# Moved to verticapy.sql.functions
# And also restructured
import verticapy.stats
# Moved to verticapy.sdk.vertica
import verticapy.udf
# Moved to verticapy.sql
# And also restructured
import verticapy.utilities
# Moved to verticapy.core
# And also restructured
import verticapy.vdataframe
# New syntax: %load_ext verticapy.chart
%load_ext verticapy.hchart
As this is a major version release and to uphold best practices, we are expeditiously phasing out all old methodologies. It is imperative to ensure a swift adaptation to the new syntax. Warnings have been issued for several imports, and they will soon be removed.

In parallel, we are actively developing a set of new tests. Consequently, the current 'tests' folder will soon be replaced by 'tests_new'. Your cooperation in transitioning to the updated syntax and directory structure is greatly appreciated.

Bug fixes
-----------
----------

- Adjusted-R squared now works with "K" parameter
- Adjusted-R squared now works with "k" parameter
- Corrected calculation of Prevalence Threshold
- Fixed nested pie plots
- Improved vDataFrame.balance() function
Expand All @@ -41,15 +83,17 @@ Bug fixes
____

Machine Learning Support
--------------------------
-------------------------

- New Vertica algorithms supported:
- IsolationForest
- KPrototypes
- Poisson Regression
- AutoRegressive (AR)
- MovingAverages (MA)
- AutoRegressive Moving Averages (ARMA)
- AutoRegressive Integrated Moving Averages (ARIMA)
- Term Frequency * Inverse Document Frequency (TFIDF). It is still beta.

- New function for finding the feature importance for XGBoost models.
- Classification metrics are now available for multiclass data/model using three methods: ``micro``, ``macro``, ``weighted``, ``score`` and ``none``.
Expand All @@ -59,7 +103,7 @@ Machine Learning Support
- Model Tracking and Versioning now supported.
Check out :ref:`notebooks/ml/model_tracking_versioning/index.ipynb` for more details.
- Model Export and Import:
Now models can be exported to ``pmml``, ``tensorflow``, and ``binary``.
Now models can be exported to ``pmml``, ``tensorflow``, and ``binary``. They can now be exported to another User Defined Location.

_____

Expand All @@ -73,19 +117,16 @@ SQL
import verticapy as vp
vp.vDataFrame("(SELECT pclass, embarked, AVG(survived) FROM public.titanic GROUP BY 1, 2) x")
The new format supports other methods for creating ``vDataFrame``s.
.. code-block:: python
vp.vDataFrame({"X":[1,2,3],"Y":['a','b','c']})
_______
Plotting
-----------
---------
- Plotly is now the default plotting library, introducing improved visualizations. The Plotly plots are more interactive and enhance the user experience.
- Plotly Outliers plot now has the option to customize colors using the ``colors`` parameter.
Expand All @@ -112,29 +153,24 @@ Plotting
- PLotly Histogram plot now allows multiple plots.
- You can now easily switch between the plotting libraries using the following syntax:


.. code-block:: python
from verticapy import set_option
set_option("plotting_lib","matplotlib")
.. note:: The ``Hchart`` function is deprecated. The Highcharts plots can be plotted using the regular SQL plotting syntax by setting Highcharts as the default plotting library.
.. note:: The ``hchart`` function is deprecated. The Highcharts plots can be plotted using the regular SQL plotting syntax by setting Highcharts as the default plotting library.

- The parameters ``custom_height`` and ``custom_width`` have been added to all plots so that the sizes can be changed as needed.


- Validators now ensure that only supported options are selected for the VerticaPy options.


- Users can now plot directly from SQL queries:

.. code-block:: python
%load_ext verticapy.jupyter.extensions.chart_magic
%chart -c sql_command -f input_file -k 'auto' -o output_file
The chart command is similar to the hchart command, accepting four arguments:
1. SQL command
Expand All @@ -148,10 +184,8 @@ Plotting
%chart -k pie -c "SELECT pclass, AVG(age) AS av_avg FROM titanic GROUP BY 1;"
Classification Metrics
-------------------------
-----------------------

Added support for many new classification and regression metrics.

Expand All @@ -173,12 +207,11 @@ The following metrics have been added to the classification report:

_____

Library Heirarchy
-------------------
Library Hierarchy
------------------

Import structures have changed. The code has been completely restructured, which means that going forward all imports will be done differently. Currently, we still allow the previous structure of import, but it will gradually be deprecated.


The new structure has the following parent folders:

- Core [includes ``vDataFrame``, parsers ``string_sql``, and ``tablesample``]
Expand All @@ -192,14 +225,12 @@ The new structure has the following parent folders:

.. note:: The folders with "_" subscript are internal


For example, to use Vertica's `LinearRegression`, it should now be imported as follows:

.. code-block:: python
from verticapy.machine_learning.vertica import LinearRegression
To import statistical tests:

.. code-block:: python
Expand All @@ -209,7 +240,7 @@ To import statistical tests:
____

Added Model Tracking tool (MLOps)
------------------------------------
----------------------------------

It is a common practice for data scientists to train tens of temporary models before picking one of them as their candidate model for going into production.
A model tracking tool can help each individual data scientist to easily track the models trained for an experiment (project) and compare their metrics for choosing the best one.
Expand Down Expand Up @@ -262,7 +293,7 @@ Example:
Others
---------
-------

- Docstrings have been enriched to add examples and other details that will help in creating a more helpful doc.
- A new dataset "Africa Education" has been added to the dataset library. It can be easily imported using:
Expand All @@ -282,7 +313,6 @@ Others


- Verticapylab autoconnection. Slight modification to allow smooth integration of the upcoming VerticaPyLab.


Internal
=========
Expand Down
2 changes: 1 addition & 1 deletion verticapy/_config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ def set_option(key: str, value: Any = None) -> None:
register_option(
Option(
"plotting_lib",
"matplotlib",
"plotly",
"",
in_validator(["highcharts", "matplotlib", "plotly"]),
)
Expand Down
17 changes: 17 additions & 0 deletions verticapy/chart/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
"""
Copyright (c) 2018-2023 Open Text or one of its
affiliates. Licensed under the Apache License,
Version 2.0 (the "License"); You may not use this
file except in compliance with the License.
You may obtain a copy of the License at:
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in
writing, software distributed under the License is
distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing
permissions and limitations under the License.
"""
from verticapy.jupyter.extensions.chart_magic import load_ipython_extension
10 changes: 10 additions & 0 deletions verticapy/geo/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@
See the License for the specific language governing
permissions and limitations under the License.
"""
import warnings

warning_message = (
"Importing from 'verticapy.geo' is deprecated, "
"and it will no longer be possible in the next release. "
"Please use 'verticapy.sql.geo' instead "
"to ensure compatibility with upcoming versions."
)
warnings.warn(warning_message, Warning)

from verticapy.sql.geo.functions import (
coordinate_converter,
intersect,
Expand Down
10 changes: 10 additions & 0 deletions verticapy/hchart/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,14 @@
See the License for the specific language governing
permissions and limitations under the License.
"""
import warnings

warning_message = (
"Loading extension 'verticapy.hchart' is deprecated, "
"and it will no longer be possible in the next release. "
"Please use 'verticapy.chart' instead "
"to ensure compatibility with upcoming versions."
)
warnings.warn(warning_message, Warning)

from verticapy.jupyter.extensions.chart_magic import load_ipython_extension
2 changes: 1 addition & 1 deletion verticapy/jupyter/extensions/chart_magic.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ def chart_magic(
.. ipython:: python
:suppress:
%load_ext verticapy.hchart
%load_ext verticapy.chart
Run the following to load some sample datasets. Once loaded, these datasets are
stored in the 'public' schema. You can change the target schema with the
Expand Down
9 changes: 9 additions & 0 deletions verticapy/learn/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,12 @@
See the License for the specific language governing
permissions and limitations under the License.
"""
import warnings

warning_message = (
"Importing from 'verticapy.learn' is deprecated, "
"and it will no longer be possible in the next release. "
"Please use 'verticapy.machine_learning' instead "
"to ensure compatibility with upcoming versions."
)
warnings.warn(warning_message, Warning)
10 changes: 10 additions & 0 deletions verticapy/learn/cluster/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@
See the License for the specific language governing
permissions and limitations under the License.
"""
import warnings

warning_message = (
"Importing from 'verticapy.learn.cluster' is deprecated, "
"and it will no longer be possible in the next release. "
"Please use 'verticapy.machine_learning.vertica' instead "
"to ensure compatibility with upcoming versions."
)
warnings.warn(warning_message, Warning)

from verticapy.machine_learning.vertica.cluster import (
BisectingKMeans,
DBSCAN,
Expand Down
10 changes: 10 additions & 0 deletions verticapy/learn/decomposition/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,14 @@
See the License for the specific language governing
permissions and limitations under the License.
"""
import warnings

warning_message = (
"Importing from 'verticapy.learn.decomposition' is deprecated, "
"and it will no longer be possible in the next release. "
"Please use 'verticapy.machine_learning.vertica' instead "
"to ensure compatibility with upcoming versions."
)
warnings.warn(warning_message, Warning)

from verticapy.machine_learning.vertica.decomposition import MCA, PCA, SVD
10 changes: 10 additions & 0 deletions verticapy/learn/delphi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@
See the License for the specific language governing
permissions and limitations under the License.
"""
import warnings

warning_message = (
"Importing from 'verticapy.learn.delphi' is deprecated, "
"and it will no longer be possible in the next release. "
"Please use 'verticapy.machine_learning.vertica.automl' instead "
"to ensure compatibility with upcoming versions."
)
warnings.warn(warning_message, Warning)

from verticapy.machine_learning.vertica.automl.clustering import AutoClustering
from verticapy.machine_learning.vertica.automl.dataprep import AutoDataPrep
from verticapy.machine_learning.vertica.automl.supervised import AutoML
10 changes: 10 additions & 0 deletions verticapy/learn/ensemble/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@
See the License for the specific language governing
permissions and limitations under the License.
"""
import warnings

warning_message = (
"Importing from 'verticapy.learn.ensemble' is deprecated, "
"and it will no longer be possible in the next release. "
"Please use 'verticapy.machine_learning.vertica' instead "
"to ensure compatibility with upcoming versions."
)
warnings.warn(warning_message, Warning)

from verticapy.machine_learning.vertica.ensemble import (
IsolationForest,
RandomForestClassifier,
Expand Down
Loading

0 comments on commit 0a6f164

Please sign in to comment.