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 8901645
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T01:24:40+00:00 2026-06-15T01:24:40+00:00

I have implemented one algorithm (RLSR) which there are two regularization factor. Based on

  • 0

I have implemented one algorithm (RLSR) which there are two regularization factor. Based on different value of this two factors my cost function decreases or increase. Right now I visualize my error with plt.scatter by passing the error as the color which result :

enter image description here

but the problem here is my values in y-axis are very small so as you can see they overlap and I can not see some part of my results.

alpha_list=[1e-11,1e-10,1e-10,5*1e-10,8*1e-10,1e-8,1e-8,5*1e-8,8*1e-6,1e-6,1e-6,5*1e-6,8*1e-6,1e-4,1e-4,5*1e-4,8*1e-4,1e-3,1e-3,5*1e-3,6*1e-3,8*1e-3]

I tried to decrease the transparency but It didn’t help much!

and this is how I implemented it :

eigenvalues,alphaa  = np.meshgrid(eigRange,alpha_list )

fig = plt.figure()
DatavmaxTrain = np.max(normCostTrain)
DatavminTrain = np.min(normCostTrain)

DatavmaxTest = np.max(normCostTest)
DatavminTest = np.min(normCostTest)

plt.subplot(211)

plt.scatter(eigenvalues,alphaa,s=130, c=normCostTrain,cmap=cm.PuOr, vmin=DatavminTrain, vmax=DatavmaxTrain, alpha=0.70) #-----for train 



cb1=plt.colorbar()
cb1.set_label("normalized square error")

plt.title("Train ")
plt.xlabel("No. of Eigenvalues")
plt.ylabel("Regualrization parameter")

So I am looking for a better way to visualize my data.

Thanks

  • 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-15T01:24:42+00:00Added an answer on June 15, 2026 at 1:24 am

    How about plotting the log of the alpha_list values?

    alpha_list = np.log(alpha_list)
    

    There is still some overlap, but at least the values are more evenly spread out:

    import matplotlib.pyplot as plt
    import numpy as np
    
    alpha_list=[1e-11,1e-10,1e-10,5*1e-10,8*1e-10,1e-8,1e-8,5*1e-8,8*1e-6,1e-6,1e-6,5*1e-6,8*1e-6,1e-4,1e-4,5*1e-4,8*1e-4,1e-3,1e-3,5*1e-3,6*1e-3,8*1e-3]
    alpha_list = np.log(alpha_list)
    eigRange = np.linspace(0,19,20)
    
    eigenvalues,alphaa  = np.meshgrid(eigRange,alpha_list )
    normCostTrain = np.random.random((len(alpha_list),len(eigRange)))
    
    fig = plt.figure()
    DatavmaxTrain = np.max(normCostTrain)
    DatavminTrain = np.min(normCostTrain)
    
    plt.scatter(eigenvalues,alphaa,s = 130, c=normCostTrain,cmap=plt.get_cmap('PuOr'),
                vmin=DatavminTrain, vmax=DatavmaxTrain, alpha=0.70) #-----for train 
    
    cb1=plt.colorbar()
    cb1.set_label("normalized square error")
    
    plt.title("Train ")
    plt.xlabel("No. of Eigenvalues")
    plt.ylabel("Log(Regularization parameter)")
    plt.show()
    

    yields

    enter image description here


    Here is an example of a 3D scatter plot of the same data, with the z-axis (and the color) are both used to represent the “normalized square error”.

    import matplotlib.pyplot as plt
    from mpl_toolkits.mplot3d import Axes3D
    import matplotlib.cm as cm
    import numpy as np
    
    fig = plt.figure()
    ax = fig.add_subplot(111, projection = '3d')
    
    alpha_list = [1e-11, 1e-10, 1e-10, 5*1e-10, 8*1e-10, 1e-8, 1e-8, 5*1e-8, 8*1e-6,
                  1e-6, 1e-6, 5*1e-6, 8*1e-6, 1e-4, 1e-4, 5*1e-4, 8*1e-4, 1e-3, 1e-3,
                  5*1e-3, 6*1e-3, 8*1e-3]
    
    alpha_list = np.log(alpha_list)
    eigRange = np.linspace(0, 19, 20)
    
    eigenvalues, alphaa  = np.meshgrid(eigRange, alpha_list )
    eigenvalues = eigenvalues.ravel()
    alphaa = alphaa.ravel()
    normCostTrain = np.random.random((len(alpha_list), len(eigRange))).ravel()
    
    DatavmaxTrain = np.max(normCostTrain)
    DatavminTrain = np.min(normCostTrain)
    
    PuOr = plt.get_cmap('PuOr')
    ax.scatter(eigenvalues, alphaa, normCostTrain,
               c = normCostTrain.ravel(),
               s = 30,
               cmap = PuOr,
               vmin = DatavminTrain,
               vmax = DatavmaxTrain,
               alpha = 0.70
               ) #-----for train
    
    m = cm.ScalarMappable(cmap = PuOr)
    m.set_array(normCostTrain)
    
    cb1 = plt.colorbar(m)
    cb1.set_label("normalized square error")
    
    plt.title("Train ")
    ax.set_xlabel("No. of Eigenvalues")
    ax.set_ylabel("Log(Regularization parameter)")
    ax.set_zlabel("normalized square error")
    plt.show()
    

    enter image description here

    I’m not sure if this is an improvement. The points are a bit jumbled together, but are distinguishable if you drag the mouse to rotate the plot.

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

Sidebar

Related Questions

I have one desktop application which was implemented in C#. This app uploads file
I have implemented an algorithm for which there is a strong use-case to know
I have a web service, defined(WSDL) and implemented in PHP. This one is relatively
I have used ATI Stream SDK on windows XP SP3 and implemented one algorithm
I have implemented an evolutionary algorithm in C# which kind of works but I
I have implemented one matrix multiplication with boost::numeric::ublas::matrix (see my full, working boost code
I have implemented onRetainNonConfigurationInstance() on one of my Activity to handle android screen orientation.
We have implemented a process in one of the systems where it's scheduled to
I have implemented horizontal page view. One base page and three swipe pages. The
So I have a UIWebView implemented in one .m file and a UITableView implemented

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.