Coder Social home page Coder Social logo

Grid Search Viz about yellowbrick HOT 4 CLOSED

districtdatalabs avatar districtdatalabs commented on July 22, 2024
Grid Search Viz

from yellowbrick.

Comments (4)

rebeccabilbro avatar rebeccabilbro commented on July 22, 2024

This one might be tricky, mainly because grid search takes so long. But here is a rough draft:

def visual_gridsearch(model, X, y):
    C_range = np.logspace(-2, 10, 5)
    gamma_range = np.logspace(-5, 5, 5)
    param_grid = dict(gamma=gamma_range, C=C_range)
    grid = GridSearchCV(SVC(), param_grid=param_grid)
    grid.fit(X, y)

    scores = [x[1] for x in grid.grid_scores_]
    scores = np.array(scores).reshape(len(C_range), len(gamma_range))

    plt.figure(figsize=(8, 6))
    plt.subplots_adjust(left=.2, right=0.95, bottom=0.15, top=0.95)
    plt.imshow(scores, interpolation='nearest', cmap=cmap)
    plt.xlabel('gamma')
    plt.ylabel('C')
    plt.colorbar()
    plt.xticks(np.arange(len(gamma_range)), gamma_range, rotation=45)
    plt.yticks(np.arange(len(C_range)), C_range)
    plt.title(
        "The best parameters are {} with a score of {:0.2f}.".format(
            grid.best_params_, grid.best_score_)
    )
    plt.show()

from yellowbrick.

TomAugspurger avatar TomAugspurger commented on July 22, 2024

Thoughts on something like this for grid search? It's pretty much just a wrapper around seaborn's factorplot, pulling the data off the GridSearch.grid_scores_. The implementation is here, from a library I started working on but haven't had a chance to develop any further.

from yellowbrick.

bbengfort avatar bbengfort commented on July 22, 2024

Actually, that's really helpful thanks! We're having a lot of angst around
whether to add seaborn as a dependency or to implement our own FactorPlot
somehow, but the unpack_grid_scores function is going to be really helpful!

On Thu, Jun 9, 2016 at 9:41 PM, Tom Augspurger [email protected]
wrote:

Thoughts on something like this
http://nbviewer.jupyter.org/github/TomAugspurger/postlearn/blob/master/examples/IPywidgets.ipynb#Grid-Search-Results
for grid search? It's pretty much just a wrapper around seaborn's
factorplot, pulling the data off the GridSearch.grid_scores_. The
implementation is here
https://github.com/TomAugspurger/postlearn/blob/1d96b8874ab6717e749d99ebaec961b8603966a6/postlearn/reporter.py#L98,
from a library I started working on but haven't had a chance to develop any
further.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#12 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AAth7k5VllHA04A7ADjut4GzWy0YQm12ks5qKMDjgaJpZM4IhaNh
.

from yellowbrick.

bbengfort avatar bbengfort commented on July 22, 2024

Completed in #261

from yellowbrick.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.