Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8594997
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T00:19:50+00:00 2026-06-12T00:19:50+00:00

I took sample code from sklearn website, which is tuned_parameters = [{‘kernel’: [‘rbf’], ‘gamma’:

  • 0

I took sample code from sklearn website, which is

tuned_parameters = [{'kernel': ['rbf'], 'gamma': [1e-3, 1e-4], 'C': [1, 10, 100, 1000]},
        {'kernel': ['linear'], 'C': [1, 10, 100, 1000]}]

scores = [('f1', f1_score)]

for score_name, score_func in scores:
    print "# Tuning hyper-parameters for %s" % score_name
    print

    clf = GridSearchCV( SVC(), tuned_parameters, score_func=score_func, n_jobs=-1, verbose=2 )
    clf.fit(X_train, Y_train)

    print "Best parameters set found on development set:"
    print
    print clf.best_estimator_
    print
    print "Grid scores on development set:"

    print
    for params, mean_score, scores in clf.grid_scores_:
        print "%0.3f (+/-%0.03f) for %r" % (
            mean_score, scores.std() / 2, params)
    print

    print "Detailed classification report:"
    print
    print "The model is trained on the full development set."
    print "The scores are computed on the full evaluation set."
    print
    y_true, y_pred = Y_test, clf.predict(X_test)
    print cross_validation.classification_report(y_true, y_pred)
    print

X_train is a pandas DataFrame with approx 70 rows.

The output is

[GridSearchCV] kernel=rbf, C=1, gamma=0.001 ....................................
[GridSearchCV] kernel=rbf, C=1, gamma=0.001 ....................................
[GridSearchCV] kernel=rbf, C=1, gamma=0.001 ....................................
[GridSearchCV] kernel=rbf, C=1, gamma=0.0001 ...................................
[Parallel(n_jobs=-1)]: Done   1 jobs       | elapsed:    0.0s
[GridSearchCV] ........................... kernel=rbf, C=1, gamma=0.001 -   0.0s
[GridSearchCV] ........................... kernel=rbf, C=1, gamma=0.001 -   0.0s
[GridSearchCV] ........................... kernel=rbf, C=1, gamma=0.001 -   0.0s
[GridSearchCV] .......................... kernel=rbf, C=1, gamma=0.0001 -   0.0s
[GridSearchCV] kernel=rbf, C=1, gamma=0.0001 ...................................
[GridSearchCV] kernel=rbf, C=1, gamma=0.0001 ...................................
[GridSearchCV] kernel=rbf, C=10, gamma=0.001 ...................................
[GridSearchCV] kernel=rbf, C=10, gamma=0.001 ...................................
[GridSearchCV] .......................... kernel=rbf, C=1, gamma=0.0001 -   0.0s
[GridSearchCV] .......................... kernel=rbf, C=1, gamma=0.0001 -   0.0s
[GridSearchCV] kernel=rbf, C=10, gamma=0.001 ...................................
[GridSearchCV] .......................... kernel=rbf, C=10, gamma=0.001 -   0.0s
[GridSearchCV] .......................... kernel=rbf, C=10, gamma=0.001 -   0.0s
[GridSearchCV] kernel=rbf, C=10, gamma=0.0001 ..................................
[GridSearchCV] .......................... kernel=rbf, C=10, gamma=0.001 -   0.0s
[GridSearchCV] kernel=rbf, C=10, gamma=0.0001 ..................................
[GridSearchCV] kernel=rbf, C=10, gamma=0.0001 ..................................
[GridSearchCV] ......................... kernel=rbf, C=10, gamma=0.0001 -   0.0s
[GridSearchCV] kernel=rbf, C=100, gamma=0.001 ..................................
[GridSearchCV] ......................... kernel=rbf, C=10, gamma=0.0001 -   0.0s
[GridSearchCV] ......................... kernel=rbf, C=10, gamma=0.0001 -   0.0s
[GridSearchCV] kernel=rbf, C=100, gamma=0.001 ..................................
[GridSearchCV] ......................... kernel=rbf, C=100, gamma=0.001 -   0.0s
[GridSearchCV] kernel=rbf, C=100, gamma=0.001 ..................................
[GridSearchCV] kernel=rbf, C=100, gamma=0.0001 .................................
[GridSearchCV] ......................... kernel=rbf, C=100, gamma=0.001 -   0.0s
[GridSearchCV] kernel=rbf, C=100, gamma=0.0001 .................................
[GridSearchCV] ......................... kernel=rbf, C=100, gamma=0.001 -   0.0s
[GridSearchCV] kernel=rbf, C=100, gamma=0.0001 .................................
[GridSearchCV] kernel=rbf, C=1000, gamma=0.001 .................................
[GridSearchCV] ........................ kernel=rbf, C=100, gamma=0.0001 -   0.0s
[GridSearchCV] ........................ kernel=rbf, C=100, gamma=0.0001 -   0.0s
[GridSearchCV] kernel=rbf, C=1000, gamma=0.001 .................................
[GridSearchCV] ........................ kernel=rbf, C=100, gamma=0.0001 -   0.0s
[GridSearchCV] ........................ kernel=rbf, C=1000, gamma=0.001 -   0.0s
[GridSearchCV] kernel=rbf, C=1000, gamma=0.001 .................................
[GridSearchCV] kernel=rbf, C=1000, gamma=0.0001 ................................
[GridSearchCV] kernel=rbf, C=1000, gamma=0.0001 ................................
[GridSearchCV] ........................ kernel=rbf, C=1000, gamma=0.001 -   0.0s
[GridSearchCV] kernel=rbf, C=1000, gamma=0.0001 ................................
[GridSearchCV] ........................ kernel=rbf, C=1000, gamma=0.001 -   0.0s
[GridSearchCV] ....................... kernel=rbf, C=1000, gamma=0.0001 -   0.0s
[GridSearchCV] kernel=linear, C=1 ..............................................
[GridSearchCV] ....................... kernel=rbf, C=1000, gamma=0.0001 -   0.0s
[GridSearchCV] kernel=linear, C=1 ..............................................
[GridSearchCV] kernel=linear, C=1 ..............................................
[GridSearchCV] ....................... kernel=rbf, C=1000, gamma=0.0001 -   0.0s
[GridSearchCV] kernel=linear, C=10 .............................................

And then it never finishes. I run it on Mac Book Pro with Lion. What do I do wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T00:19:51+00:00Added an answer on June 12, 2026 at 12:19 am

    Fixed it by normalizing the dataset, like shown here: normalize-data-in-pandas, before running grid search.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I took some sample code to create a drop down menu from this website:
I'm using backbone.js, underscore.js and jQuery. I took the following sample code from http://jsfiddle.net/thomas/C9wew/6/
I'm writing an asynchronous server and client with C#. I took sample code from
I'm creating a v8 shell based console, I took the sample code that cames
I took the example code from the Kendo UI demos at http://demos.kendoui.com/web/grid/remote-data.html , binding
Here is the code: https://www.dropbox.com/s/o42wy36x4qhrbpt/PDFScroller.zip I took the WWDC 2010 PhotoScroller sample code that
I have a little paint application which was based on the GLPaint sample code.
Years ago, I wrote a code template that took a few simple parameters (points)
I took the rendered page from the SWT Browser and exported it to an
I did a simple test to understand how transactions work in .net Sample code

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.