.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/plot_finance_path.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_plot_finance_path.py: ======================================================= Lasso path computation on Finance/log1p dataset ======================================================= The example runs the Celer algorithm on the Finance dataset which is a large sparse dataset. Running time is not compared with the scikit-learn implementation as it makes the example too long to run. .. GENERATED FROM PYTHON SOURCE LINES 12-35 .. code-block:: Python import time import numpy as np import pandas as pd import matplotlib.pyplot as plt from libsvmdata import fetch_libsvm from celer import celer_path print(__doc__) print("*** Warning: this example may take more than 5 minutes to run ***") X, y = fetch_libsvm('finance') y -= np.mean(y) n_samples, n_features = X.shape alpha_max = np.max(np.abs(X.T.dot(y))) / n_samples print("Dataset size: %d samples, %d features" % X.shape) # construct grid of regularization parameters alpha n_alphas = 11 alphas = alpha_max * np.geomspace(1, 0.1, n_alphas) .. rst-class:: sphx-glr-script-out .. code-block:: none *** Warning: this example may take more than 5 minutes to run *** file_sizes: 0%| | 0.00/246M [00:00` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_finance_path.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_finance_path.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_