@@ -0,0 +1,1208 @@
+import numpy as np%0Afrom scipy.stats import linregress%0Aimport matplotlib.pyplot as plt%0Aimport scipy.io as sio%0Aimport seaborn%0Aimport click%0Aimport sys%0Afrom sklearn.linear_model import Lasso%0A%0A%0A@click.command()%0A@click.option('--show_plot', type=click.BOOL,%0A              default=False)%0A@click.option('--mat_file', type=click.STRING,%0A              default='')%0Adef main(show_plot, mat_file):%0A    try:%0A        mat_cont = sio.loadmat(mat_file)%0A        J = mat_cont%5B'J'%5D%0A        J_est_1 = mat_cont%5B'J_est_1'%5D%0A        J_est_2 = mat_cont%5B'J_est_2'%5D%0A%0A    except IOError:%0A        print 'Wrong mat file name'%0A        sys.exit(1)%0A    except KeyError:%0A        print 'mat file does not contain S or J '%0A        sys.exit(1)%0A    slope, intercept, r_value, p_value, std_err = linregress(J.flatten(), J_est_1.flatten())%0A    print slope, intercept, r_value, p_value, std_err%0A    # plot and compare J and J_est%0A    title = mat_file%5B:mat_file.index('.')%5D + '_LASSO'%0A    fig = plt.figure()%0A    plt.plot(%5BJ.min(), J.max()%5D, %5BJ.min(), J.max()%5D, 'k')%0A    plt.plot(J.flatten(), J_est_1.flatten() / 2.0, 'o')%0A    plt.title(title)%0A    if show_plot:%0A        plt.show()%0A    #fig.savefig(title + '.png')%0A%0Aif __name__ == %22__main__%22:%0A    main()%0A

add file to plot J vs. J_est form mat file