ID: 368, P-Value: 2.55e-03

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2from scipy.linalg import norm2from scipy.linalg import norm
3from scipy import sum,average3from scipy import sum,average
4def compare_plots(imagefile1,imagefile2):4def compare_plots(imagefile1,imagefile2):
5    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))5    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
6    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))6    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
7    if img1.size!=img2.size:7    if img1.size!=img2.size:
8        return False8        return False
9    diff = img1 - img2  9    diff = img1 - img2  
10    nm = sum(abs(diff))  10    nm = sum(abs(diff))  
11    nz = norm(diff.ravel(), 0)  11    nz = norm(diff.ravel(), 0)  
12    return nm/img1.size < 1 and nz/img1.size < 112    return nm/img1.size < 1 and nz/img1.size < 1
13def to_grayscale(arr):13def to_grayscale(arr):
14    if len(arr.shape) == 3:14    if len(arr.shape) == 3:
15        return average(arr, -1)  15        return average(arr, -1)  
16    else:16    else:
17        return arr17        return arr
18def normalize(arr):18def normalize(arr):
19    rng = arr.max()-arr.min()19    rng = arr.max()-arr.min()
20    amin = arr.min()20    amin = arr.min()
21    return (arr-amin)*255/rngimport numpy as np21    return (arr-amin)*255/rngimport numpy as np
t22cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',delimiter=',', unpack=Tt22cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>rue)>,')
23q_boundaries=np.percentile(scores,np.arange(0,100,25))23quartile_boundar= np.percentile(scores,np.arange(0,100,25))
24best_cultivar_indices=np.where(scores>=q_boundaries[-1])24best_cultivar_indices= np.where(scores>quartile_boundary[-1])
25print(f'Cultivars with the following IDs are in the top quartile with a score of25print(f'Cultivars with the following IDs are in the top quartile with a score of
> {q_boundaries[-1]} or better:')> {quartile_boundary[-1]} or better:')
26best=cultivarIDs[best_cultivar_indices]26best=cultivarIDs[best_cultivar_indices]
27best.sort()27best.sort()
28print(', '.join([str(int(x)) for x in best]))28print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 67, P-Value: 2.83e-03

Student (left) and Nearest Neighbor (right).


f1from cmath import pif1from cmath import pi
2import matplotlib.pyplot as plt2import matplotlib.pyplot as plt
nn3import numpy as np
3from compare_plots import compare_plots4from compare_plots import compare_plots
t4import numpy as npt
5def make_plot(filename):5def make_plot(filename):
6    across = np.arange(0,4*pi,0.1)6    across = np.arange(0,4*pi,0.1)
7    vertical = np.sin(across)7    vertical = np.sin(across)
8    plt.xlim([0,4*pi])8    plt.xlim([0,4*pi])
9    plt.ylim(-1,1)9    plt.ylim(-1,1)
10    plt.plot(across,vertical,'-b')10    plt.plot(across,vertical,'-b')
11    plt.xlabel('x (radians)')11    plt.xlabel('x (radians)')
12    plt.ylabel('sin(x)')12    plt.ylabel('sin(x)')
13    plt.savefig(filename)13    plt.savefig(filename)
14if __name__=='__main__':14if __name__=='__main__':
15    make_plot('my_plot.png')15    make_plot('my_plot.png')
16    if compare_plots('my_plot.png','instructors_plot.png'):16    if compare_plots('my_plot.png','instructors_plot.png'):
17        print('Success!')17        print('Success!')
18    else:18    else:
19        print('Keep trying.')19        print('Keep trying.')
20import matplotlib.pyplot as plt20import matplotlib.pyplot as plt
21from scipy.linalg import norm21from scipy.linalg import norm
22from scipy import sum,average22from scipy import sum,average
23def compare_plots(imagefile1,imagefile2):23def compare_plots(imagefile1,imagefile2):
24    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))24    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
25    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))25    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
26    if img1.size!=img2.size:26    if img1.size!=img2.size:
27        return False27        return False
28    diff = img1 - img2  28    diff = img1 - img2  
29    nm = sum(abs(diff))  29    nm = sum(abs(diff))  
30    nz = norm(diff.ravel(), 0)  30    nz = norm(diff.ravel(), 0)  
31    return nm/img1.size < 1 and nz/img1.size < 131    return nm/img1.size < 1 and nz/img1.size < 1
32def to_grayscale(arr):32def to_grayscale(arr):
33    if len(arr.shape) == 3:33    if len(arr.shape) == 3:
34        return average(arr, -1)  34        return average(arr, -1)  
35    else:35    else:
36        return arr36        return arr
37def normalize(arr):37def normalize(arr):
38    rng = arr.max()-arr.min()38    rng = arr.max()-arr.min()
39    amin = arr.min()39    amin = arr.min()
40    return (arr-amin)*255/rngimport numpy as np40    return (arr-amin)*255/rngimport numpy as np
41cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='41cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
42quartile_boundaries = np.percentile(scores,np.arange(0,100,25))42quartile_boundaries = np.percentile(scores,np.arange(0,100,25))
43top_indices, = np.where(scores>quartile_boundaries[-1])43top_indices, = np.where(scores>quartile_boundaries[-1])
44print(f'Cultivars with the following IDs are in the top quartile with a score of44print(f'Cultivars with the following IDs are in the top quartile with a score of
> {quartile_boundaries[-1]} or better:')> {quartile_boundaries[-1]} or better:')
45best=cultivarIDs[top_indices]45best=cultivarIDs[top_indices]
46best.sort()46best.sort()
47print(', '.join([str(int(x)) for x in best]))47print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 460, P-Value: 2.83e-03

Student (left) and Nearest Neighbor (right).


t1import matplotlib.pyplot as pltt1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
5    xVal = np.linspace(0,np.pi*4,80)5    xVal = np.linspace(0,np.pi*4,80)
6    yVal = []6    yVal = []
7    for x in xVal:7    for x in xVal:
8        yVal.append(np.sin(x))8        yVal.append(np.sin(x))
9    plt.plot(xVal, yVal)9    plt.plot(xVal, yVal)
10    plt.xlabel('x (radians)')10    plt.xlabel('x (radians)')
11    plt.ylim(-1,1)11    plt.ylim(-1,1)
12    plt.ylabel('sin(x)')12    plt.ylabel('sin(x)')
13    plt.xlim(0,np.pi*4)13    plt.xlim(0,np.pi*4)
14    plt.ylim(-1,1)14    plt.ylim(-1,1)
15    plt.savefig(filename)15    plt.savefig(filename)
16if __name__=='__main__':16if __name__=='__main__':
17    make_plot('my_plot.png')17    make_plot('my_plot.png')
18    if compare_plots('my_plot.png','instructors_plot.png'):18    if compare_plots('my_plot.png','instructors_plot.png'):
19        print('Success!')19        print('Success!')
20    else:20    else:
21        print('Keep trying.')21        print('Keep trying.')
22import matplotlib.pyplot as plt22import matplotlib.pyplot as plt
23from scipy.linalg import norm23from scipy.linalg import norm
24from scipy import sum,average24from scipy import sum,average
25def compare_plots(imagefile1,imagefile2):25def compare_plots(imagefile1,imagefile2):
26    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))26    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
27    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))27    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
28    if img1.size!=img2.size:28    if img1.size!=img2.size:
29        return False29        return False
30    diff = img1 - img2  30    diff = img1 - img2  
31    nm = sum(abs(diff))  31    nm = sum(abs(diff))  
32    nz = norm(diff.ravel(), 0)  32    nz = norm(diff.ravel(), 0)  
33    return nm/img1.size < 1 and nz/img1.size < 133    return nm/img1.size < 1 and nz/img1.size < 1
34def to_grayscale(arr):34def to_grayscale(arr):
35    if len(arr.shape) == 3:35    if len(arr.shape) == 3:
36        return average(arr, -1)  36        return average(arr, -1)  
37    else:37    else:
38        return arr38        return arr
39def normalize(arr):39def normalize(arr):
40    rng = arr.max()-arr.min()40    rng = arr.max()-arr.min()
41    amin = arr.min()41    amin = arr.min()
42    return (arr-amin)*255/rngimport numpy as np42    return (arr-amin)*255/rngimport numpy as np
43cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='43cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
44pctl = np.percentile(scores, np.arange(0,100,25))44pctl = np.percentile(scores, np.arange(0,100,25))
45best_cultivar_indices = np.where(scores >= pctl[-1])45best_cultivar_indices = np.where(scores >= pctl[-1])
46print(f'Cultivars with the following IDs are in the top quartile with a score of46print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
47best=cultivarIDs[best_cultivar_indices]47best=cultivarIDs[best_cultivar_indices]
48best.sort()48best.sort()
49print(', '.join([str(int(x)) for x in best]))49print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 154, P-Value: 2.83e-03

Student (left) and Nearest Neighbor (right).


t1import matplotlib.pyplot as pltt1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
5    xVal = np.linspace(0,np.pi*4,80)5    xVal = np.linspace(0,np.pi*4,80)
6    yVal = []6    yVal = []
7    for x in xVal:7    for x in xVal:
8        yVal.append(np.sin(x))8        yVal.append(np.sin(x))
9    plt.plot(xVal, yVal)9    plt.plot(xVal, yVal)
10    plt.xlabel('x (radians)')10    plt.xlabel('x (radians)')
11    plt.ylim(-1,1)11    plt.ylim(-1,1)
12    plt.ylabel('sin(x)')12    plt.ylabel('sin(x)')
13    plt.xlim(0,np.pi*4)13    plt.xlim(0,np.pi*4)
14    plt.ylim(-1,1)14    plt.ylim(-1,1)
15    plt.savefig(filename)15    plt.savefig(filename)
16if __name__=='__main__':16if __name__=='__main__':
17    make_plot('my_plot.png')17    make_plot('my_plot.png')
18    if compare_plots('my_plot.png','instructors_plot.png'):18    if compare_plots('my_plot.png','instructors_plot.png'):
19        print('Success!')19        print('Success!')
20    else:20    else:
21        print('Keep trying.')21        print('Keep trying.')
22import matplotlib.pyplot as plt22import matplotlib.pyplot as plt
23from scipy.linalg import norm23from scipy.linalg import norm
24from scipy import sum,average24from scipy import sum,average
25def compare_plots(imagefile1,imagefile2):25def compare_plots(imagefile1,imagefile2):
26    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))26    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
27    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))27    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
28    if img1.size!=img2.size:28    if img1.size!=img2.size:
29        return False29        return False
30    diff = img1 - img2  30    diff = img1 - img2  
31    nm = sum(abs(diff))  31    nm = sum(abs(diff))  
32    nz = norm(diff.ravel(), 0)  32    nz = norm(diff.ravel(), 0)  
33    return nm/img1.size < 1 and nz/img1.size < 133    return nm/img1.size < 1 and nz/img1.size < 1
34def to_grayscale(arr):34def to_grayscale(arr):
35    if len(arr.shape) == 3:35    if len(arr.shape) == 3:
36        return average(arr, -1)  36        return average(arr, -1)  
37    else:37    else:
38        return arr38        return arr
39def normalize(arr):39def normalize(arr):
40    rng = arr.max()-arr.min()40    rng = arr.max()-arr.min()
41    amin = arr.min()41    amin = arr.min()
42    return (arr-amin)*255/rngimport numpy as np42    return (arr-amin)*255/rngimport numpy as np
43cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='43cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
44pctl = np.percentile(scores, np.arange(0,100,25))44pctl = np.percentile(scores, np.arange(0,100,25))
45best_cultivar_indices = np.where(scores >= pctl[-1])45best_cultivar_indices = np.where(scores >= pctl[-1])
46print(f'Cultivars with the following IDs are in the top quartile with a score of46print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
47best=cultivarIDs[best_cultivar_indices]47best=cultivarIDs[best_cultivar_indices]
48best.sort()48best.sort()
49print(', '.join([str(int(x)) for x in best]))49print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 169, P-Value: 2.83e-03

Student (left) and Nearest Neighbor (right).


t1import matplotlib.pyplot as pltt1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
5    xVal = np.linspace(0,np.pi*4,80)5    xVal = np.linspace(0,np.pi*4,80)
6    yVal = []6    yVal = []
7    for x in xVal:7    for x in xVal:
8        yVal.append(np.sin(x))8        yVal.append(np.sin(x))
9    plt.plot(xVal, yVal)9    plt.plot(xVal, yVal)
10    plt.xlabel('x (radians)')10    plt.xlabel('x (radians)')
11    plt.ylim(-1,1)11    plt.ylim(-1,1)
12    plt.ylabel('sin(x)')12    plt.ylabel('sin(x)')
13    plt.xlim(0,np.pi*4)13    plt.xlim(0,np.pi*4)
14    plt.ylim(-1,1)14    plt.ylim(-1,1)
15    plt.savefig(filename)15    plt.savefig(filename)
16if __name__=='__main__':16if __name__=='__main__':
17    make_plot('my_plot.png')17    make_plot('my_plot.png')
18    if compare_plots('my_plot.png','instructors_plot.png'):18    if compare_plots('my_plot.png','instructors_plot.png'):
19        print('Success!')19        print('Success!')
20    else:20    else:
21        print('Keep trying.')21        print('Keep trying.')
22import matplotlib.pyplot as plt22import matplotlib.pyplot as plt
23from scipy.linalg import norm23from scipy.linalg import norm
24from scipy import sum,average24from scipy import sum,average
25def compare_plots(imagefile1,imagefile2):25def compare_plots(imagefile1,imagefile2):
26    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))26    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
27    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))27    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
28    if img1.size!=img2.size:28    if img1.size!=img2.size:
29        return False29        return False
30    diff = img1 - img2  30    diff = img1 - img2  
31    nm = sum(abs(diff))  31    nm = sum(abs(diff))  
32    nz = norm(diff.ravel(), 0)  32    nz = norm(diff.ravel(), 0)  
33    return nm/img1.size < 1 and nz/img1.size < 133    return nm/img1.size < 1 and nz/img1.size < 1
34def to_grayscale(arr):34def to_grayscale(arr):
35    if len(arr.shape) == 3:35    if len(arr.shape) == 3:
36        return average(arr, -1)  36        return average(arr, -1)  
37    else:37    else:
38        return arr38        return arr
39def normalize(arr):39def normalize(arr):
40    rng = arr.max()-arr.min()40    rng = arr.max()-arr.min()
41    amin = arr.min()41    amin = arr.min()
42    return (arr-amin)*255/rngimport numpy as np42    return (arr-amin)*255/rngimport numpy as np
43cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='43cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
44pctl = np.percentile(scores, np.arange(0,100,25))44pctl = np.percentile(scores, np.arange(0,100,25))
45best_cultivar_indices = np.where(scores >= pctl[-1])45best_cultivar_indices = np.where(scores >= pctl[-1])
46print(f'Cultivars with the following IDs are in the top quartile with a score of46print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
47best=cultivarIDs[best_cultivar_indices]47best=cultivarIDs[best_cultivar_indices]
48best.sort()48best.sort()
49print(', '.join([str(int(x)) for x in best]))49print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 56, P-Value: 3.15e-03

Student (left) and Nearest Neighbor (right).


f1from cmath import pif1from cmath import pi
2import matplotlib.pyplot as plt2import matplotlib.pyplot as plt
nn3from compare_plots import compare_plots
3import numpy as np4import numpy as np
t4from compare_plots import compare_plotst
5def make_plot(filename):5def make_plot(filename):
6    across = np.arange(0,4*pi,0.1)6    across = np.arange(0,4*pi,0.1)
7    vertical = np.sin(across)7    vertical = np.sin(across)
8    plt.xlim([0,4*pi])8    plt.xlim([0,4*pi])
9    plt.ylim(-1,1)9    plt.ylim(-1,1)
10    plt.plot(across,vertical,'-b')10    plt.plot(across,vertical,'-b')
11    plt.xlabel('x (radians)')11    plt.xlabel('x (radians)')
12    plt.ylabel('sin(x)')12    plt.ylabel('sin(x)')
13    plt.savefig(filename)13    plt.savefig(filename)
14if __name__=='__main__':14if __name__=='__main__':
15    make_plot('my_plot.png')15    make_plot('my_plot.png')
16    if compare_plots('my_plot.png','instructors_plot.png'):16    if compare_plots('my_plot.png','instructors_plot.png'):
17        print('Success!')17        print('Success!')
18    else:18    else:
19        print('Keep trying.')19        print('Keep trying.')
20import matplotlib.pyplot as plt20import matplotlib.pyplot as plt
21from scipy.linalg import norm21from scipy.linalg import norm
22from scipy import sum,average22from scipy import sum,average
23def compare_plots(imagefile1,imagefile2):23def compare_plots(imagefile1,imagefile2):
24    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))24    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
25    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))25    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
26    if img1.size!=img2.size:26    if img1.size!=img2.size:
27        return False27        return False
28    diff = img1 - img2  28    diff = img1 - img2  
29    nm = sum(abs(diff))  29    nm = sum(abs(diff))  
30    nz = norm(diff.ravel(), 0)  30    nz = norm(diff.ravel(), 0)  
31    return nm/img1.size < 1 and nz/img1.size < 131    return nm/img1.size < 1 and nz/img1.size < 1
32def to_grayscale(arr):32def to_grayscale(arr):
33    if len(arr.shape) == 3:33    if len(arr.shape) == 3:
34        return average(arr, -1)  34        return average(arr, -1)  
35    else:35    else:
36        return arr36        return arr
37def normalize(arr):37def normalize(arr):
38    rng = arr.max()-arr.min()38    rng = arr.max()-arr.min()
39    amin = arr.min()39    amin = arr.min()
40    return (arr-amin)*255/rngimport numpy as np40    return (arr-amin)*255/rngimport numpy as np
41cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='41cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
42quartile_boundaries = np.percentile(scores,np.arange(0,100,25))42quartile_boundaries = np.percentile(scores,np.arange(0,100,25))
43top_indices, = np.where(scores>quartile_boundaries[-1])43top_indices, = np.where(scores>quartile_boundaries[-1])
44print(f'Cultivars with the following IDs are in the top quartile with a score of44print(f'Cultivars with the following IDs are in the top quartile with a score of
> {quartile_boundaries[-1]} or better:')> {quartile_boundaries[-1]} or better:')
45best=cultivarIDs[top_indices]45best=cultivarIDs[top_indices]
46best.sort()46best.sort()
47print(', '.join([str(int(x)) for x in best]))47print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 466, P-Value: 3.49e-03

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2from scipy.linalg import norm2from scipy.linalg import norm
3from scipy import sum,average3from scipy import sum,average
4def compare_plots(imagefile1,imagefile2):4def compare_plots(imagefile1,imagefile2):
5    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))5    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
6    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))6    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
7    if img1.size!=img2.size:7    if img1.size!=img2.size:
8        return False8        return False
9    diff = img1 - img2  9    diff = img1 - img2  
10    nm = sum(abs(diff))  10    nm = sum(abs(diff))  
11    nz = norm(diff.ravel(), 0)  11    nz = norm(diff.ravel(), 0)  
12    return nm/img1.size < 1 and nz/img1.size < 112    return nm/img1.size < 1 and nz/img1.size < 1
13def to_grayscale(arr):13def to_grayscale(arr):
14    if len(arr.shape) == 3:14    if len(arr.shape) == 3:
15        return average(arr, -1)  15        return average(arr, -1)  
16    else:16    else:
17        return arr17        return arr
18def normalize(arr):18def normalize(arr):
19    rng = arr.max()-arr.min()19    rng = arr.max()-arr.min()
20    amin = arr.min()20    amin = arr.min()
21    return (arr-amin)*255/rngimport numpy as np21    return (arr-amin)*255/rngimport numpy as np
t22cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='t22cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',delimiter=',', unpack=T
>,')>rue)
23quartile_boundar= np.percentile(scores,np.arange(0,100,25))23q_boundaries=np.percentile(scores,np.arange(0,100,25))
24best_cultivar_indices= np.where(scores>quartile_boundary[-1])24best_cultivar_indices=np.where(scores>=q_boundaries[-1])
25print(f'Cultivars with the following IDs are in the top quartile with a score of25print(f'Cultivars with the following IDs are in the top quartile with a score of
> {quartile_boundary[-1]} or better:')> {q_boundaries[-1]} or better:')
26best=cultivarIDs[best_cultivar_indices]26best=cultivarIDs[best_cultivar_indices]
27best.sort()27best.sort()
28print(', '.join([str(int(x)) for x in best]))28print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 334, P-Value: 7.60e-03

Student (left) and Nearest Neighbor (right).


f1import numpy as npf1import numpy as np
2import matplotlib.pyplot as plt2import matplotlib.pyplot as plt
3from compare_plots import compare_plots3from compare_plots import compare_plots
4import math4import math
5end_point = 4*3.145end_point = 4*3.14
6def make_plot(filename):6def make_plot(filename):
7    plt.ylim([-1,1])7    plt.ylim([-1,1])
8    plt.xlim([0,end_point])8    plt.xlim([0,end_point])
9    plt.xlabel('x (radians)')9    plt.xlabel('x (radians)')
10    plt.ylabel('sin(x)')10    plt.ylabel('sin(x)')
11    x = np.linspace(0, 13, endpoint= False)11    x = np.linspace(0, 13, endpoint= False)
12    y = np.sin(x)12    y = np.sin(x)
13    plt.plot(x, y, '-b')13    plt.plot(x, y, '-b')
14    plt.savefig(filename)14    plt.savefig(filename)
15if __name__=='__main__':15if __name__=='__main__':
16    make_plot('my_plot.png')16    make_plot('my_plot.png')
17    if compare_plots('my_plot.png','instructors_plot.png'):17    if compare_plots('my_plot.png','instructors_plot.png'):
18        print('Success!')18        print('Success!')
19    else:19    else:
20        print('Keep trying.')20        print('Keep trying.')
21import matplotlib.pyplot as plt21import matplotlib.pyplot as plt
22from scipy.linalg import norm22from scipy.linalg import norm
23from scipy import sum,average23from scipy import sum,average
24def compare_plots(imagefile1,imagefile2):24def compare_plots(imagefile1,imagefile2):
25    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))25    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
26    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))26    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
27    if img1.size!=img2.size:27    if img1.size!=img2.size:
28        return False28        return False
29    diff = img1 - img2  29    diff = img1 - img2  
30    nm = sum(abs(diff))  30    nm = sum(abs(diff))  
31    nz = norm(diff.ravel(), 0)  31    nz = norm(diff.ravel(), 0)  
32    return nm/img1.size < 1 and nz/img1.size < 132    return nm/img1.size < 1 and nz/img1.size < 1
33def to_grayscale(arr):33def to_grayscale(arr):
34    if len(arr.shape) == 3:34    if len(arr.shape) == 3:
35        return average(arr, -1)  35        return average(arr, -1)  
36    else:36    else:
37        return arr37        return arr
38def normalize(arr):38def normalize(arr):
39    rng = arr.max()-arr.min()39    rng = arr.max()-arr.min()
40    amin = arr.min()40    amin = arr.min()
41    return (arr-amin)*255/rngimport numpy as np41    return (arr-amin)*255/rngimport numpy as np
42cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='42cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
43my_array = scores43my_array = scores
44quartile_boundaries = np.percentile(my_array,np.arange(0,100,25))44quartile_boundaries = np.percentile(my_array,np.arange(0,100,25))
45pctl = quartile_boundaries45pctl = quartile_boundaries
t46top_indices, = np.where(my_array>quartile_boundaries[-1])       t46top_indices, = np.where(my_array>quartile_boundaries[-1])
47best_cultivar_indices = top_indices47best_cultivar_indices = top_indices
48print(f'Cultivars with the following IDs are in the top quartile with a score of48print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
49best=cultivarIDs[best_cultivar_indices]49best=cultivarIDs[best_cultivar_indices]
50best.sort()50best.sort()
51print(', '.join([str(int(x)) for x in best]))51print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 190, P-Value: 9.10e-03

Student (left) and Nearest Neighbor (right).


f1import numpy as npf1import numpy as np
2import matplotlib.pyplot as plt2import matplotlib.pyplot as plt
3from compare_plots import compare_plots3from compare_plots import compare_plots
4import math4import math
5end_point = 4*3.145end_point = 4*3.14
6def make_plot(filename):6def make_plot(filename):
7    plt.ylim([-1,1])7    plt.ylim([-1,1])
8    plt.xlim([0,end_point])8    plt.xlim([0,end_point])
9    plt.xlabel('x (radians)')9    plt.xlabel('x (radians)')
10    plt.ylabel('sin(x)')10    plt.ylabel('sin(x)')
11    x = np.linspace(0, 13, endpoint= False)11    x = np.linspace(0, 13, endpoint= False)
12    y = np.sin(x)12    y = np.sin(x)
13    plt.plot(x, y, '-b')13    plt.plot(x, y, '-b')
14    plt.savefig(filename)14    plt.savefig(filename)
15if __name__=='__main__':15if __name__=='__main__':
16    make_plot('my_plot.png')16    make_plot('my_plot.png')
17    if compare_plots('my_plot.png','instructors_plot.png'):17    if compare_plots('my_plot.png','instructors_plot.png'):
18        print('Success!')18        print('Success!')
19    else:19    else:
20        print('Keep trying.')20        print('Keep trying.')
21import matplotlib.pyplot as plt21import matplotlib.pyplot as plt
22from scipy.linalg import norm22from scipy.linalg import norm
23from scipy import sum,average23from scipy import sum,average
24def compare_plots(imagefile1,imagefile2):24def compare_plots(imagefile1,imagefile2):
25    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))25    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
26    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))26    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
27    if img1.size!=img2.size:27    if img1.size!=img2.size:
28        return False28        return False
29    diff = img1 - img2  29    diff = img1 - img2  
30    nm = sum(abs(diff))  30    nm = sum(abs(diff))  
31    nz = norm(diff.ravel(), 0)  31    nz = norm(diff.ravel(), 0)  
32    return nm/img1.size < 1 and nz/img1.size < 132    return nm/img1.size < 1 and nz/img1.size < 1
33def to_grayscale(arr):33def to_grayscale(arr):
34    if len(arr.shape) == 3:34    if len(arr.shape) == 3:
35        return average(arr, -1)  35        return average(arr, -1)  
36    else:36    else:
37        return arr37        return arr
38def normalize(arr):38def normalize(arr):
39    rng = arr.max()-arr.min()39    rng = arr.max()-arr.min()
40    amin = arr.min()40    amin = arr.min()
41    return (arr-amin)*255/rngimport numpy as np41    return (arr-amin)*255/rngimport numpy as np
42cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='42cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
43my_array = scores43my_array = scores
44quartile_boundaries = np.percentile(my_array,np.arange(0,100,25))44quartile_boundaries = np.percentile(my_array,np.arange(0,100,25))
45pctl = quartile_boundaries45pctl = quartile_boundaries
t46top_indices, = np.where(my_array>quartile_boundaries[-1])t46top_indices, = np.where(my_array>quartile_boundaries[-1])       
47best_cultivar_indices = top_indices47best_cultivar_indices = top_indices
48print(f'Cultivars with the following IDs are in the top quartile with a score of48print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
49best=cultivarIDs[best_cultivar_indices]49best=cultivarIDs[best_cultivar_indices]
50best.sort()50best.sort()
51print(', '.join([str(int(x)) for x in best]))51print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 199, P-Value: 1.46e-02

Student (left) and Nearest Neighbor (right).


n1from cmath import pin1from cmath import pi 
2import matplotlib.pyplot as plt2import matplotlib.pyplot as plt 
3import numpy as np3import numpy as np
4from compare_plots import compare_plots4from compare_plots import compare_plots
5def make_plot(filename):5def make_plot(filename):
n6    plt.xlim([0,4*(pi)])n6    plt.xlim([0, 4*(pi)])
7    plt.ylim([-1.00,1.00])7    plt.ylim([-1.00, 1.00])
8    plt.xticks(list(range(0, 13, 2)))8    plt.xticks(list(range(0, 13, 2)))
9    plt.xlabel('x (radians)')9    plt.xlabel('x (radians)')
10    plt.ylabel('sin(x)')10    plt.ylabel('sin(x)')
11    radians = np.linspace(0, (4*pi), 80)11    radians = np.linspace(0, (4*pi), 80)
12    sine = np.sin(radians)12    sine = np.sin(radians)
13    plt.plot(radians, sine, 'b-')13    plt.plot(radians, sine, 'b-')
14    plt.savefig(filename)14    plt.savefig(filename)
15if __name__=='__main__':15if __name__=='__main__':
t16    make_plot('my_plot.png', totals)t16    make_plot('my_plot.png')
17    if compare_plots('my_plot.png', 'instructors_plot.png'):17    if compare_plots('my_plot.png','instructors_plot.png'):
18        print('Success!')18        print('Success!')
19    else:19    else:
20        print('Keep trying.')20        print('Keep trying.')
21import matplotlib.pyplot as plt21import matplotlib.pyplot as plt
22from scipy.linalg import norm22from scipy.linalg import norm
23from scipy import sum,average23from scipy import sum,average
24def compare_plots(imagefile1,imagefile2):24def compare_plots(imagefile1,imagefile2):
25    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))25    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
26    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))26    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
27    if img1.size!=img2.size:27    if img1.size!=img2.size:
28        return False28        return False
29    diff = img1 - img2  29    diff = img1 - img2  
30    nm = sum(abs(diff))  30    nm = sum(abs(diff))  
31    nz = norm(diff.ravel(), 0)  31    nz = norm(diff.ravel(), 0)  
32    return nm/img1.size < 1 and nz/img1.size < 132    return nm/img1.size < 1 and nz/img1.size < 1
33def to_grayscale(arr):33def to_grayscale(arr):
34    if len(arr.shape) == 3:34    if len(arr.shape) == 3:
35        return average(arr, -1)  35        return average(arr, -1)  
36    else:36    else:
37        return arr37        return arr
38def normalize(arr):38def normalize(arr):
39    rng = arr.max()-arr.min()39    rng = arr.max()-arr.min()
40    amin = arr.min()40    amin = arr.min()
41    return (arr-amin)*255/rngimport numpy as np41    return (arr-amin)*255/rngimport numpy as np
42cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='42cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
43pctl = np.percentile(scores,np.arange(0,100,25))43pctl = np.percentile(scores,np.arange(0,100,25))
44best_cultivar_indices, = np.where(scores>pctl[-1])44best_cultivar_indices, = np.where(scores>pctl[-1])
45print(f'Cultivars with the following IDs are in the top quartile with a score of45print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
46best=cultivarIDs[best_cultivar_indices]46best=cultivarIDs[best_cultivar_indices]
47best.sort()47best.sort()
48print(', '.join([str(int(x)) for x in best]))48print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 262, P-Value: 1.58e-02

Student (left) and Nearest Neighbor (right).


t1import matplotlib.pyplot as pltt1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
5    plt.xlim([0, 4*(3.14159265)])5    plt.xlim([0, 4*(3.14159265)])
6    plt.ylim([-1.00, 1.00])6    plt.ylim([-1.00, 1.00])
7    plt.xticks(list(range(0, 13, 2)))7    plt.xticks(list(range(0, 13, 2)))
8    plt.xlabel("x (radians)")8    plt.xlabel("x (radians)")
9    plt.ylabel("sin(x)")9    plt.ylabel("sin(x)")
10    radians = np.linspace(0, 4*(3.14159265), 80)10    radians = np.linspace(0, 4*(3.14159265), 80)
11    sine = np.sin(radians)11    sine = np.sin(radians)
12    plt.plot(radians, sine, 'b-')12    plt.plot(radians, sine, 'b-')
13    plt.savefig(filename)13    plt.savefig(filename)
14if __name__=='__main__':14if __name__=='__main__':
15    make_plot('my_plot.png')15    make_plot('my_plot.png')
16    if compare_plots('my_plot.png','instructors_plot.png'):16    if compare_plots('my_plot.png','instructors_plot.png'):
17        print('Success!')17        print('Success!')
18    else:18    else:
19        print('Keep trying.')19        print('Keep trying.')
20import matplotlib.pyplot as plt20import matplotlib.pyplot as plt
21from scipy.linalg import norm21from scipy.linalg import norm
22from scipy import sum,average22from scipy import sum,average
23def compare_plots(imagefile1,imagefile2):23def compare_plots(imagefile1,imagefile2):
24    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))24    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
25    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))25    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
26    if img1.size!=img2.size:26    if img1.size!=img2.size:
27        return False27        return False
28    diff = img1 - img2  28    diff = img1 - img2  
29    nm = sum(abs(diff))  29    nm = sum(abs(diff))  
30    nz = norm(diff.ravel(), 0)  30    nz = norm(diff.ravel(), 0)  
31    return nm/img1.size < 1 and nz/img1.size < 131    return nm/img1.size < 1 and nz/img1.size < 1
32def to_grayscale(arr):32def to_grayscale(arr):
33    if len(arr.shape) == 3:33    if len(arr.shape) == 3:
34        return average(arr, -1)  34        return average(arr, -1)  
35    else:35    else:
36        return arr36        return arr
37def normalize(arr):37def normalize(arr):
38    rng = arr.max()-arr.min()38    rng = arr.max()-arr.min()
39    amin = arr.min()39    amin = arr.min()
40    return (arr-amin)*255/rngimport numpy as np40    return (arr-amin)*255/rngimport numpy as np
41cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='41cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
42pctl = np.percentile(scores,np.arange(0,100,25))42pctl = np.percentile(scores,np.arange(0,100,25))
43best_cultivar_indices, = np.where(scores>pctl[-1])43best_cultivar_indices, = np.where(scores>pctl[-1])
44print(f'Cultivars with the following IDs are in the top quartile with a score of44print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
45best=cultivarIDs[best_cultivar_indices]45best=cultivarIDs[best_cultivar_indices]
46best.sort()46best.sort()
47print(', '.join([str(int(x)) for x in best]))47print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 360, P-Value: 1.58e-02

Student (left) and Nearest Neighbor (right).


t1import matplotlib.pyplot as pltt1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
5    plt.xlim([0, 4*(3.14159265)])5    plt.xlim([0, 4*(3.14159265)])
6    plt.ylim([-1.00, 1.00])6    plt.ylim([-1.00, 1.00])
7    plt.xticks(list(range(0, 13, 2)))7    plt.xticks(list(range(0, 13, 2)))
8    plt.xlabel("x (radians)")8    plt.xlabel("x (radians)")
9    plt.ylabel("sin(x)")9    plt.ylabel("sin(x)")
10    radians = np.linspace(0, 4*(3.14159265), 80)10    radians = np.linspace(0, 4*(3.14159265), 80)
11    sine = np.sin(radians)11    sine = np.sin(radians)
12    plt.plot(radians, sine, 'b-')12    plt.plot(radians, sine, 'b-')
13    plt.savefig(filename)13    plt.savefig(filename)
14if __name__=='__main__':14if __name__=='__main__':
15    make_plot('my_plot.png')15    make_plot('my_plot.png')
16    if compare_plots('my_plot.png','instructors_plot.png'):16    if compare_plots('my_plot.png','instructors_plot.png'):
17        print('Success!')17        print('Success!')
18    else:18    else:
19        print('Keep trying.')19        print('Keep trying.')
20import matplotlib.pyplot as plt20import matplotlib.pyplot as plt
21from scipy.linalg import norm21from scipy.linalg import norm
22from scipy import sum,average22from scipy import sum,average
23def compare_plots(imagefile1,imagefile2):23def compare_plots(imagefile1,imagefile2):
24    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))24    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
25    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))25    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
26    if img1.size!=img2.size:26    if img1.size!=img2.size:
27        return False27        return False
28    diff = img1 - img2  28    diff = img1 - img2  
29    nm = sum(abs(diff))  29    nm = sum(abs(diff))  
30    nz = norm(diff.ravel(), 0)  30    nz = norm(diff.ravel(), 0)  
31    return nm/img1.size < 1 and nz/img1.size < 131    return nm/img1.size < 1 and nz/img1.size < 1
32def to_grayscale(arr):32def to_grayscale(arr):
33    if len(arr.shape) == 3:33    if len(arr.shape) == 3:
34        return average(arr, -1)  34        return average(arr, -1)  
35    else:35    else:
36        return arr36        return arr
37def normalize(arr):37def normalize(arr):
38    rng = arr.max()-arr.min()38    rng = arr.max()-arr.min()
39    amin = arr.min()39    amin = arr.min()
40    return (arr-amin)*255/rngimport numpy as np40    return (arr-amin)*255/rngimport numpy as np
41cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='41cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
42pctl = np.percentile(scores,np.arange(0,100,25))42pctl = np.percentile(scores,np.arange(0,100,25))
43best_cultivar_indices, = np.where(scores>pctl[-1])43best_cultivar_indices, = np.where(scores>pctl[-1])
44print(f'Cultivars with the following IDs are in the top quartile with a score of44print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
45best=cultivarIDs[best_cultivar_indices]45best=cultivarIDs[best_cultivar_indices]
46best.sort()46best.sort()
47print(', '.join([str(int(x)) for x in best]))47print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 399, P-Value: 1.71e-02

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
5   x= np.linspace(0,4*np.pi)5   x= np.linspace(0,4*np.pi)
6   y = np.sin(x)6   y = np.sin(x)
7   plt.xlabel("sin(x)") 7   plt.xlabel("sin(x)") 
8   plt.xlabel("Radians")8   plt.xlabel("Radians")
9   plt.xlim(0,4*np.pi)9   plt.xlim(0,4*np.pi)
10   plt.ylim(-1,1) 10   plt.ylim(-1,1) 
11   plt.plot(x,y,"-b")11   plt.plot(x,y,"-b")
12   plt.savefig(filename)12   plt.savefig(filename)
13if __name__=='__main__':13if __name__=='__main__':
14    make_plot('my_plot.png')14    make_plot('my_plot.png')
15    if compare_plots('my_plot.png','instructors_plot.png'):15    if compare_plots('my_plot.png','instructors_plot.png'):
16        print('Success!')16        print('Success!')
17    else:17    else:
18        print('Keep trying.')18        print('Keep trying.')
19import matplotlib.pyplot as plt19import matplotlib.pyplot as plt
20from scipy.linalg import norm20from scipy.linalg import norm
21from scipy import sum,average21from scipy import sum,average
22def compare_plots(imagefile1,imagefile2):22def compare_plots(imagefile1,imagefile2):
23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
25    if img1.size!=img2.size:25    if img1.size!=img2.size:
26        return False26        return False
27    diff = img1 - img2  27    diff = img1 - img2  
28    nm = sum(abs(diff))  28    nm = sum(abs(diff))  
29    nz = norm(diff.ravel(), 0)  29    nz = norm(diff.ravel(), 0)  
30    return nm/img1.size < 1 and nz/img1.size < 130    return nm/img1.size < 1 and nz/img1.size < 1
31def to_grayscale(arr):31def to_grayscale(arr):
32    if len(arr.shape) == 3:32    if len(arr.shape) == 3:
33        return average(arr, -1)  33        return average(arr, -1)  
34    else:34    else:
35        return arr35        return arr
36def normalize(arr):36def normalize(arr):
37    rng = arr.max()-arr.min()37    rng = arr.max()-arr.min()
38    amin = arr.min()38    amin = arr.min()
39    return (arr-amin)*255/rngimport numpy as np39    return (arr-amin)*255/rngimport numpy as np
40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
41my_array=scores41my_array=scores
42quartile_boundaries = np.percentile(my_array,np.arange(0,100,25))42quartile_boundaries = np.percentile(my_array,np.arange(0,100,25))
n43top_indices = np.where(my_array>quartile_boundaries[-1])n43top_indices, = np.where(my_array>quartile_boundaries[-1])
44print(f'Cultivars with the following IDs are in the top quartile with a score of44print(f'Cultivars with the following IDs are in the top quartile with a score of
> {quartile_boundaries[-1]} or better:')> {quartile_boundaries[-1]} or better:')
t45best=cultivarIDs[top_indices ]t45best=cultivarIDs[top_indices]
46best.sort()46best.sort()
47print(', '.join([str(int(x)) for x in best]))47print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 318, P-Value: 1.89e-02

Student (left) and Nearest Neighbor (right).


t1import matht1import math
2import matplotlib.pyplot as plt2import matplotlib.pyplot as plt
3import numpy as np3import numpy as np
4from compare_plots import compare_plots4from compare_plots import compare_plots
5def make_plot(filename):5def make_plot(filename):
6    x=np.linspace(0,4*np.pi,80)6    x=np.linspace(0,4*np.pi,80)
7    plt.plot(x,np.sin(x),'-b')7    plt.plot(x,np.sin(x),'-b')
8    plt.xlim([0,4*np.pi])8    plt.xlim([0,4*np.pi])
9    plt.ylim([-1,1])9    plt.ylim([-1,1])
10    plt.xlabel('x (radians)')10    plt.xlabel('x (radians)')
11    plt.ylabel('sin(x)')11    plt.ylabel('sin(x)')
12    plt.savefig(filename)12    plt.savefig(filename)
13if __name__=='__main__':13if __name__=='__main__':
14    make_plot('my_plot.png')14    make_plot('my_plot.png')
15    if compare_plots('my_plot.png','instructors_plot.png'):15    if compare_plots('my_plot.png','instructors_plot.png'):
16        print('Success!')16        print('Success!')
17    else:17    else:
18        print('Keep trying.')18        print('Keep trying.')
19import matplotlib.pyplot as plt19import matplotlib.pyplot as plt
20from scipy.linalg import norm20from scipy.linalg import norm
21from scipy import sum,average21from scipy import sum,average
22def compare_plots(imagefile1,imagefile2):22def compare_plots(imagefile1,imagefile2):
23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
25    if img1.size!=img2.size:25    if img1.size!=img2.size:
26        return False26        return False
27    diff = img1 - img2  27    diff = img1 - img2  
28    nm = sum(abs(diff))  28    nm = sum(abs(diff))  
29    nz = norm(diff.ravel(), 0)  29    nz = norm(diff.ravel(), 0)  
30    return nm/img1.size < 1 and nz/img1.size < 130    return nm/img1.size < 1 and nz/img1.size < 1
31def to_grayscale(arr):31def to_grayscale(arr):
32    if len(arr.shape) == 3:32    if len(arr.shape) == 3:
33        return average(arr, -1)  33        return average(arr, -1)  
34    else:34    else:
35        return arr35        return arr
36def normalize(arr):36def normalize(arr):
37    rng = arr.max()-arr.min()37    rng = arr.max()-arr.min()
38    amin = arr.min()38    amin = arr.min()
39    return (arr-amin)*255/rngimport numpy as np39    return (arr-amin)*255/rngimport numpy as np
40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
41pctl = np.percentile(scores, np.arange(0,100,25))41pctl = np.percentile(scores, np.arange(0,100,25))
42best_cultivar_indices = np.where(scores >= pctl[-1])42best_cultivar_indices = np.where(scores >= pctl[-1])
43print(f'Cultivars with the following IDs are in the top quartile with a score of43print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
44best=cultivarIDs[best_cultivar_indices]44best=cultivarIDs[best_cultivar_indices]
45best.sort()45best.sort()
46print(', '.join([str(int(x)) for x in best]))46print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 495, P-Value: 1.89e-02

Student (left) and Nearest Neighbor (right).


t1import matht1import math
2import matplotlib.pyplot as plt2import matplotlib.pyplot as plt
3import numpy as np3import numpy as np
4from compare_plots import compare_plots4from compare_plots import compare_plots
5def make_plot(filename):5def make_plot(filename):
6    x=np.linspace(0,4*np.pi,80)6    x=np.linspace(0,4*np.pi,80)
7    plt.plot(x,np.sin(x),'-b')7    plt.plot(x,np.sin(x),'-b')
8    plt.xlim([0,4*np.pi])8    plt.xlim([0,4*np.pi])
9    plt.ylim([-1,1])9    plt.ylim([-1,1])
10    plt.xlabel('x (radians)')10    plt.xlabel('x (radians)')
11    plt.ylabel('sin(x)')11    plt.ylabel('sin(x)')
12    plt.savefig(filename)12    plt.savefig(filename)
13if __name__=='__main__':13if __name__=='__main__':
14    make_plot('my_plot.png')14    make_plot('my_plot.png')
15    if compare_plots('my_plot.png','instructors_plot.png'):15    if compare_plots('my_plot.png','instructors_plot.png'):
16        print('Success!')16        print('Success!')
17    else:17    else:
18        print('Keep trying.')18        print('Keep trying.')
19import matplotlib.pyplot as plt19import matplotlib.pyplot as plt
20from scipy.linalg import norm20from scipy.linalg import norm
21from scipy import sum,average21from scipy import sum,average
22def compare_plots(imagefile1,imagefile2):22def compare_plots(imagefile1,imagefile2):
23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
25    if img1.size!=img2.size:25    if img1.size!=img2.size:
26        return False26        return False
27    diff = img1 - img2  27    diff = img1 - img2  
28    nm = sum(abs(diff))  28    nm = sum(abs(diff))  
29    nz = norm(diff.ravel(), 0)  29    nz = norm(diff.ravel(), 0)  
30    return nm/img1.size < 1 and nz/img1.size < 130    return nm/img1.size < 1 and nz/img1.size < 1
31def to_grayscale(arr):31def to_grayscale(arr):
32    if len(arr.shape) == 3:32    if len(arr.shape) == 3:
33        return average(arr, -1)  33        return average(arr, -1)  
34    else:34    else:
35        return arr35        return arr
36def normalize(arr):36def normalize(arr):
37    rng = arr.max()-arr.min()37    rng = arr.max()-arr.min()
38    amin = arr.min()38    amin = arr.min()
39    return (arr-amin)*255/rngimport numpy as np39    return (arr-amin)*255/rngimport numpy as np
40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
41pctl = np.percentile(scores, np.arange(0,100,25))41pctl = np.percentile(scores, np.arange(0,100,25))
42best_cultivar_indices = np.where(scores >= pctl[-1])42best_cultivar_indices = np.where(scores >= pctl[-1])
43print(f'Cultivars with the following IDs are in the top quartile with a score of43print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
44best=cultivarIDs[best_cultivar_indices]44best=cultivarIDs[best_cultivar_indices]
45best.sort()45best.sort()
46print(', '.join([str(int(x)) for x in best]))46print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 118, P-Value: 2.33e-02

Student (left) and Nearest Neighbor (right).


n1from cmath import pi n1from cmath import pi
2import matplotlib.pyplot as plt 2import matplotlib.pyplot as plt
3import numpy as np3import numpy as np
4from compare_plots import compare_plots4from compare_plots import compare_plots
5def make_plot(filename):5def make_plot(filename):
n6    plt.xlim([0, 4*(pi)])n6    plt.xlim([0,4*(pi)])
7    plt.ylim([-1.00, 1.00])7    plt.ylim([-1.00,1.00])
8    plt.xticks(list(range(0, 13, 2)))8    plt.xticks(list(range(0, 13, 2)))
9    plt.xlabel('x (radians)')9    plt.xlabel('x (radians)')
10    plt.ylabel('sin(x)')10    plt.ylabel('sin(x)')
11    radians = np.linspace(0, (4*pi), 80)11    radians = np.linspace(0, (4*pi), 80)
12    sine = np.sin(radians)12    sine = np.sin(radians)
13    plt.plot(radians, sine, 'b-')13    plt.plot(radians, sine, 'b-')
14    plt.savefig(filename)14    plt.savefig(filename)
15if __name__=='__main__':15if __name__=='__main__':
t16    make_plot('my_plot.png')t16    make_plot('my_plot.png', totals)
17    if compare_plots('my_plot.png','instructors_plot.png'):17    if compare_plots('my_plot.png', 'instructors_plot.png'):
18        print('Success!')18        print('Success!')
19    else:19    else:
20        print('Keep trying.')20        print('Keep trying.')
21import matplotlib.pyplot as plt21import matplotlib.pyplot as plt
22from scipy.linalg import norm22from scipy.linalg import norm
23from scipy import sum,average23from scipy import sum,average
24def compare_plots(imagefile1,imagefile2):24def compare_plots(imagefile1,imagefile2):
25    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))25    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
26    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))26    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
27    if img1.size!=img2.size:27    if img1.size!=img2.size:
28        return False28        return False
29    diff = img1 - img2  29    diff = img1 - img2  
30    nm = sum(abs(diff))  30    nm = sum(abs(diff))  
31    nz = norm(diff.ravel(), 0)  31    nz = norm(diff.ravel(), 0)  
32    return nm/img1.size < 1 and nz/img1.size < 132    return nm/img1.size < 1 and nz/img1.size < 1
33def to_grayscale(arr):33def to_grayscale(arr):
34    if len(arr.shape) == 3:34    if len(arr.shape) == 3:
35        return average(arr, -1)  35        return average(arr, -1)  
36    else:36    else:
37        return arr37        return arr
38def normalize(arr):38def normalize(arr):
39    rng = arr.max()-arr.min()39    rng = arr.max()-arr.min()
40    amin = arr.min()40    amin = arr.min()
41    return (arr-amin)*255/rngimport numpy as np41    return (arr-amin)*255/rngimport numpy as np
42cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='42cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
43pctl = np.percentile(scores,np.arange(0,100,25))43pctl = np.percentile(scores,np.arange(0,100,25))
44best_cultivar_indices, = np.where(scores>pctl[-1])44best_cultivar_indices, = np.where(scores>pctl[-1])
45print(f'Cultivars with the following IDs are in the top quartile with a score of45print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
46best=cultivarIDs[best_cultivar_indices]46best=cultivarIDs[best_cultivar_indices]
47best.sort()47best.sort()
48print(', '.join([str(int(x)) for x in best]))48print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 469, P-Value: 2.51e-02

Student (left) and Nearest Neighbor (right).


t1import matplotlib.pyplot as pltt1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
5        x = np.linspace(0,np.pi * 4,100)5        x = np.linspace(0,np.pi * 4,100)
6        y = np.sin(x)6        y = np.sin(x)
7        plt.plot(x,y,'b')7        plt.plot(x,y,'b')
8        plt.xlabel('x(radians)')8        plt.xlabel('x(radians)')
9        plt.ylabel('sin(x)')9        plt.ylabel('sin(x)')
10        plt.margins(0,0)10        plt.margins(0,0)
11        plt.savefig(filename) 11        plt.savefig(filename) 
12if __name__=='__main__':12if __name__=='__main__':
13    make_plot('my_plot.png')13    make_plot('my_plot.png')
14    if compare_plots('my_plot.png','instructors_plot.png'):14    if compare_plots('my_plot.png','instructors_plot.png'):
15        print('Success!')15        print('Success!')
16    else:16    else:
17        print('Keep trying.')17        print('Keep trying.')
18import matplotlib.pyplot as plt18import matplotlib.pyplot as plt
19from scipy.linalg import norm19from scipy.linalg import norm
20from scipy import sum,average20from scipy import sum,average
21def compare_plots(imagefile1,imagefile2):21def compare_plots(imagefile1,imagefile2):
22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
24    if img1.size!=img2.size:24    if img1.size!=img2.size:
25        return False25        return False
26    diff = img1 - img2  26    diff = img1 - img2  
27    nm = sum(abs(diff))  27    nm = sum(abs(diff))  
28    nz = norm(diff.ravel(), 0)  28    nz = norm(diff.ravel(), 0)  
29    return nm/img1.size < 1 and nz/img1.size < 129    return nm/img1.size < 1 and nz/img1.size < 1
30def to_grayscale(arr):30def to_grayscale(arr):
31    if len(arr.shape) == 3:31    if len(arr.shape) == 3:
32        return average(arr, -1)  32        return average(arr, -1)  
33    else:33    else:
34        return arr34        return arr
35def normalize(arr):35def normalize(arr):
36    rng = arr.max()-arr.min()36    rng = arr.max()-arr.min()
37    amin = arr.min()37    amin = arr.min()
38    return (arr-amin)*255/rngimport numpy as np38    return (arr-amin)*255/rngimport numpy as np
39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
40pctl = np.percentile(scores, np.arange(0,100,25))40pctl = np.percentile(scores, np.arange(0,100,25))
41best_cultivar_indices = np.where(scores >= pctl[-1])41best_cultivar_indices = np.where(scores >= pctl[-1])
42print(f'Cultivars with the following IDs are in the top quartile with a score of42print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
43best=cultivarIDs[best_cultivar_indices]43best=cultivarIDs[best_cultivar_indices]
44best.sort()44best.sort()
45print(', '.join([str(int(x)) for x in best]))45print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 79, P-Value: 2.51e-02

Student (left) and Nearest Neighbor (right).


t1import matplotlib.pyplot as pltt1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
5        x = np.linspace(0,np.pi * 4,100)5        x = np.linspace(0,np.pi * 4,100)
6        y = np.sin(x)6        y = np.sin(x)
7        plt.plot(x,y,'b')7        plt.plot(x,y,'b')
8        plt.xlabel('x(radians)')8        plt.xlabel('x(radians)')
9        plt.ylabel('sin(x)')9        plt.ylabel('sin(x)')
10        plt.margins(0,0)10        plt.margins(0,0)
11        plt.savefig(filename) 11        plt.savefig(filename) 
12if __name__=='__main__':12if __name__=='__main__':
13    make_plot('my_plot.png')13    make_plot('my_plot.png')
14    if compare_plots('my_plot.png','instructors_plot.png'):14    if compare_plots('my_plot.png','instructors_plot.png'):
15        print('Success!')15        print('Success!')
16    else:16    else:
17        print('Keep trying.')17        print('Keep trying.')
18import matplotlib.pyplot as plt18import matplotlib.pyplot as plt
19from scipy.linalg import norm19from scipy.linalg import norm
20from scipy import sum,average20from scipy import sum,average
21def compare_plots(imagefile1,imagefile2):21def compare_plots(imagefile1,imagefile2):
22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
24    if img1.size!=img2.size:24    if img1.size!=img2.size:
25        return False25        return False
26    diff = img1 - img2  26    diff = img1 - img2  
27    nm = sum(abs(diff))  27    nm = sum(abs(diff))  
28    nz = norm(diff.ravel(), 0)  28    nz = norm(diff.ravel(), 0)  
29    return nm/img1.size < 1 and nz/img1.size < 129    return nm/img1.size < 1 and nz/img1.size < 1
30def to_grayscale(arr):30def to_grayscale(arr):
31    if len(arr.shape) == 3:31    if len(arr.shape) == 3:
32        return average(arr, -1)  32        return average(arr, -1)  
33    else:33    else:
34        return arr34        return arr
35def normalize(arr):35def normalize(arr):
36    rng = arr.max()-arr.min()36    rng = arr.max()-arr.min()
37    amin = arr.min()37    amin = arr.min()
38    return (arr-amin)*255/rngimport numpy as np38    return (arr-amin)*255/rngimport numpy as np
39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
40pctl = np.percentile(scores, np.arange(0,100,25))40pctl = np.percentile(scores, np.arange(0,100,25))
41best_cultivar_indices = np.where(scores >= pctl[-1])41best_cultivar_indices = np.where(scores >= pctl[-1])
42print(f'Cultivars with the following IDs are in the top quartile with a score of42print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
43best=cultivarIDs[best_cultivar_indices]43best=cultivarIDs[best_cultivar_indices]
44best.sort()44best.sort()
45print(', '.join([str(int(x)) for x in best]))45print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 73, P-Value: 2.51e-02

Student (left) and Nearest Neighbor (right).


t1import matplotlib.pyplot as pltt1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
5        x = np.linspace(0,np.pi * 4,100)5        x = np.linspace(0,np.pi * 4,100)
6        y = np.sin(x)6        y = np.sin(x)
7        plt.plot(x,y,'b')7        plt.plot(x,y,'b')
8        plt.xlabel('x(radians)')8        plt.xlabel('x(radians)')
9        plt.ylabel('sin(x)')9        plt.ylabel('sin(x)')
10        plt.margins(0,0)10        plt.margins(0,0)
11        plt.savefig(filename) 11        plt.savefig(filename) 
12if __name__=='__main__':12if __name__=='__main__':
13    make_plot('my_plot.png')13    make_plot('my_plot.png')
14    if compare_plots('my_plot.png','instructors_plot.png'):14    if compare_plots('my_plot.png','instructors_plot.png'):
15        print('Success!')15        print('Success!')
16    else:16    else:
17        print('Keep trying.')17        print('Keep trying.')
18import matplotlib.pyplot as plt18import matplotlib.pyplot as plt
19from scipy.linalg import norm19from scipy.linalg import norm
20from scipy import sum,average20from scipy import sum,average
21def compare_plots(imagefile1,imagefile2):21def compare_plots(imagefile1,imagefile2):
22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
24    if img1.size!=img2.size:24    if img1.size!=img2.size:
25        return False25        return False
26    diff = img1 - img2  26    diff = img1 - img2  
27    nm = sum(abs(diff))  27    nm = sum(abs(diff))  
28    nz = norm(diff.ravel(), 0)  28    nz = norm(diff.ravel(), 0)  
29    return nm/img1.size < 1 and nz/img1.size < 129    return nm/img1.size < 1 and nz/img1.size < 1
30def to_grayscale(arr):30def to_grayscale(arr):
31    if len(arr.shape) == 3:31    if len(arr.shape) == 3:
32        return average(arr, -1)  32        return average(arr, -1)  
33    else:33    else:
34        return arr34        return arr
35def normalize(arr):35def normalize(arr):
36    rng = arr.max()-arr.min()36    rng = arr.max()-arr.min()
37    amin = arr.min()37    amin = arr.min()
38    return (arr-amin)*255/rngimport numpy as np38    return (arr-amin)*255/rngimport numpy as np
39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
40pctl = np.percentile(scores, np.arange(0,100,25))40pctl = np.percentile(scores, np.arange(0,100,25))
41best_cultivar_indices = np.where(scores >= pctl[-1])41best_cultivar_indices = np.where(scores >= pctl[-1])
42print(f'Cultivars with the following IDs are in the top quartile with a score of42print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
43best=cultivarIDs[best_cultivar_indices]43best=cultivarIDs[best_cultivar_indices]
44best.sort()44best.sort()
45print(', '.join([str(int(x)) for x in best]))45print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 475, P-Value: 2.51e-02

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
5   x= np.linspace(0,4*np.pi)5   x= np.linspace(0,4*np.pi)
6   y = np.sin(x)6   y = np.sin(x)
7   plt.xlabel("sin(x)") 7   plt.xlabel("sin(x)") 
8   plt.xlabel("Radians")8   plt.xlabel("Radians")
9   plt.xlim(0,4*np.pi)9   plt.xlim(0,4*np.pi)
10   plt.ylim(-1,1) 10   plt.ylim(-1,1) 
11   plt.plot(x,y,"-b")11   plt.plot(x,y,"-b")
12   plt.savefig(filename)12   plt.savefig(filename)
13if __name__=='__main__':13if __name__=='__main__':
14    make_plot('my_plot.png')14    make_plot('my_plot.png')
15    if compare_plots('my_plot.png','instructors_plot.png'):15    if compare_plots('my_plot.png','instructors_plot.png'):
16        print('Success!')16        print('Success!')
17    else:17    else:
18        print('Keep trying.')18        print('Keep trying.')
19import matplotlib.pyplot as plt19import matplotlib.pyplot as plt
20from scipy.linalg import norm20from scipy.linalg import norm
21from scipy import sum,average21from scipy import sum,average
22def compare_plots(imagefile1,imagefile2):22def compare_plots(imagefile1,imagefile2):
23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
25    if img1.size!=img2.size:25    if img1.size!=img2.size:
26        return False26        return False
27    diff = img1 - img2  27    diff = img1 - img2  
28    nm = sum(abs(diff))  28    nm = sum(abs(diff))  
29    nz = norm(diff.ravel(), 0)  29    nz = norm(diff.ravel(), 0)  
30    return nm/img1.size < 1 and nz/img1.size < 130    return nm/img1.size < 1 and nz/img1.size < 1
31def to_grayscale(arr):31def to_grayscale(arr):
32    if len(arr.shape) == 3:32    if len(arr.shape) == 3:
33        return average(arr, -1)  33        return average(arr, -1)  
34    else:34    else:
35        return arr35        return arr
36def normalize(arr):36def normalize(arr):
37    rng = arr.max()-arr.min()37    rng = arr.max()-arr.min()
38    amin = arr.min()38    amin = arr.min()
39    return (arr-amin)*255/rngimport numpy as np39    return (arr-amin)*255/rngimport numpy as np
40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
41my_array=scores41my_array=scores
42quartile_boundaries = np.percentile(my_array,np.arange(0,100,25))42quartile_boundaries = np.percentile(my_array,np.arange(0,100,25))
n43top_indices, = np.where(my_array>quartile_boundaries[-1])n43top_indices = np.where(my_array>quartile_boundaries[-1])
44print(f'Cultivars with the following IDs are in the top quartile with a score of44print(f'Cultivars with the following IDs are in the top quartile with a score of
> {quartile_boundaries[-1]} or better:')> {quartile_boundaries[-1]} or better:')
t45best=cultivarIDs[top_indices]t45best=cultivarIDs[top_indices ]
46best.sort()46best.sort()
47print(', '.join([str(int(x)) for x in best]))47print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 498, P-Value: 2.70e-02

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3def make_plot(filename):3def make_plot(filename):
4        x = np.linspace(0,np.pi * 4,100)4        x = np.linspace(0,np.pi * 4,100)
5        y = np.sin(x)5        y = np.sin(x)
6        plt.plot(x,y,'b')6        plt.plot(x,y,'b')
7        plt.xlabel('x(radians)')7        plt.xlabel('x(radians)')
8        plt.ylabel('sin(x)')8        plt.ylabel('sin(x)')
9        plt.margins(0,0)9        plt.margins(0,0)
n10        plt.savefig(filename)n10        plt.savefig(filename) 
11if __name__=='__main__':11if __name__=='__main__':
12        make_plot('my_plot.png')12        make_plot('my_plot.png')
13import matplotlib.pyplot as plt13import matplotlib.pyplot as plt
14from scipy.linalg import norm14from scipy.linalg import norm
15from scipy import sum,average15from scipy import sum,average
16def compare_plots(imagefile1,imagefile2):16def compare_plots(imagefile1,imagefile2):
17    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))17    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
18    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))18    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
19    if img1.size!=img2.size:19    if img1.size!=img2.size:
20        return False20        return False
21    diff = img1 - img2  21    diff = img1 - img2  
22    nm = sum(abs(diff))  22    nm = sum(abs(diff))  
23    nz = norm(diff.ravel(), 0)  23    nz = norm(diff.ravel(), 0)  
24    return nm/img1.size < 1 and nz/img1.size < 124    return nm/img1.size < 1 and nz/img1.size < 1
25def to_grayscale(arr):25def to_grayscale(arr):
26    if len(arr.shape) == 3:26    if len(arr.shape) == 3:
27        return average(arr, -1)  27        return average(arr, -1)  
28    else:28    else:
29        return arr29        return arr
30def normalize(arr):30def normalize(arr):
31    rng = arr.max()-arr.min()31    rng = arr.max()-arr.min()
32    amin = arr.min()32    amin = arr.min()
33    return (arr-amin)*255/rngimport numpy as np33    return (arr-amin)*255/rngimport numpy as np
34cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='34cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
t35pctl = np.percentile(scores, np.arange(0,100,25))t35pctl = np.percentile(scores,np.arange(0,100,25))
36best_cultivar_indices = np.where(scores >= pctl[-1])36best_cultivar_indices = np.where(scores >= pctl[-1])
37print(f'Cultivars with the following IDs are in the top quartile with a score of37print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
38best=cultivarIDs[best_cultivar_indices]38best=cultivarIDs[best_cultivar_indices]
39best.sort()39best.sort()
40print(', '.join([str(int(x)) for x in best]))40print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 401, P-Value: 3.63e-02

Student (left) and Nearest Neighbor (right).


f1from cmath import pif1from cmath import pi
2import matplotlib.pyplot as plt2import matplotlib.pyplot as plt
3import numpy as np3import numpy as np
4from compare_plots import compare_plots4from compare_plots import compare_plots
5def make_plot(filename):5def make_plot(filename):
6    x = list(np.linspace(0,4*pi,80))6    x = list(np.linspace(0,4*pi,80))
7    y = list(np.sin(x))7    y = list(np.sin(x))
8    plt.plot(x, y)8    plt.plot(x, y)
9    plt.ylabel('sin(x)')9    plt.ylabel('sin(x)')
10    plt.xlabel('x (radians)')10    plt.xlabel('x (radians)')
11    plt.xlim([0,4*pi])11    plt.xlim([0,4*pi])
12    plt.ylim([-1,1])12    plt.ylim([-1,1])
13    plt.savefig(filename)13    plt.savefig(filename)
14if __name__=='__main__':14if __name__=='__main__':
15    make_plot('my_plot.png')15    make_plot('my_plot.png')
16    if compare_plots('my_plot.png','instructors_plot.png'):16    if compare_plots('my_plot.png','instructors_plot.png'):
17        print('Success!')17        print('Success!')
18    else:18    else:
19        print('Keep trying.')19        print('Keep trying.')
20import matplotlib.pyplot as plt20import matplotlib.pyplot as plt
21from scipy.linalg import norm21from scipy.linalg import norm
22from scipy import sum,average22from scipy import sum,average
23def compare_plots(imagefile1,imagefile2):23def compare_plots(imagefile1,imagefile2):
24    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))24    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
25    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))25    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
26    if img1.size!=img2.size:26    if img1.size!=img2.size:
27        return False27        return False
28    diff = img1 - img2  28    diff = img1 - img2  
29    nm = sum(abs(diff))  29    nm = sum(abs(diff))  
30    nz = norm(diff.ravel(), 0)  30    nz = norm(diff.ravel(), 0)  
31    return nm/img1.size < 1 and nz/img1.size < 131    return nm/img1.size < 1 and nz/img1.size < 1
32def to_grayscale(arr):32def to_grayscale(arr):
33    if len(arr.shape) == 3:33    if len(arr.shape) == 3:
34        return average(arr, -1)  34        return average(arr, -1)  
35    else:35    else:
36        return arr36        return arr
37def normalize(arr):37def normalize(arr):
38    rng = arr.max()-arr.min()38    rng = arr.max()-arr.min()
39    amin = arr.min()39    amin = arr.min()
40    return (arr-amin)*255/rngimport numpy as np40    return (arr-amin)*255/rngimport numpy as np
41cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='41cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
42pctl = np.percentile(scores, np.arange(0, 100, 25))42pctl = np.percentile(scores, np.arange(0, 100, 25))
t43best_cultivar_indices, = np.where(scores > pctl[-1])t43best_cultivar_indices = np.where(scores > pctl[-1])
44print(f'Cultivars with the following IDs are in the top quartile with a score of44print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
45best=cultivarIDs[best_cultivar_indices]45best=cultivarIDs[best_cultivar_indices]
46best.sort()46best.sort()
47print(', '.join([str(int(x)) for x in best]))47print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 22, P-Value: 3.63e-02

Student (left) and Nearest Neighbor (right).


f1from cmath import pif1from cmath import pi
2import matplotlib.pyplot as plt2import matplotlib.pyplot as plt
3import numpy as np3import numpy as np
4from compare_plots import compare_plots4from compare_plots import compare_plots
5def make_plot(filename):5def make_plot(filename):
6    x = list(np.linspace(0,4*pi,80))6    x = list(np.linspace(0,4*pi,80))
7    y = list(np.sin(x))7    y = list(np.sin(x))
8    plt.plot(x, y)8    plt.plot(x, y)
9    plt.ylabel('sin(x)')9    plt.ylabel('sin(x)')
10    plt.xlabel('x (radians)')10    plt.xlabel('x (radians)')
11    plt.xlim([0,4*pi])11    plt.xlim([0,4*pi])
12    plt.ylim([-1,1])12    plt.ylim([-1,1])
13    plt.savefig(filename)13    plt.savefig(filename)
14if __name__=='__main__':14if __name__=='__main__':
15    make_plot('my_plot.png')15    make_plot('my_plot.png')
16    if compare_plots('my_plot.png','instructors_plot.png'):16    if compare_plots('my_plot.png','instructors_plot.png'):
17        print('Success!')17        print('Success!')
18    else:18    else:
19        print('Keep trying.')19        print('Keep trying.')
20import matplotlib.pyplot as plt20import matplotlib.pyplot as plt
21from scipy.linalg import norm21from scipy.linalg import norm
22from scipy import sum,average22from scipy import sum,average
23def compare_plots(imagefile1,imagefile2):23def compare_plots(imagefile1,imagefile2):
24    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))24    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
25    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))25    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
26    if img1.size!=img2.size:26    if img1.size!=img2.size:
27        return False27        return False
28    diff = img1 - img2  28    diff = img1 - img2  
29    nm = sum(abs(diff))  29    nm = sum(abs(diff))  
30    nz = norm(diff.ravel(), 0)  30    nz = norm(diff.ravel(), 0)  
31    return nm/img1.size < 1 and nz/img1.size < 131    return nm/img1.size < 1 and nz/img1.size < 1
32def to_grayscale(arr):32def to_grayscale(arr):
33    if len(arr.shape) == 3:33    if len(arr.shape) == 3:
34        return average(arr, -1)  34        return average(arr, -1)  
35    else:35    else:
36        return arr36        return arr
37def normalize(arr):37def normalize(arr):
38    rng = arr.max()-arr.min()38    rng = arr.max()-arr.min()
39    amin = arr.min()39    amin = arr.min()
40    return (arr-amin)*255/rngimport numpy as np40    return (arr-amin)*255/rngimport numpy as np
41cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='41cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
42pctl = np.percentile(scores, np.arange(0, 100, 25))42pctl = np.percentile(scores, np.arange(0, 100, 25))
t43best_cultivar_indices = np.where(scores > pctl[-1])t43best_cultivar_indices, = np.where(scores > pctl[-1])
44print(f'Cultivars with the following IDs are in the top quartile with a score of44print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
45best=cultivarIDs[best_cultivar_indices]45best=cultivarIDs[best_cultivar_indices]
46best.sort()46best.sort()
47print(', '.join([str(int(x)) for x in best]))47print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 218, P-Value: 3.76e-02

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
5    x = np.linspace(0,4*np.pi,80)5    x = np.linspace(0,4*np.pi,80)
6    y = np.sin(x)6    y = np.sin(x)
t7    plt.plot(x,y,'-b')t7    plt.plot(x,y,'-b')
8    plt.xlabel('x (radians)')8    plt.xlabel('x (radians)')
9    plt.ylabel('sin(x)')9    plt.ylabel('sin(x)')
10    plt.xlim([0,4*np.pi])10    plt.xlim([0,4*np.pi])
11    plt.ylim([-1,1])11    plt.ylim([-1,1])
12    plt.savefig(filename)12    plt.savefig(filename)
13if __name__=='__main__':13if __name__=='__main__':
14    make_plot('my_plot.png')14    make_plot('my_plot.png')
15    if compare_plots('my_plot.png','instructors_plot.png'):15    if compare_plots('my_plot.png','instructors_plot.png'):
16        print('Success!')16        print('Success!')
17    else:17    else:
18        print('Keep trying.')18        print('Keep trying.')
19import matplotlib.pyplot as plt19import matplotlib.pyplot as plt
20from scipy.linalg import norm20from scipy.linalg import norm
21from scipy import sum,average21from scipy import sum,average
22def compare_plots(imagefile1,imagefile2):22def compare_plots(imagefile1,imagefile2):
23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
25    if img1.size!=img2.size:25    if img1.size!=img2.size:
26        return False26        return False
27    diff = img1 - img2  27    diff = img1 - img2  
28    nm = sum(abs(diff))  28    nm = sum(abs(diff))  
29    nz = norm(diff.ravel(), 0)  29    nz = norm(diff.ravel(), 0)  
30    return nm/img1.size < 1 and nz/img1.size < 130    return nm/img1.size < 1 and nz/img1.size < 1
31def to_grayscale(arr):31def to_grayscale(arr):
32    if len(arr.shape) == 3:32    if len(arr.shape) == 3:
33        return average(arr, -1)  33        return average(arr, -1)  
34    else:34    else:
35        return arr35        return arr
36def normalize(arr):36def normalize(arr):
37    rng = arr.max()-arr.min()37    rng = arr.max()-arr.min()
38    amin = arr.min()38    amin = arr.min()
39    return (arr-amin)*255/rngimport numpy as np39    return (arr-amin)*255/rngimport numpy as np
40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
41pctl = np.percentile(scores, np.arange(0,100,25))41pctl = np.percentile(scores, np.arange(0,100,25))
42best_cultivar_indices = np.where(scores >= pctl[-1])42best_cultivar_indices = np.where(scores >= pctl[-1])
43print(f'Cultivars with the following IDs are in the top quartile with a score of43print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
44best=cultivarIDs[best_cultivar_indices]44best=cultivarIDs[best_cultivar_indices]
45best.sort()45best.sort()
46print(', '.join([str(int(x)) for x in best]))46print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 347, P-Value: 3.76e-02

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
5    x = np.linspace(0,4*np.pi,80)5    x = np.linspace(0,4*np.pi,80)
6    y = np.sin(x)6    y = np.sin(x)
t7    plt.plot(x,y,'-b')t7    plt.plot(x,y,'-b')
8    plt.xlabel('x (radians)')8    plt.xlabel('x (radians)')
9    plt.ylabel('sin(x)')9    plt.ylabel('sin(x)')
10    plt.xlim([0,4*np.pi])10    plt.xlim([0,4*np.pi])
11    plt.ylim([-1,1])11    plt.ylim([-1,1])
12    plt.savefig(filename)12    plt.savefig(filename)
13if __name__=='__main__':13if __name__=='__main__':
14    make_plot('my_plot.png')14    make_plot('my_plot.png')
15    if compare_plots('my_plot.png','instructors_plot.png'):15    if compare_plots('my_plot.png','instructors_plot.png'):
16        print('Success!')16        print('Success!')
17    else:17    else:
18        print('Keep trying.')18        print('Keep trying.')
19import matplotlib.pyplot as plt19import matplotlib.pyplot as plt
20from scipy.linalg import norm20from scipy.linalg import norm
21from scipy import sum,average21from scipy import sum,average
22def compare_plots(imagefile1,imagefile2):22def compare_plots(imagefile1,imagefile2):
23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
25    if img1.size!=img2.size:25    if img1.size!=img2.size:
26        return False26        return False
27    diff = img1 - img2  27    diff = img1 - img2  
28    nm = sum(abs(diff))  28    nm = sum(abs(diff))  
29    nz = norm(diff.ravel(), 0)  29    nz = norm(diff.ravel(), 0)  
30    return nm/img1.size < 1 and nz/img1.size < 130    return nm/img1.size < 1 and nz/img1.size < 1
31def to_grayscale(arr):31def to_grayscale(arr):
32    if len(arr.shape) == 3:32    if len(arr.shape) == 3:
33        return average(arr, -1)  33        return average(arr, -1)  
34    else:34    else:
35        return arr35        return arr
36def normalize(arr):36def normalize(arr):
37    rng = arr.max()-arr.min()37    rng = arr.max()-arr.min()
38    amin = arr.min()38    amin = arr.min()
39    return (arr-amin)*255/rngimport numpy as np39    return (arr-amin)*255/rngimport numpy as np
40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
41pctl = np.percentile(scores, np.arange(0,100,25))41pctl = np.percentile(scores, np.arange(0,100,25))
42best_cultivar_indices = np.where(scores >= pctl[-1])42best_cultivar_indices = np.where(scores >= pctl[-1])
43print(f'Cultivars with the following IDs are in the top quartile with a score of43print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
44best=cultivarIDs[best_cultivar_indices]44best=cultivarIDs[best_cultivar_indices]
45best.sort()45best.sort()
46print(', '.join([str(int(x)) for x in best]))46print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 139, P-Value: 3.83e-02

Student (left) and Nearest Neighbor (right).


tt1import math
1import matplotlib.pyplot as plt2import matplotlib.pyplot as plt
2import numpy as np3import numpy as np
3from compare_plots import compare_plots4from compare_plots import compare_plots
4def make_plot(filename):5def make_plot(filename):
5    x=np.linspace(0,4*np.pi,80)6    x=np.linspace(0,4*np.pi,80)
6    plt.plot(x,np.sin(x),'-b')7    plt.plot(x,np.sin(x),'-b')
7    plt.xlim([0,4*np.pi])8    plt.xlim([0,4*np.pi])
8    plt.ylim([-1,1])9    plt.ylim([-1,1])
9    plt.xlabel('x (radians)')10    plt.xlabel('x (radians)')
10    plt.ylabel('sin(x)')11    plt.ylabel('sin(x)')
11    plt.savefig(filename)12    plt.savefig(filename)
12if __name__=='__main__':13if __name__=='__main__':
13    make_plot('my_plot.png')14    make_plot('my_plot.png')
14    if compare_plots('my_plot.png','instructors_plot.png'):15    if compare_plots('my_plot.png','instructors_plot.png'):
15        print('Success!')16        print('Success!')
16    else:17    else:
17        print('Keep trying.')18        print('Keep trying.')
18import matplotlib.pyplot as plt19import matplotlib.pyplot as plt
19from scipy.linalg import norm20from scipy.linalg import norm
20from scipy import sum,average21from scipy import sum,average
21def compare_plots(imagefile1,imagefile2):22def compare_plots(imagefile1,imagefile2):
22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
24    if img1.size!=img2.size:25    if img1.size!=img2.size:
25        return False26        return False
26    diff = img1 - img2  27    diff = img1 - img2  
27    nm = sum(abs(diff))  28    nm = sum(abs(diff))  
28    nz = norm(diff.ravel(), 0)  29    nz = norm(diff.ravel(), 0)  
29    return nm/img1.size < 1 and nz/img1.size < 130    return nm/img1.size < 1 and nz/img1.size < 1
30def to_grayscale(arr):31def to_grayscale(arr):
31    if len(arr.shape) == 3:32    if len(arr.shape) == 3:
32        return average(arr, -1)  33        return average(arr, -1)  
33    else:34    else:
34        return arr35        return arr
35def normalize(arr):36def normalize(arr):
36    rng = arr.max()-arr.min()37    rng = arr.max()-arr.min()
37    amin = arr.min()38    amin = arr.min()
38    return (arr-amin)*255/rngimport numpy as np39    return (arr-amin)*255/rngimport numpy as np
39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
40pctl = np.percentile(scores, np.arange(0,100,25))41pctl = np.percentile(scores, np.arange(0,100,25))
41best_cultivar_indices = np.where(scores >= pctl[-1])42best_cultivar_indices = np.where(scores >= pctl[-1])
42print(f'Cultivars with the following IDs are in the top quartile with a score of43print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
43best=cultivarIDs[best_cultivar_indices]44best=cultivarIDs[best_cultivar_indices]
44best.sort()45best.sort()
45print(', '.join([str(int(x)) for x in best]))46print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 113, P-Value: 3.96e-02

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3def make_plot(filename):3def make_plot(filename):
4        x = np.linspace(0,np.pi * 4,100)4        x = np.linspace(0,np.pi * 4,100)
5        y = np.sin(x)5        y = np.sin(x)
6        plt.plot(x,y,'b')6        plt.plot(x,y,'b')
7        plt.xlabel('x(radians)')7        plt.xlabel('x(radians)')
8        plt.ylabel('sin(x)')8        plt.ylabel('sin(x)')
9        plt.margins(0,0)9        plt.margins(0,0)
10        plt.savefig(filename)10        plt.savefig(filename)
tt11if __name__=='__main__':
12        make_plot('my_plot.png')
11import matplotlib.pyplot as plt13import matplotlib.pyplot as plt
12from scipy.linalg import norm14from scipy.linalg import norm
13from scipy import sum,average15from scipy import sum,average
14def compare_plots(imagefile1,imagefile2):16def compare_plots(imagefile1,imagefile2):
15    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))17    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
16    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))18    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
17    if img1.size!=img2.size:19    if img1.size!=img2.size:
18        return False20        return False
19    diff = img1 - img2  21    diff = img1 - img2  
20    nm = sum(abs(diff))  22    nm = sum(abs(diff))  
21    nz = norm(diff.ravel(), 0)  23    nz = norm(diff.ravel(), 0)  
22    return nm/img1.size < 1 and nz/img1.size < 124    return nm/img1.size < 1 and nz/img1.size < 1
23def to_grayscale(arr):25def to_grayscale(arr):
24    if len(arr.shape) == 3:26    if len(arr.shape) == 3:
25        return average(arr, -1)  27        return average(arr, -1)  
26    else:28    else:
27        return arr29        return arr
28def normalize(arr):30def normalize(arr):
29    rng = arr.max()-arr.min()31    rng = arr.max()-arr.min()
30    amin = arr.min()32    amin = arr.min()
31    return (arr-amin)*255/rngimport numpy as np33    return (arr-amin)*255/rngimport numpy as np
32cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='34cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
33pctl = np.percentile(scores, np.arange(0,100,25))35pctl = np.percentile(scores, np.arange(0,100,25))
34best_cultivar_indices = np.where(scores >= pctl[-1])36best_cultivar_indices = np.where(scores >= pctl[-1])
35print(f'Cultivars with the following IDs are in the top quartile with a score of37print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
36best=cultivarIDs[best_cultivar_indices]38best=cultivarIDs[best_cultivar_indices]
37best.sort()39best.sort()
38print(', '.join([str(int(x)) for x in best]))40print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 184, P-Value: 4.10e-02

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
n5    x = np.linspace(0.0, np.pi *4,num=80)n5    x = np.linspace(0.0, np.pi * 4, num=80)
6    plt.plot(x, np.sin(x), 'b-')6    plt.plot(x, np.sin(x), 'b-')
7    plt.xlabel('x(radians)')7    plt.xlabel('x(radians)')
8    plt.ylabel('sin(x)')8    plt.ylabel('sin(x)')
9    plt.xlim(0, np.pi*4)9    plt.xlim(0, np.pi*4)
10    plt.ylim(-1,1)10    plt.ylim(-1,1)
11    plt.savefig(filename)11    plt.savefig(filename)
12if __name__=='__main__':12if __name__=='__main__':
13    make_plot('my_plot.png')13    make_plot('my_plot.png')
14    if compare_plots('my_plot.png','instructors_plot.png'):14    if compare_plots('my_plot.png','instructors_plot.png'):
15        print('Success!')15        print('Success!')
16    else:16    else:
17        print('Keep trying.')17        print('Keep trying.')
18import matplotlib.pyplot as plt18import matplotlib.pyplot as plt
19from scipy.linalg import norm19from scipy.linalg import norm
20from scipy import sum,average20from scipy import sum,average
21def compare_plots(imagefile1,imagefile2):21def compare_plots(imagefile1,imagefile2):
22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
24    if img1.size!=img2.size:24    if img1.size!=img2.size:
25        return False25        return False
26    diff = img1 - img2  26    diff = img1 - img2  
27    nm = sum(abs(diff))  27    nm = sum(abs(diff))  
28    nz = norm(diff.ravel(), 0)  28    nz = norm(diff.ravel(), 0)  
29    return nm/img1.size < 1 and nz/img1.size < 129    return nm/img1.size < 1 and nz/img1.size < 1
30def to_grayscale(arr):30def to_grayscale(arr):
31    if len(arr.shape) == 3:31    if len(arr.shape) == 3:
32        return average(arr, -1)  32        return average(arr, -1)  
33    else:33    else:
34        return arr34        return arr
35def normalize(arr):35def normalize(arr):
36    rng = arr.max()-arr.min()36    rng = arr.max()-arr.min()
37    amin = arr.min()37    amin = arr.min()
38    return (arr-amin)*255/rngimport numpy as np38    return (arr-amin)*255/rngimport numpy as np
39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
40pctl = np.percentile(scores,np.arange(0,100,25))40pctl = np.percentile(scores,np.arange(0,100,25))
t41best_cultivar_indices, = np.where(scores>pctl[-1])t41best_cultivar_indices = np.where(scores>pctl[-1])
42print(f'Cultivars with the following IDs are in the top quartile with a score of42print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
43best=cultivarIDs[best_cultivar_indices]43best=cultivarIDs[best_cultivar_indices]
44best.sort()44best.sort()
45print(', '.join([str(int(x)) for x in best]))45print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 474, P-Value: 4.10e-02

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
n5    x = np.linspace(0.0, np.pi * 4, num=80)n5    x = np.linspace(0.0, np.pi *4,num=80)
6    plt.plot(x, np.sin(x), 'b-')6    plt.plot(x, np.sin(x), 'b-')
7    plt.xlabel('x(radians)')7    plt.xlabel('x(radians)')
8    plt.ylabel('sin(x)')8    plt.ylabel('sin(x)')
9    plt.xlim(0, np.pi*4)9    plt.xlim(0, np.pi*4)
10    plt.ylim(-1,1)10    plt.ylim(-1,1)
11    plt.savefig(filename)11    plt.savefig(filename)
12if __name__=='__main__':12if __name__=='__main__':
13    make_plot('my_plot.png')13    make_plot('my_plot.png')
14    if compare_plots('my_plot.png','instructors_plot.png'):14    if compare_plots('my_plot.png','instructors_plot.png'):
15        print('Success!')15        print('Success!')
16    else:16    else:
17        print('Keep trying.')17        print('Keep trying.')
18import matplotlib.pyplot as plt18import matplotlib.pyplot as plt
19from scipy.linalg import norm19from scipy.linalg import norm
20from scipy import sum,average20from scipy import sum,average
21def compare_plots(imagefile1,imagefile2):21def compare_plots(imagefile1,imagefile2):
22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
24    if img1.size!=img2.size:24    if img1.size!=img2.size:
25        return False25        return False
26    diff = img1 - img2  26    diff = img1 - img2  
27    nm = sum(abs(diff))  27    nm = sum(abs(diff))  
28    nz = norm(diff.ravel(), 0)  28    nz = norm(diff.ravel(), 0)  
29    return nm/img1.size < 1 and nz/img1.size < 129    return nm/img1.size < 1 and nz/img1.size < 1
30def to_grayscale(arr):30def to_grayscale(arr):
31    if len(arr.shape) == 3:31    if len(arr.shape) == 3:
32        return average(arr, -1)  32        return average(arr, -1)  
33    else:33    else:
34        return arr34        return arr
35def normalize(arr):35def normalize(arr):
36    rng = arr.max()-arr.min()36    rng = arr.max()-arr.min()
37    amin = arr.min()37    amin = arr.min()
38    return (arr-amin)*255/rngimport numpy as np38    return (arr-amin)*255/rngimport numpy as np
39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
40pctl = np.percentile(scores,np.arange(0,100,25))40pctl = np.percentile(scores,np.arange(0,100,25))
t41best_cultivar_indices = np.where(scores>pctl[-1])t41best_cultivar_indices, = np.where(scores>pctl[-1])
42print(f'Cultivars with the following IDs are in the top quartile with a score of42print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
43best=cultivarIDs[best_cultivar_indices]43best=cultivarIDs[best_cultivar_indices]
44best.sort()44best.sort()
45print(', '.join([str(int(x)) for x in best]))45print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 353, P-Value: 4.23e-02

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3def make_plot(filename):3def make_plot(filename):
4        x = np.linspace(0,np.pi * 4,100)4        x = np.linspace(0,np.pi * 4,100)
5        y = np.sin(x)5        y = np.sin(x)
6        plt.plot(x,y,'b')6        plt.plot(x,y,'b')
7        plt.xlabel('x(radians)')7        plt.xlabel('x(radians)')
8        plt.ylabel('sin(x)')8        plt.ylabel('sin(x)')
9        plt.margins(0,0)9        plt.margins(0,0)
n10        plt.savefig(filename) n10        plt.savefig(filename)
11if __name__=='__main__':11if __name__=='__main__':
12        make_plot('my_plot.png')12        make_plot('my_plot.png')
13import matplotlib.pyplot as plt13import matplotlib.pyplot as plt
14from scipy.linalg import norm14from scipy.linalg import norm
15from scipy import sum,average15from scipy import sum,average
16def compare_plots(imagefile1,imagefile2):16def compare_plots(imagefile1,imagefile2):
17    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))17    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
18    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))18    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
19    if img1.size!=img2.size:19    if img1.size!=img2.size:
20        return False20        return False
21    diff = img1 - img2  21    diff = img1 - img2  
22    nm = sum(abs(diff))  22    nm = sum(abs(diff))  
23    nz = norm(diff.ravel(), 0)  23    nz = norm(diff.ravel(), 0)  
24    return nm/img1.size < 1 and nz/img1.size < 124    return nm/img1.size < 1 and nz/img1.size < 1
25def to_grayscale(arr):25def to_grayscale(arr):
26    if len(arr.shape) == 3:26    if len(arr.shape) == 3:
27        return average(arr, -1)  27        return average(arr, -1)  
28    else:28    else:
29        return arr29        return arr
30def normalize(arr):30def normalize(arr):
31    rng = arr.max()-arr.min()31    rng = arr.max()-arr.min()
32    amin = arr.min()32    amin = arr.min()
33    return (arr-amin)*255/rngimport numpy as np33    return (arr-amin)*255/rngimport numpy as np
34cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='34cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
t35pctl = np.percentile(scores,np.arange(0,100,25))t35pctl = np.percentile(scores, np.arange(0,100,25))
36best_cultivar_indices = np.where(scores >= pctl[-1])36best_cultivar_indices = np.where(scores >= pctl[-1])
37print(f'Cultivars with the following IDs are in the top quartile with a score of37print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
38best=cultivarIDs[best_cultivar_indices]38best=cultivarIDs[best_cultivar_indices]
39best.sort()39best.sort()
40print(', '.join([str(int(x)) for x in best]))40print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 407, P-Value: 4.39e-02

Student (left) and Nearest Neighbor (right).


t1import matplotlib.pyplot as pltt1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
5    x = np.linspace(0.0,np.pi *4,num=80)5    x = np.linspace(0.0,np.pi *4,num=80)
6    plt.plot(x,np.sin(x), 'b-')6    plt.plot(x,np.sin(x), 'b-')
7    plt.xlabel('x(radians)')7    plt.xlabel('x(radians)')
8    plt.ylabel('sin(x)')8    plt.ylabel('sin(x)')
9    plt.xlim(0,np.pi*4)9    plt.xlim(0,np.pi*4)
10    plt.ylim(-1,1)10    plt.ylim(-1,1)
11    plt.savefig(filename)11    plt.savefig(filename)
12if __name__=='__main__':12if __name__=='__main__':
13    make_plot('my_plot.png')13    make_plot('my_plot.png')
14    if compare_plots('my_plot.png','instructors_plot.png'):14    if compare_plots('my_plot.png','instructors_plot.png'):
15        print('Success!')15        print('Success!')
16    else:16    else:
17        print('Keep trying.')17        print('Keep trying.')
18import matplotlib.pyplot as plt18import matplotlib.pyplot as plt
19from scipy.linalg import norm19from scipy.linalg import norm
20from scipy import sum,average20from scipy import sum,average
21def compare_plots(imagefile1,imagefile2):21def compare_plots(imagefile1,imagefile2):
22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
24    if img1.size!=img2.size:24    if img1.size!=img2.size:
25        return False25        return False
26    diff = img1 - img2  26    diff = img1 - img2  
27    nm = sum(abs(diff))  27    nm = sum(abs(diff))  
28    nz = norm(diff.ravel(), 0)  28    nz = norm(diff.ravel(), 0)  
29    return nm/img1.size < 1 and nz/img1.size < 129    return nm/img1.size < 1 and nz/img1.size < 1
30def to_grayscale(arr):30def to_grayscale(arr):
31    if len(arr.shape) == 3:31    if len(arr.shape) == 3:
32        return average(arr, -1)  32        return average(arr, -1)  
33    else:33    else:
34        return arr34        return arr
35def normalize(arr):35def normalize(arr):
36    rng = arr.max()-arr.min()36    rng = arr.max()-arr.min()
37    amin = arr.min()37    amin = arr.min()
38    return (arr-amin)*255/rngimport numpy as np38    return (arr-amin)*255/rngimport numpy as np
39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
40pctl = np.percentile(scores,np.arange(0,100,25))40pctl = np.percentile(scores,np.arange(0,100,25))
41best_cultivar_indices, = np.where(scores>pctl[-1])41best_cultivar_indices, = np.where(scores>pctl[-1])
42print(f'Cultivars with the following IDs are in the top quartile with a score of42print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
43best=cultivarIDs[best_cultivar_indices]43best=cultivarIDs[best_cultivar_indices]
44best.sort()44best.sort()
45print(', '.join([str(int(x)) for x in best]))45print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 468, P-Value: 4.39e-02

Student (left) and Nearest Neighbor (right).


t1import matplotlib.pyplot as pltt1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
5    x = np.linspace(0.0,np.pi *4,num=80)5    x = np.linspace(0.0,np.pi *4,num=80)
6    plt.plot(x,np.sin(x), 'b-')6    plt.plot(x,np.sin(x), 'b-')
7    plt.xlabel('x(radians)')7    plt.xlabel('x(radians)')
8    plt.ylabel('sin(x)')8    plt.ylabel('sin(x)')
9    plt.xlim(0,np.pi*4)9    plt.xlim(0,np.pi*4)
10    plt.ylim(-1,1)10    plt.ylim(-1,1)
11    plt.savefig(filename)11    plt.savefig(filename)
12if __name__=='__main__':12if __name__=='__main__':
13    make_plot('my_plot.png')13    make_plot('my_plot.png')
14    if compare_plots('my_plot.png','instructors_plot.png'):14    if compare_plots('my_plot.png','instructors_plot.png'):
15        print('Success!')15        print('Success!')
16    else:16    else:
17        print('Keep trying.')17        print('Keep trying.')
18import matplotlib.pyplot as plt18import matplotlib.pyplot as plt
19from scipy.linalg import norm19from scipy.linalg import norm
20from scipy import sum,average20from scipy import sum,average
21def compare_plots(imagefile1,imagefile2):21def compare_plots(imagefile1,imagefile2):
22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
24    if img1.size!=img2.size:24    if img1.size!=img2.size:
25        return False25        return False
26    diff = img1 - img2  26    diff = img1 - img2  
27    nm = sum(abs(diff))  27    nm = sum(abs(diff))  
28    nz = norm(diff.ravel(), 0)  28    nz = norm(diff.ravel(), 0)  
29    return nm/img1.size < 1 and nz/img1.size < 129    return nm/img1.size < 1 and nz/img1.size < 1
30def to_grayscale(arr):30def to_grayscale(arr):
31    if len(arr.shape) == 3:31    if len(arr.shape) == 3:
32        return average(arr, -1)  32        return average(arr, -1)  
33    else:33    else:
34        return arr34        return arr
35def normalize(arr):35def normalize(arr):
36    rng = arr.max()-arr.min()36    rng = arr.max()-arr.min()
37    amin = arr.min()37    amin = arr.min()
38    return (arr-amin)*255/rngimport numpy as np38    return (arr-amin)*255/rngimport numpy as np
39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
40pctl = np.percentile(scores,np.arange(0,100,25))40pctl = np.percentile(scores,np.arange(0,100,25))
41best_cultivar_indices, = np.where(scores>pctl[-1])41best_cultivar_indices, = np.where(scores>pctl[-1])
42print(f'Cultivars with the following IDs are in the top quartile with a score of42print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
43best=cultivarIDs[best_cultivar_indices]43best=cultivarIDs[best_cultivar_indices]
44best.sort()44best.sort()
45print(', '.join([str(int(x)) for x in best]))45print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 488, P-Value: 4.77e-02

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
5    x = np.linspace(0,np.pi * 4,100)5    x = np.linspace(0,np.pi * 4,100)
6    y = np.sin(x)6    y = np.sin(x)
7    plt.plot(x,y,'b')7    plt.plot(x,y,'b')
8    plt.xlabel('x(radians)')8    plt.xlabel('x(radians)')
9    plt.ylabel('sin(x)')9    plt.ylabel('sin(x)')
10    plt.margins(0,0)10    plt.margins(0,0)
11    plt.savefig(filename)11    plt.savefig(filename)
12if __name__=='__main__':12if __name__=='__main__':
13    make_plot('my_plot.png')13    make_plot('my_plot.png')
14    if compare_plots('my_plot.png','instructors_plot.png'):14    if compare_plots('my_plot.png','instructors_plot.png'):
15        print('Success!')15        print('Success!')
16    else:16    else:
17        print('Keep trying.')17        print('Keep trying.')
18import matplotlib.pyplot as plt18import matplotlib.pyplot as plt
19from scipy.linalg import norm19from scipy.linalg import norm
20from scipy import sum,average20from scipy import sum,average
21def compare_plots(imagefile1,imagefile2):21def compare_plots(imagefile1,imagefile2):
22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
24    if img1.size!=img2.size:24    if img1.size!=img2.size:
25        return False25        return False
26    diff = img1 - img2  26    diff = img1 - img2  
27    nm = sum(abs(diff))  27    nm = sum(abs(diff))  
28    nz = norm(diff.ravel(), 0)  28    nz = norm(diff.ravel(), 0)  
29    return nm/img1.size < 1 and nz/img1.size < 129    return nm/img1.size < 1 and nz/img1.size < 1
30def to_grayscale(arr):30def to_grayscale(arr):
31    if len(arr.shape) == 3:31    if len(arr.shape) == 3:
32        return average(arr, -1)  32        return average(arr, -1)  
33    else:33    else:
34        return arr34        return arr
35def normalize(arr):35def normalize(arr):
36    rng = arr.max()-arr.min()36    rng = arr.max()-arr.min()
37    amin = arr.min()37    amin = arr.min()
38    return (arr-amin)*255/rngimport numpy as np38    return (arr-amin)*255/rngimport numpy as np
39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
40pctl = np.percentile(scores, np.arange(0,100,25))40pctl = np.percentile(scores, np.arange(0,100,25))
t41best_cultivar_indices = np.where(scores>=pctl[-1])t41best_cultivar_indices = np.where(scores>= pctl[-1])
42print(f'Cultivars with the following IDs are in the top quartile with a score of42print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
43best=cultivarIDs[best_cultivar_indices]43best=cultivarIDs[best_cultivar_indices]
44best.sort()44best.sort()
45print(', '.join([str(int(x)) for x in best]))45print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 77, P-Value: 4.77e-02

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
5    x = np.linspace(0,np.pi * 4,100)5    x = np.linspace(0,np.pi * 4,100)
6    y = np.sin(x)6    y = np.sin(x)
7    plt.plot(x,y,'b')7    plt.plot(x,y,'b')
8    plt.xlabel('x(radians)')8    plt.xlabel('x(radians)')
9    plt.ylabel('sin(x)')9    plt.ylabel('sin(x)')
10    plt.margins(0,0)10    plt.margins(0,0)
11    plt.savefig(filename)11    plt.savefig(filename)
12if __name__=='__main__':12if __name__=='__main__':
13    make_plot('my_plot.png')13    make_plot('my_plot.png')
14    if compare_plots('my_plot.png','instructors_plot.png'):14    if compare_plots('my_plot.png','instructors_plot.png'):
15        print('Success!')15        print('Success!')
16    else:16    else:
17        print('Keep trying.')17        print('Keep trying.')
18import matplotlib.pyplot as plt18import matplotlib.pyplot as plt
19from scipy.linalg import norm19from scipy.linalg import norm
20from scipy import sum,average20from scipy import sum,average
21def compare_plots(imagefile1,imagefile2):21def compare_plots(imagefile1,imagefile2):
22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
24    if img1.size!=img2.size:24    if img1.size!=img2.size:
25        return False25        return False
26    diff = img1 - img2  26    diff = img1 - img2  
27    nm = sum(abs(diff))  27    nm = sum(abs(diff))  
28    nz = norm(diff.ravel(), 0)  28    nz = norm(diff.ravel(), 0)  
29    return nm/img1.size < 1 and nz/img1.size < 129    return nm/img1.size < 1 and nz/img1.size < 1
30def to_grayscale(arr):30def to_grayscale(arr):
31    if len(arr.shape) == 3:31    if len(arr.shape) == 3:
32        return average(arr, -1)  32        return average(arr, -1)  
33    else:33    else:
34        return arr34        return arr
35def normalize(arr):35def normalize(arr):
36    rng = arr.max()-arr.min()36    rng = arr.max()-arr.min()
37    amin = arr.min()37    amin = arr.min()
38    return (arr-amin)*255/rngimport numpy as np38    return (arr-amin)*255/rngimport numpy as np
39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
40pctl = np.percentile(scores, np.arange(0,100,25))40pctl = np.percentile(scores, np.arange(0,100,25))
t41best_cultivar_indices = np.where(scores>= pctl[-1])t41best_cultivar_indices = np.where(scores>=pctl[-1])
42print(f'Cultivars with the following IDs are in the top quartile with a score of42print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
43best=cultivarIDs[best_cultivar_indices]43best=cultivarIDs[best_cultivar_indices]
44best.sort()44best.sort()
45print(', '.join([str(int(x)) for x in best]))45print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 23, P-Value: 5.29e-02

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
5    x = np.linspace(0, 4 * np.pi, 80)5    x = np.linspace(0, 4 * np.pi, 80)
6    y = np.sin(x)6    y = np.sin(x)
7    filename = plt.figure()7    filename = plt.figure()
8    ax = plt.axes()8    ax = plt.axes()
9    ax.plot(x, y, '-b')9    ax.plot(x, y, '-b')
10    ax.set_xlim(0, 4 * np.pi)10    ax.set_xlim(0, 4 * np.pi)
11    ax.set_ylim([-1, 1])11    ax.set_ylim([-1, 1])
12    ax.set_xlabel('x (radians)')12    ax.set_xlabel('x (radians)')
13    ax.set_ylabel('sin(x)')13    ax.set_ylabel('sin(x)')
14    plt.tight_layout()14    plt.tight_layout()
15    plt.savefig('student_plot_tmp.png')15    plt.savefig('student_plot_tmp.png')
16    return 'student_plot_tmp.png'16    return 'student_plot_tmp.png'
17if __name__=='__main__':17if __name__=='__main__':
18    make_plot('my_plot.png')18    make_plot('my_plot.png')
19    if compare_plots('my_plot.png','instructors_plot.png'):19    if compare_plots('my_plot.png','instructors_plot.png'):
20        print('Success!')20        print('Success!')
21    else:21    else:
22        print('Keep trying.')22        print('Keep trying.')
23import matplotlib.pyplot as plt23import matplotlib.pyplot as plt
24from scipy.linalg import norm24from scipy.linalg import norm
25from scipy import sum,average25from scipy import sum,average
26def compare_plots(imagefile1,imagefile2):26def compare_plots(imagefile1,imagefile2):
27    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))27    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
28    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))28    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
29    if img1.size!=img2.size:29    if img1.size!=img2.size:
30        return False30        return False
31    diff = img1 - img2  31    diff = img1 - img2  
32    nm = sum(abs(diff))  32    nm = sum(abs(diff))  
33    nz = norm(diff.ravel(), 0)  33    nz = norm(diff.ravel(), 0)  
34    return nm/img1.size < 1 and nz/img1.size < 134    return nm/img1.size < 1 and nz/img1.size < 1
35def to_grayscale(arr):35def to_grayscale(arr):
36    if len(arr.shape) == 3:36    if len(arr.shape) == 3:
37        return average(arr, -1)  37        return average(arr, -1)  
38    else:38    else:
39        return arr39        return arr
40def normalize(arr):40def normalize(arr):
41    rng = arr.max()-arr.min()41    rng = arr.max()-arr.min()
42    amin = arr.min()42    amin = arr.min()
43    return (arr-amin)*255/rngimport numpy as np43    return (arr-amin)*255/rngimport numpy as np
44cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='44cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
45pctl = np.percentile(scores,np.arange(0,100,25))45pctl = np.percentile(scores,np.arange(0,100,25))
46best_cultivar_indices = np.where(scores>pctl[-1])46best_cultivar_indices = np.where(scores>pctl[-1])
t47pctl = np.percentile(scores, np.arange(0,100,25))t
48best_cultivar_indices = np.where(scores >= pctl[-1])
49print(f'Cultivars with the following IDs are in the top quartile with a score of47print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
50best=cultivarIDs[best_cultivar_indices]48best=cultivarIDs[best_cultivar_indices]
51best.sort()49best.sort()
52print(', '.join([str(int(x)) for x in best]))50print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 384, P-Value: 5.61e-02

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
n5    x=np.linspace(0,np.pi *4,100)n5    x=np.linspace(0,np.pi*4,100)
6    y=np.sin(x)6    y=np.sin(x)
7    plt.plot(x,y,'b')7    plt.plot(x,y,'b')
8    plt.xlabel('x(radians)')8    plt.xlabel('x(radians)')
t9    plt.ylabel('sin(x)')t9    plt.ylabel("'sin(x)")
10    plt.margins(0,0)10    plt.margins(0,0)
11    plt.savefig(filename)11    plt.savefig(filename)
12if __name__=='__main__':12if __name__=='__main__':
13    make_plot('my_plot.png')13    make_plot('my_plot.png')
14    if compare_plots('my_plot.png','instructors_plot.png'):14    if compare_plots('my_plot.png','instructors_plot.png'):
15        print('Success!')15        print('Success!')
16    else:16    else:
17        print('Keep trying.')17        print('Keep trying.')
18import matplotlib.pyplot as plt18import matplotlib.pyplot as plt
19from scipy.linalg import norm19from scipy.linalg import norm
20from scipy import sum,average20from scipy import sum,average
21def compare_plots(imagefile1,imagefile2):21def compare_plots(imagefile1,imagefile2):
22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
24    if img1.size!=img2.size:24    if img1.size!=img2.size:
25        return False25        return False
26    diff = img1 - img2  26    diff = img1 - img2  
27    nm = sum(abs(diff))  27    nm = sum(abs(diff))  
28    nz = norm(diff.ravel(), 0)  28    nz = norm(diff.ravel(), 0)  
29    return nm/img1.size < 1 and nz/img1.size < 129    return nm/img1.size < 1 and nz/img1.size < 1
30def to_grayscale(arr):30def to_grayscale(arr):
31    if len(arr.shape) == 3:31    if len(arr.shape) == 3:
32        return average(arr, -1)  32        return average(arr, -1)  
33    else:33    else:
34        return arr34        return arr
35def normalize(arr):35def normalize(arr):
36    rng = arr.max()-arr.min()36    rng = arr.max()-arr.min()
37    amin = arr.min()37    amin = arr.min()
38    return (arr-amin)*255/rngimport numpy as np38    return (arr-amin)*255/rngimport numpy as np
39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
40quartile_boundaries = np.percentile(scores,np.arange(0,100,25))40quartile_boundaries = np.percentile(scores,np.arange(0,100,25))
41top_indices, = np.where(scores>quartile_boundaries[-1])41top_indices, = np.where(scores>quartile_boundaries[-1])
42print(f'Cultivars with the following IDs are in the top quartile with a score of42print(f'Cultivars with the following IDs are in the top quartile with a score of
> {quartile_boundaries[-1]} or better:')> {quartile_boundaries[-1]} or better:')
43best=cultivarIDs[top_indices]43best=cultivarIDs[top_indices]
44best.sort()44best.sort()
45print(', '.join([str(int(x)) for x in best]))45print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 7, P-Value: 5.61e-02

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
n5    x=np.linspace(0,np.pi*4,100)n5    x=np.linspace(0,np.pi *4,100)
6    y=np.sin(x)6    y=np.sin(x)
7    plt.plot(x,y,'b')7    plt.plot(x,y,'b')
8    plt.xlabel('x(radians)')8    plt.xlabel('x(radians)')
t9    plt.ylabel("'sin(x)")t9    plt.ylabel('sin(x)')
10    plt.margins(0,0)10    plt.margins(0,0)
11    plt.savefig(filename)11    plt.savefig(filename)
12if __name__=='__main__':12if __name__=='__main__':
13    make_plot('my_plot.png')13    make_plot('my_plot.png')
14    if compare_plots('my_plot.png','instructors_plot.png'):14    if compare_plots('my_plot.png','instructors_plot.png'):
15        print('Success!')15        print('Success!')
16    else:16    else:
17        print('Keep trying.')17        print('Keep trying.')
18import matplotlib.pyplot as plt18import matplotlib.pyplot as plt
19from scipy.linalg import norm19from scipy.linalg import norm
20from scipy import sum,average20from scipy import sum,average
21def compare_plots(imagefile1,imagefile2):21def compare_plots(imagefile1,imagefile2):
22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
24    if img1.size!=img2.size:24    if img1.size!=img2.size:
25        return False25        return False
26    diff = img1 - img2  26    diff = img1 - img2  
27    nm = sum(abs(diff))  27    nm = sum(abs(diff))  
28    nz = norm(diff.ravel(), 0)  28    nz = norm(diff.ravel(), 0)  
29    return nm/img1.size < 1 and nz/img1.size < 129    return nm/img1.size < 1 and nz/img1.size < 1
30def to_grayscale(arr):30def to_grayscale(arr):
31    if len(arr.shape) == 3:31    if len(arr.shape) == 3:
32        return average(arr, -1)  32        return average(arr, -1)  
33    else:33    else:
34        return arr34        return arr
35def normalize(arr):35def normalize(arr):
36    rng = arr.max()-arr.min()36    rng = arr.max()-arr.min()
37    amin = arr.min()37    amin = arr.min()
38    return (arr-amin)*255/rngimport numpy as np38    return (arr-amin)*255/rngimport numpy as np
39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
40quartile_boundaries = np.percentile(scores,np.arange(0,100,25))40quartile_boundaries = np.percentile(scores,np.arange(0,100,25))
41top_indices, = np.where(scores>quartile_boundaries[-1])41top_indices, = np.where(scores>quartile_boundaries[-1])
42print(f'Cultivars with the following IDs are in the top quartile with a score of42print(f'Cultivars with the following IDs are in the top quartile with a score of
> {quartile_boundaries[-1]} or better:')> {quartile_boundaries[-1]} or better:')
43best=cultivarIDs[top_indices]43best=cultivarIDs[top_indices]
44best.sort()44best.sort()
45print(', '.join([str(int(x)) for x in best]))45print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 464, P-Value: 6.44e-02

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
5    x = np.linspace(0,np.pi * 4,100)5    x = np.linspace(0,np.pi * 4,100)
6    y = np.sin(x)6    y = np.sin(x)
7    plt.plot(x,y,'b')7    plt.plot(x,y,'b')
8    plt.xlabel('x(radians)')8    plt.xlabel('x(radians)')
9    plt.ylabel('sin(x)')9    plt.ylabel('sin(x)')
10    plt.margins(0,0)10    plt.margins(0,0)
11    plt.savefig(filename)11    plt.savefig(filename)
12if __name__=='__main__':12if __name__=='__main__':
13    make_plot('my_plot.png')13    make_plot('my_plot.png')
14    if compare_plots('my_plot.png','instructors_plot.png'):14    if compare_plots('my_plot.png','instructors_plot.png'):
15        print('Success!')15        print('Success!')
16    else:16    else:
17        print('Keep trying.')17        print('Keep trying.')
18import matplotlib.pyplot as plt18import matplotlib.pyplot as plt
19from scipy.linalg import norm19from scipy.linalg import norm
20from scipy import sum,average20from scipy import sum,average
21def compare_plots(imagefile1,imagefile2):21def compare_plots(imagefile1,imagefile2):
22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
24    if img1.size!=img2.size:24    if img1.size!=img2.size:
25        return False25        return False
26    diff = img1 - img2  26    diff = img1 - img2  
27    nm = sum(abs(diff))  27    nm = sum(abs(diff))  
28    nz = norm(diff.ravel(), 0)  28    nz = norm(diff.ravel(), 0)  
29    return nm/img1.size < 1 and nz/img1.size < 129    return nm/img1.size < 1 and nz/img1.size < 1
30def to_grayscale(arr):30def to_grayscale(arr):
31    if len(arr.shape) == 3:31    if len(arr.shape) == 3:
32        return average(arr, -1)  32        return average(arr, -1)  
33    else:33    else:
34        return arr34        return arr
35def normalize(arr):35def normalize(arr):
36    rng = arr.max()-arr.min()36    rng = arr.max()-arr.min()
37    amin = arr.min()37    amin = arr.min()
38    return (arr-amin)*255/rngimport numpy as np38    return (arr-amin)*255/rngimport numpy as np
39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
t40pctl=np.percentile(scores,np.arange(0,100,25))t40pctl = np.percentile(scores, np.arange(0,100,25))
41best_cultivar_indices=np.where(scores>=pctl[-1])41best_cultivar_indices = np.where(scores>=pctl[-1])
42print(f'Cultivars with the following IDs are in the top quartile with a score of42print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
43best=cultivarIDs[best_cultivar_indices]43best=cultivarIDs[best_cultivar_indices]
44best.sort()44best.sort()
45print(', '.join([str(int(x)) for x in best]))45print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 166, P-Value: 6.94e-02

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
n5    x=np.linspace(0,4*np.pi,80)n5    x = np.linspace(0,4*np.pi,80)
6    y =np.sin(x)6    y = np.sin(x)
7    plt.plot(x,y,'-b', )
7    plt.xlabel('x(radians)')8    plt.xlabel('x (radians)')
8    plt.ylabel('sin(x)')9    plt.ylabel('sin(x)')
nn10    plt.xlim([0,4*np.pi])
9    plt.ylim([-1,1])11    plt.ylim([-1,1])
t10    plt.xlim([0,4*np.pi])t
11    plt.plot(x,y,'-b')
12    plt.savefig(filename)12    plt.savefig(filename)
13if __name__=='__main__':13if __name__=='__main__':
14    make_plot('my_plot.png')14    make_plot('my_plot.png')
15    if compare_plots('my_plot.png','instructors_plot.png'):15    if compare_plots('my_plot.png','instructors_plot.png'):
16        print('Success!')16        print('Success!')
17    else:17    else:
18        print('Keep trying.')18        print('Keep trying.')
19import matplotlib.pyplot as plt19import matplotlib.pyplot as plt
20from scipy.linalg import norm20from scipy.linalg import norm
21from scipy import sum,average21from scipy import sum,average
22def compare_plots(imagefile1,imagefile2):22def compare_plots(imagefile1,imagefile2):
23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
25    if img1.size!=img2.size:25    if img1.size!=img2.size:
26        return False26        return False
27    diff = img1 - img2  27    diff = img1 - img2  
28    nm = sum(abs(diff))  28    nm = sum(abs(diff))  
29    nz = norm(diff.ravel(), 0)  29    nz = norm(diff.ravel(), 0)  
30    return nm/img1.size < 1 and nz/img1.size < 130    return nm/img1.size < 1 and nz/img1.size < 1
31def to_grayscale(arr):31def to_grayscale(arr):
32    if len(arr.shape) == 3:32    if len(arr.shape) == 3:
33        return average(arr, -1)  33        return average(arr, -1)  
34    else:34    else:
35        return arr35        return arr
36def normalize(arr):36def normalize(arr):
37    rng = arr.max()-arr.min()37    rng = arr.max()-arr.min()
38    amin = arr.min()38    amin = arr.min()
39    return (arr-amin)*255/rngimport numpy as np39    return (arr-amin)*255/rngimport numpy as np
40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
41pctl = np.percentile(scores, np.arange(0,100,25))41pctl = np.percentile(scores, np.arange(0,100,25))
42best_cultivar_indices = np.where(scores >= pctl[-1])42best_cultivar_indices = np.where(scores >= pctl[-1])
43print(f'Cultivars with the following IDs are in the top quartile with a score of43print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
44best=cultivarIDs[best_cultivar_indices]44best=cultivarIDs[best_cultivar_indices]
45best.sort()45best.sort()
46print(', '.join([str(int(x)) for x in best]))46print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 53, P-Value: 7.12e-02

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3def make_plot(filename):3def make_plot(filename):
4        x = np.linspace(0,np.pi * 4,100)4        x = np.linspace(0,np.pi * 4,100)
5        y = np.sin(x)5        y = np.sin(x)
6        plt.plot(x,y,'b')6        plt.plot(x,y,'b')
7        plt.xlabel('x(radians)')7        plt.xlabel('x(radians)')
8        plt.ylabel('sin(x)')8        plt.ylabel('sin(x)')
9        plt.margins(0,0)9        plt.margins(0,0)
10        plt.savefig(filename) 10        plt.savefig(filename) 
11if __name__=='__main__':11if __name__=='__main__':
12        make_plot('my_plot.png')12        make_plot('my_plot.png')
13import matplotlib.pyplot as plt13import matplotlib.pyplot as plt
14from scipy.linalg import norm14from scipy.linalg import norm
15from scipy import sum,average15from scipy import sum,average
16def compare_plots(imagefile1,imagefile2):16def compare_plots(imagefile1,imagefile2):
17    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))17    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
18    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))18    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
19    if img1.size!=img2.size:19    if img1.size!=img2.size:
20        return False20        return False
21    diff = img1 - img2  21    diff = img1 - img2  
22    nm = sum(abs(diff))  22    nm = sum(abs(diff))  
23    nz = norm(diff.ravel(), 0)  23    nz = norm(diff.ravel(), 0)  
24    return nm/img1.size < 1 and nz/img1.size < 124    return nm/img1.size < 1 and nz/img1.size < 1
25def to_grayscale(arr):25def to_grayscale(arr):
26    if len(arr.shape) == 3:26    if len(arr.shape) == 3:
27        return average(arr, -1)  27        return average(arr, -1)  
28    else:28    else:
29        return arr29        return arr
30def normalize(arr):30def normalize(arr):
31    rng = arr.max()-arr.min()31    rng = arr.max()-arr.min()
32    amin = arr.min()32    amin = arr.min()
33    return (arr-amin)*255/rngimport numpy as np33    return (arr-amin)*255/rngimport numpy as np
34cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='34cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
t35quartile_boundaries = np.percentile(scores, np.arange(0,100,25))t35pctl = np.percentile(scores,np.arange(0,100,25))
36bestindices = np.where(scores >= quartile_boundaries[-1])36best_cultivar_indices = np.where(scores >= pctl[-1])
37print(f'Cultivars with the following IDs are in the top quartile with a score of37print(f'Cultivars with the following IDs are in the top quartile with a score of
> {quartile_boundaries[-1]} or better:')> {pctl[-1]} or better:')
38best=cultivarIDs[bestindices]38best=cultivarIDs[best_cultivar_indices]
39best.sort()39best.sort()
40print(', '.join([str(int(x)) for x in best]))40print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 444, P-Value: 7.46e-02

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
n5    x = np.arange(0,4 *np.pi,0.01)n5    x = np.arange(0,4*np.pi,0.01) 
6    y = np.sin(x)6    y = np.sin(x) 
7    plt.plot(x,y)7    plt.plot(x,y, 'b-') 
8    plt.ylim([-1,1])
9    plt.xlabel('x (radians)')8    plt.xlabel('x (radians)')
10    plt.ylabel('sin(x)')9    plt.ylabel('sin(x)')
t11    plt.xlim([0,4*np.pi])t10    plt.xlim([0,4*np.pi]) 
11    plt.ylim(-1,1) 
12    plt.savefig(filename)12    plt.savefig(filename)
13if __name__=='__main__':13if __name__=='__main__':
14    make_plot('my_plot.png')14    make_plot('my_plot.png')
15    if compare_plots('my_plot.png','instructors_plot.png'):15    if compare_plots('my_plot.png','instructors_plot.png'):
16        print('Success!')16        print('Success!')
17    else:17    else:
18        print('Keep trying.')18        print('Keep trying.')
19import matplotlib.pyplot as plt19import matplotlib.pyplot as plt
20from scipy.linalg import norm20from scipy.linalg import norm
21from scipy import sum,average21from scipy import sum,average
22def compare_plots(imagefile1,imagefile2):22def compare_plots(imagefile1,imagefile2):
23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
25    if img1.size!=img2.size:25    if img1.size!=img2.size:
26        return False26        return False
27    diff = img1 - img2  27    diff = img1 - img2  
28    nm = sum(abs(diff))  28    nm = sum(abs(diff))  
29    nz = norm(diff.ravel(), 0)  29    nz = norm(diff.ravel(), 0)  
30    return nm/img1.size < 1 and nz/img1.size < 130    return nm/img1.size < 1 and nz/img1.size < 1
31def to_grayscale(arr):31def to_grayscale(arr):
32    if len(arr.shape) == 3:32    if len(arr.shape) == 3:
33        return average(arr, -1)  33        return average(arr, -1)  
34    else:34    else:
35        return arr35        return arr
36def normalize(arr):36def normalize(arr):
37    rng = arr.max()-arr.min()37    rng = arr.max()-arr.min()
38    amin = arr.min()38    amin = arr.min()
39    return (arr-amin)*255/rngimport numpy as np39    return (arr-amin)*255/rngimport numpy as np
40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
41pctl = np.percentile(scores,np.arange(0,100,25))41pctl = np.percentile(scores,np.arange(0,100,25))
42best_cultivar_indices, = np.where(scores>pctl[-1])42best_cultivar_indices, = np.where(scores>pctl[-1])
43print(f'Cultivars with the following IDs are in the top quartile with a score of43print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
44best=cultivarIDs[best_cultivar_indices]44best=cultivarIDs[best_cultivar_indices]
45best.sort()45best.sort()
46print(', '.join([str(int(x)) for x in best]))46print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 249, P-Value: 7.46e-02

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
n5    x = np.arange(0,4*np.pi,0.01) n5    x = np.arange(0,4 *np.pi,0.01)
6    y = np.sin(x) 6    y = np.sin(x)
7    plt.plot(x,y, 'b-') 7    plt.plot(x,y)
8    plt.ylim([-1,1])
8    plt.xlabel('x (radians)')9    plt.xlabel('x (radians)')
9    plt.ylabel('sin(x)')10    plt.ylabel('sin(x)')
t10    plt.xlim([0,4*np.pi]) t11    plt.xlim([0,4*np.pi])
11    plt.ylim(-1,1) 
12    plt.savefig(filename)12    plt.savefig(filename)
13if __name__=='__main__':13if __name__=='__main__':
14    make_plot('my_plot.png')14    make_plot('my_plot.png')
15    if compare_plots('my_plot.png','instructors_plot.png'):15    if compare_plots('my_plot.png','instructors_plot.png'):
16        print('Success!')16        print('Success!')
17    else:17    else:
18        print('Keep trying.')18        print('Keep trying.')
19import matplotlib.pyplot as plt19import matplotlib.pyplot as plt
20from scipy.linalg import norm20from scipy.linalg import norm
21from scipy import sum,average21from scipy import sum,average
22def compare_plots(imagefile1,imagefile2):22def compare_plots(imagefile1,imagefile2):
23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
25    if img1.size!=img2.size:25    if img1.size!=img2.size:
26        return False26        return False
27    diff = img1 - img2  27    diff = img1 - img2  
28    nm = sum(abs(diff))  28    nm = sum(abs(diff))  
29    nz = norm(diff.ravel(), 0)  29    nz = norm(diff.ravel(), 0)  
30    return nm/img1.size < 1 and nz/img1.size < 130    return nm/img1.size < 1 and nz/img1.size < 1
31def to_grayscale(arr):31def to_grayscale(arr):
32    if len(arr.shape) == 3:32    if len(arr.shape) == 3:
33        return average(arr, -1)  33        return average(arr, -1)  
34    else:34    else:
35        return arr35        return arr
36def normalize(arr):36def normalize(arr):
37    rng = arr.max()-arr.min()37    rng = arr.max()-arr.min()
38    amin = arr.min()38    amin = arr.min()
39    return (arr-amin)*255/rngimport numpy as np39    return (arr-amin)*255/rngimport numpy as np
40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
41pctl = np.percentile(scores,np.arange(0,100,25))41pctl = np.percentile(scores,np.arange(0,100,25))
42best_cultivar_indices, = np.where(scores>pctl[-1])42best_cultivar_indices, = np.where(scores>pctl[-1])
43print(f'Cultivars with the following IDs are in the top quartile with a score of43print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
44best=cultivarIDs[best_cultivar_indices]44best=cultivarIDs[best_cultivar_indices]
45best.sort()45best.sort()
46print(', '.join([str(int(x)) for x in best]))46print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 8, P-Value: 7.68e-02

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3import math3import math
4from compare_plots import compare_plots4from compare_plots import compare_plots
5def make_plot(filename):5def make_plot(filename):
n6    x = np.arange(0,4*math.pi, 0.01)n6    x = np.arange(0,4*math.pi,0.008)
7    y = np.sin(x)7    y = np.sin(x)
8    plt.xlim([0,4*math.pi])8    plt.xlim([0,4*math.pi])
9    plt.ylim(-1,1)9    plt.ylim(-1,1)
10    plt.plot(x,y,'-b')10    plt.plot(x,y,'-b')
11    plt.xlabel('x (radians)')11    plt.xlabel('x (radians)')
12    plt.ylabel('sin(x)')12    plt.ylabel('sin(x)')
13    plt.savefig(filename)13    plt.savefig(filename)
14    plt.show()14    plt.show()
15if __name__=='__main__':15if __name__=='__main__':
16    make_plot('my_plot.png')16    make_plot('my_plot.png')
17    if compare_plots('my_plot.png','instructors_plot.png'):17    if compare_plots('my_plot.png','instructors_plot.png'):
18        print('Success!')18        print('Success!')
19    else:19    else:
20        print('Keep trying.')20        print('Keep trying.')
21import matplotlib.pyplot as plt21import matplotlib.pyplot as plt
22from scipy.linalg import norm22from scipy.linalg import norm
23from scipy import sum,average23from scipy import sum,average
24def compare_plots(imagefile1,imagefile2):24def compare_plots(imagefile1,imagefile2):
25    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))25    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
26    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))26    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
27    if img1.size!=img2.size:27    if img1.size!=img2.size:
28        return False28        return False
29    diff = img1 - img2  29    diff = img1 - img2  
30    nm = sum(abs(diff))  30    nm = sum(abs(diff))  
31    nz = norm(diff.ravel(), 0)  31    nz = norm(diff.ravel(), 0)  
32    return nm/img1.size < 1 and nz/img1.size < 132    return nm/img1.size < 1 and nz/img1.size < 1
33def to_grayscale(arr):33def to_grayscale(arr):
34    if len(arr.shape) == 3:34    if len(arr.shape) == 3:
35        return average(arr, -1)  35        return average(arr, -1)  
36    else:36    else:
37        return arr37        return arr
38def normalize(arr):38def normalize(arr):
39    rng = arr.max()-arr.min()39    rng = arr.max()-arr.min()
40    amin = arr.min()40    amin = arr.min()
41    return (arr-amin)*255/rngimport numpy as np41    return (arr-amin)*255/rngimport numpy as np
42cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='42cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
43quartile_boundaries = np.percentile(scores,np.arange(0,100,25))43quartile_boundaries = np.percentile(scores,np.arange(0,100,25))
t44top_indices = np.where(scores>quartile_boundaries[-1])t44top_indices, = np.where(scores>quartile_boundaries[-1])
45print(f'Cultivars with the following IDs are in the top quartile with a score of45print(f'Cultivars with the following IDs are in the top quartile with a score of
> {quartile_boundaries[-1]} or better:')> {quartile_boundaries[-1]} or better:')
46best=cultivarIDs[top_indices]46best=cultivarIDs[top_indices]
47best.sort()47best.sort()
48print(', '.join([str(int(x)) for x in best]))48print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 325, P-Value: 7.68e-02

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3import math3import math
4from compare_plots import compare_plots4from compare_plots import compare_plots
5def make_plot(filename):5def make_plot(filename):
n6    x = np.arange(0,4*math.pi,0.008)n6    x = np.arange(0,4*math.pi, 0.01)
7    y = np.sin(x)7    y = np.sin(x)
8    plt.xlim([0,4*math.pi])8    plt.xlim([0,4*math.pi])
9    plt.ylim(-1,1)9    plt.ylim(-1,1)
10    plt.plot(x,y,'-b')10    plt.plot(x,y,'-b')
11    plt.xlabel('x (radians)')11    plt.xlabel('x (radians)')
12    plt.ylabel('sin(x)')12    plt.ylabel('sin(x)')
13    plt.savefig(filename)13    plt.savefig(filename)
14    plt.show()14    plt.show()
15if __name__=='__main__':15if __name__=='__main__':
16    make_plot('my_plot.png')16    make_plot('my_plot.png')
17    if compare_plots('my_plot.png','instructors_plot.png'):17    if compare_plots('my_plot.png','instructors_plot.png'):
18        print('Success!')18        print('Success!')
19    else:19    else:
20        print('Keep trying.')20        print('Keep trying.')
21import matplotlib.pyplot as plt21import matplotlib.pyplot as plt
22from scipy.linalg import norm22from scipy.linalg import norm
23from scipy import sum,average23from scipy import sum,average
24def compare_plots(imagefile1,imagefile2):24def compare_plots(imagefile1,imagefile2):
25    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))25    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
26    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))26    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
27    if img1.size!=img2.size:27    if img1.size!=img2.size:
28        return False28        return False
29    diff = img1 - img2  29    diff = img1 - img2  
30    nm = sum(abs(diff))  30    nm = sum(abs(diff))  
31    nz = norm(diff.ravel(), 0)  31    nz = norm(diff.ravel(), 0)  
32    return nm/img1.size < 1 and nz/img1.size < 132    return nm/img1.size < 1 and nz/img1.size < 1
33def to_grayscale(arr):33def to_grayscale(arr):
34    if len(arr.shape) == 3:34    if len(arr.shape) == 3:
35        return average(arr, -1)  35        return average(arr, -1)  
36    else:36    else:
37        return arr37        return arr
38def normalize(arr):38def normalize(arr):
39    rng = arr.max()-arr.min()39    rng = arr.max()-arr.min()
40    amin = arr.min()40    amin = arr.min()
41    return (arr-amin)*255/rngimport numpy as np41    return (arr-amin)*255/rngimport numpy as np
42cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='42cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
43quartile_boundaries = np.percentile(scores,np.arange(0,100,25))43quartile_boundaries = np.percentile(scores,np.arange(0,100,25))
t44top_indices, = np.where(scores>quartile_boundaries[-1])t44top_indices = np.where(scores>quartile_boundaries[-1])
45print(f'Cultivars with the following IDs are in the top quartile with a score of45print(f'Cultivars with the following IDs are in the top quartile with a score of
> {quartile_boundaries[-1]} or better:')> {quartile_boundaries[-1]} or better:')
46best=cultivarIDs[top_indices]46best=cultivarIDs[top_indices]
47best.sort()47best.sort()
48print(', '.join([str(int(x)) for x in best]))48print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 59, P-Value: 8.35e-02

Student (left) and Nearest Neighbor (right).


nn1import math
1import matplotlib.pyplot as plt2import matplotlib.pyplot as plt
2import numpy as np3import numpy as np
3from compare_plots import compare_plots4from compare_plots import compare_plots
t4import math t
5def make_plot(filename):5def make_plot(filename):
6    x=np.linspace(0,4*np.pi,80)6    x=np.linspace(0,4*np.pi,80)
7    plt.plot(x,np.sin(x),'-b')7    plt.plot(x,np.sin(x),'-b')
8    plt.xlim([0,4*np.pi])8    plt.xlim([0,4*np.pi])
9    plt.ylim([-1,1])9    plt.ylim([-1,1])
10    plt.xlabel('x (radians)')10    plt.xlabel('x (radians)')
11    plt.ylabel('sin(x)')11    plt.ylabel('sin(x)')
12    plt.savefig(filename)12    plt.savefig(filename)
13if __name__=='__main__':13if __name__=='__main__':
14    make_plot('my_plot.png')14    make_plot('my_plot.png')
15    if compare_plots('my_plot.png','instructors_plot.png'):15    if compare_plots('my_plot.png','instructors_plot.png'):
16        print('Success!')16        print('Success!')
17    else:17    else:
18        print('Keep trying.')18        print('Keep trying.')
19import matplotlib.pyplot as plt19import matplotlib.pyplot as plt
20from scipy.linalg import norm20from scipy.linalg import norm
21from scipy import sum,average21from scipy import sum,average
22def compare_plots(imagefile1,imagefile2):22def compare_plots(imagefile1,imagefile2):
23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
25    if img1.size!=img2.size:25    if img1.size!=img2.size:
26        return False26        return False
27    diff = img1 - img2  27    diff = img1 - img2  
28    nm = sum(abs(diff))  28    nm = sum(abs(diff))  
29    nz = norm(diff.ravel(), 0)  29    nz = norm(diff.ravel(), 0)  
30    return nm/img1.size < 1 and nz/img1.size < 130    return nm/img1.size < 1 and nz/img1.size < 1
31def to_grayscale(arr):31def to_grayscale(arr):
32    if len(arr.shape) == 3:32    if len(arr.shape) == 3:
33        return average(arr, -1)  33        return average(arr, -1)  
34    else:34    else:
35        return arr35        return arr
36def normalize(arr):36def normalize(arr):
37    rng = arr.max()-arr.min()37    rng = arr.max()-arr.min()
38    amin = arr.min()38    amin = arr.min()
39    return (arr-amin)*255/rngimport numpy as np39    return (arr-amin)*255/rngimport numpy as np
40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
41pctl = np.percentile(scores, np.arange(0,100,25))41pctl = np.percentile(scores, np.arange(0,100,25))
42best_cultivar_indices = np.where(scores >= pctl[-1])42best_cultivar_indices = np.where(scores >= pctl[-1])
43print(f'Cultivars with the following IDs are in the top quartile with a score of43print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
44best=cultivarIDs[best_cultivar_indices]44best=cultivarIDs[best_cultivar_indices]
45best.sort()45best.sort()
46print(', '.join([str(int(x)) for x in best]))46print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 433, P-Value: 8.59e-02

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
n5    x = np.linspace(0,4*np.pi,num=80)n5    x = np.linspace(0,4*np.pi,80)
6    y = np.sin(x)6    y = np.sin(x)
n7    plt.plot(x, y,'-b')n7    plt.plot(x,y,'-b')
8    plt.xlabel('x (radians)')
9    plt.ylabel('sin(x)')
8    plt.xlim([0,4*np.pi])10    plt.xlim([0,4*np.pi])
9    plt.ylim([-1,1])11    plt.ylim([-1,1])
n10    plt.xlabel('x (radians)')n
11    plt.ylabel('sin(x)')
12    plt.savefig(filename)12    plt.savefig(filename)
13if __name__=='__main__':13if __name__=='__main__':
14    make_plot('my_plot.png')14    make_plot('my_plot.png')
15    if compare_plots('my_plot.png','instructors_plot.png'):15    if compare_plots('my_plot.png','instructors_plot.png'):
16        print('Success!')16        print('Success!')
17    else:17    else:
18        print('Keep trying.')18        print('Keep trying.')
19import matplotlib.pyplot as plt19import matplotlib.pyplot as plt
20from scipy.linalg import norm20from scipy.linalg import norm
21from scipy import sum,average21from scipy import sum,average
22def compare_plots(imagefile1,imagefile2):22def compare_plots(imagefile1,imagefile2):
23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
25    if img1.size!=img2.size:25    if img1.size!=img2.size:
26        return False26        return False
27    diff = img1 - img2  27    diff = img1 - img2  
28    nm = sum(abs(diff))  28    nm = sum(abs(diff))  
29    nz = norm(diff.ravel(), 0)  29    nz = norm(diff.ravel(), 0)  
30    return nm/img1.size < 1 and nz/img1.size < 130    return nm/img1.size < 1 and nz/img1.size < 1
31def to_grayscale(arr):31def to_grayscale(arr):
32    if len(arr.shape) == 3:32    if len(arr.shape) == 3:
33        return average(arr, -1)  33        return average(arr, -1)  
34    else:34    else:
35        return arr35        return arr
36def normalize(arr):36def normalize(arr):
37    rng = arr.max()-arr.min()37    rng = arr.max()-arr.min()
38    amin = arr.min()38    amin = arr.min()
39    return (arr-amin)*255/rngimport numpy as np39    return (arr-amin)*255/rngimport numpy as np
40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
t41pctl = np.percentile(scores,np.arange(0,100,25))t41pctl = np.percentile(scores, np.arange(0,100,25))
42best_cultivar_indices = np.where(scores> pctl[-1])42best_cultivar_indices = np.where(scores >= pctl[-1])
43print(f'Cultivars with the following IDs are in the top quartile with a score of43print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
44best=cultivarIDs[best_cultivar_indices]44best=cultivarIDs[best_cultivar_indices]
45best.sort()45best.sort()
46print(', '.join([str(int(x)) for x in best]))46print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 122, P-Value: 8.94e-02

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
5    x = np.arange(0,4 *np.pi,0.01)5    x = np.arange(0,4 *np.pi,0.01)
n6    f=np.sin(x) n6    = np.sin(x)
7    plt.plot(x,f) 7    plt.plot(x,y)
8    plt.ylim([-1,1])
8    plt.xlabel('x (radians)')9    plt.xlabel('x (radians)')
9    plt.ylabel('sin(x)')10    plt.ylabel('sin(x)')
n10    plt.ylim([-1,1])n
11    plt.xlim([0,4 *np.pi])11    plt.xlim([0,4*np.pi])
12    plt.savefig(filename)12    plt.savefig(filename)
13if __name__=='__main__':13if __name__=='__main__':
14    make_plot('my_plot.png')14    make_plot('my_plot.png')
15    if compare_plots('my_plot.png','instructors_plot.png'):15    if compare_plots('my_plot.png','instructors_plot.png'):
16        print('Success!')16        print('Success!')
17    else:17    else:
18        print('Keep trying.')18        print('Keep trying.')
19import matplotlib.pyplot as plt19import matplotlib.pyplot as plt
20from scipy.linalg import norm20from scipy.linalg import norm
21from scipy import sum,average21from scipy import sum,average
22def compare_plots(imagefile1,imagefile2):22def compare_plots(imagefile1,imagefile2):
23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
25    if img1.size!=img2.size:25    if img1.size!=img2.size:
26        return False26        return False
27    diff = img1 - img2  27    diff = img1 - img2  
28    nm = sum(abs(diff))  28    nm = sum(abs(diff))  
29    nz = norm(diff.ravel(), 0)  29    nz = norm(diff.ravel(), 0)  
30    return nm/img1.size < 1 and nz/img1.size < 130    return nm/img1.size < 1 and nz/img1.size < 1
31def to_grayscale(arr):31def to_grayscale(arr):
32    if len(arr.shape) == 3:32    if len(arr.shape) == 3:
33        return average(arr, -1)  33        return average(arr, -1)  
34    else:34    else:
35        return arr35        return arr
36def normalize(arr):36def normalize(arr):
37    rng = arr.max()-arr.min()37    rng = arr.max()-arr.min()
38    amin = arr.min()38    amin = arr.min()
39    return (arr-amin)*255/rngimport numpy as np39    return (arr-amin)*255/rngimport numpy as np
40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
41pctl = np.percentile(scores,np.arange(0,100,25))41pctl = np.percentile(scores,np.arange(0,100,25))
t42best_cultivar_indices = np.where(scores>pctl[-1])t42best_cultivar_indices, = np.where(scores>pctl[-1])
43print(f'Cultivars with the following IDs are in the top quartile with a score of43print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
44best=cultivarIDs[best_cultivar_indices]44best=cultivarIDs[best_cultivar_indices]
45best.sort()45best.sort()
46print(', '.join([str(int(x)) for x in best]))46print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 410, P-Value: 8.94e-02

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
n5    x = np.arange(0,4*np.pi,0.1)n5    x = np.arange(0,4 *np.pi,0.01)
6    wave = np.sin(x)6    y = np.sin(x)
7    plt.plot(x,wave)7    plt.plot(x,y)
8    plt.xlim([0,4*np.pi])
9    plt.ylim([-1,1])8    plt.ylim([-1,1])
10    plt.xlabel('x (radians)')9    plt.xlabel('x (radians)')
11    plt.ylabel('sin(x)')10    plt.ylabel('sin(x)')
nn11    plt.xlim([0,4*np.pi])
12    plt.savefig(filename)12    plt.savefig(filename)
13if __name__=='__main__':13if __name__=='__main__':
14    make_plot('my_plot.png')14    make_plot('my_plot.png')
15    if compare_plots('my_plot.png','instructors_plot.png'):15    if compare_plots('my_plot.png','instructors_plot.png'):
16        print('Success!')16        print('Success!')
17    else:17    else:
18        print('Keep trying.')18        print('Keep trying.')
19import matplotlib.pyplot as plt19import matplotlib.pyplot as plt
20from scipy.linalg import norm20from scipy.linalg import norm
21from scipy import sum,average21from scipy import sum,average
22def compare_plots(imagefile1,imagefile2):22def compare_plots(imagefile1,imagefile2):
23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
25    if img1.size!=img2.size:25    if img1.size!=img2.size:
26        return False26        return False
27    diff = img1 - img2  27    diff = img1 - img2  
28    nm = sum(abs(diff))  28    nm = sum(abs(diff))  
29    nz = norm(diff.ravel(), 0)  29    nz = norm(diff.ravel(), 0)  
30    return nm/img1.size < 1 and nz/img1.size < 130    return nm/img1.size < 1 and nz/img1.size < 1
31def to_grayscale(arr):31def to_grayscale(arr):
32    if len(arr.shape) == 3:32    if len(arr.shape) == 3:
33        return average(arr, -1)  33        return average(arr, -1)  
34    else:34    else:
35        return arr35        return arr
36def normalize(arr):36def normalize(arr):
37    rng = arr.max()-arr.min()37    rng = arr.max()-arr.min()
38    amin = arr.min()38    amin = arr.min()
39    return (arr-amin)*255/rngimport numpy as np39    return (arr-amin)*255/rngimport numpy as np
40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
t41pctl = np.percentile(scores, np.arange(0,100,25))t41pctl = np.percentile(scores,np.arange(0,100,25))
42best_cultivar_indices = np.where(scores>pctl[-1])42best_cultivar_indices, = np.where(scores>pctl[-1])
43print(f'Cultivars with the following IDs are in the top quartile with a score of43print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
44best=cultivarIDs[best_cultivar_indices]44best=cultivarIDs[best_cultivar_indices]
45best.sort()45best.sort()
46print(', '.join([str(int(x)) for x in best]))46print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 425, P-Value: 9.19e-02

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
n5    x=np.linspace(0,np.pi*4,80)n5    x = np.linspace(0,np.pi * 4,100)
6    y=np.sin(x)6    y = np.sin(x)
7    plt.plot(x,y,'b')7    plt.plot(x,y,'b')
8    plt.xlabel('x(radians)')8    plt.xlabel('x(radians)')
9    plt.ylabel('sin(x)')9    plt.ylabel('sin(x)')
10    plt.margins(0,0)10    plt.margins(0,0)
11    plt.savefig(filename)11    plt.savefig(filename)
12if __name__=='__main__':12if __name__=='__main__':
13    make_plot('my_plot.png')13    make_plot('my_plot.png')
14    if compare_plots('my_plot.png','instructors_plot.png'):14    if compare_plots('my_plot.png','instructors_plot.png'):
15        print('Success!')15        print('Success!')
16    else:16    else:
17        print('Keep trying.')17        print('Keep trying.')
18import matplotlib.pyplot as plt18import matplotlib.pyplot as plt
19from scipy.linalg import norm19from scipy.linalg import norm
20from scipy import sum,average20from scipy import sum,average
21def compare_plots(imagefile1,imagefile2):21def compare_plots(imagefile1,imagefile2):
22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
24    if img1.size!=img2.size:24    if img1.size!=img2.size:
25        return False25        return False
26    diff = img1 - img2  26    diff = img1 - img2  
27    nm = sum(abs(diff))  27    nm = sum(abs(diff))  
28    nz = norm(diff.ravel(), 0)  28    nz = norm(diff.ravel(), 0)  
29    return nm/img1.size < 1 and nz/img1.size < 129    return nm/img1.size < 1 and nz/img1.size < 1
30def to_grayscale(arr):30def to_grayscale(arr):
31    if len(arr.shape) == 3:31    if len(arr.shape) == 3:
32        return average(arr, -1)  32        return average(arr, -1)  
33    else:33    else:
34        return arr34        return arr
35def normalize(arr):35def normalize(arr):
36    rng = arr.max()-arr.min()36    rng = arr.max()-arr.min()
37    amin = arr.min()37    amin = arr.min()
38    return (arr-amin)*255/rngimport numpy as np38    return (arr-amin)*255/rngimport numpy as np
39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
40pctl = np.percentile(scores, np.arange(0,100,25))40pctl = np.percentile(scores, np.arange(0,100,25))
t41best_cultivar_indices = np.where(scores >= pctl[-1])t41best_cultivar_indices = np.where(scores>= pctl[-1])
42print(f'Cultivars with the following IDs are in the top quartile with a score of42print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
43best=cultivarIDs[best_cultivar_indices]43best=cultivarIDs[best_cultivar_indices]
44best.sort()44best.sort()
45print(', '.join([str(int(x)) for x in best]))45print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 447, P-Value: 9.36e-02

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3def make_plot(filename):3def make_plot(filename):
n4    x = np.linspace(0,np.pi* 4,100)n4    x = np.linspace(0,np.pi * 4,100)
5    y = np.sin(x)5    y = np.sin(x)
6    plt.plot(x,y,'b')6    plt.plot(x,y,'b')
7    plt.xlabel('x(radians)')7    plt.xlabel('x(radians)')
8    plt.ylabel('sin(x)')8    plt.ylabel('sin(x)')
9    plt.margins(0,0)9    plt.margins(0,0)
10    plt.savefig(filename)10    plt.savefig(filename)
11if __name__=='__main__':11if __name__=='__main__':
n12    make__plot('my_plot.png')n12    make_plot('my_plot.png')
13import matplotlib.pyplot as plt13import matplotlib.pyplot as plt
14from scipy.linalg import norm14from scipy.linalg import norm
15from scipy import sum,average15from scipy import sum,average
16def compare_plots(imagefile1,imagefile2):16def compare_plots(imagefile1,imagefile2):
17    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))17    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
18    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))18    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
19    if img1.size!=img2.size:19    if img1.size!=img2.size:
20        return False20        return False
21    diff = img1 - img2  21    diff = img1 - img2  
22    nm = sum(abs(diff))  22    nm = sum(abs(diff))  
23    nz = norm(diff.ravel(), 0)  23    nz = norm(diff.ravel(), 0)  
24    return nm/img1.size < 1 and nz/img1.size < 124    return nm/img1.size < 1 and nz/img1.size < 1
25def to_grayscale(arr):25def to_grayscale(arr):
26    if len(arr.shape) == 3:26    if len(arr.shape) == 3:
27        return average(arr, -1)  27        return average(arr, -1)  
28    else:28    else:
29        return arr29        return arr
30def normalize(arr):30def normalize(arr):
31    rng = arr.max()-arr.min()31    rng = arr.max()-arr.min()
32    amin = arr.min()32    amin = arr.min()
33    return (arr-amin)*255/rngimport numpy as np33    return (arr-amin)*255/rngimport numpy as np
34cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='34cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
n35quartile_boundaries = np.percentile(scores,np.arange(0,100,25))n35quartile_boundaries=np.percentile(scores,np.arange(0,100,25))
36top_indices, = np.where(scores>quartile_boundaries[-1])36best_cultivar_indices = np.where(scores>=quartile_boundaries[-1])
37print(f'Cultivars with the following IDs are in the top quartile with a score of37print(f'Cultivars with the following IDs are in the top quartile with a score of
> {quartile_boundaries[-1]} or better:')> {quartile_boundaries[-1]} or better:')
t38best=cultivarIDs[top_indices]t38best=cultivarIDs[best_cultivar_indices]
39best.sort()39best.sort()
40print(', '.join([str(int(x)) for x in best]))40print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 423, P-Value: 9.36e-02

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3def make_plot(filename):3def make_plot(filename):
n4    x = np.linspace(0,np.pi * 4,100)n4    x = np.linspace(0,np.pi* 4,100)
5    y = np.sin(x)5    y = np.sin(x)
6    plt.plot(x,y,'b')6    plt.plot(x,y,'b')
7    plt.xlabel('x(radians)')7    plt.xlabel('x(radians)')
8    plt.ylabel('sin(x)')8    plt.ylabel('sin(x)')
9    plt.margins(0,0)9    plt.margins(0,0)
10    plt.savefig(filename)10    plt.savefig(filename)
11if __name__=='__main__':11if __name__=='__main__':
n12    make_plot('my_plot.png')n12    make__plot('my_plot.png')
13import matplotlib.pyplot as plt13import matplotlib.pyplot as plt
14from scipy.linalg import norm14from scipy.linalg import norm
15from scipy import sum,average15from scipy import sum,average
16def compare_plots(imagefile1,imagefile2):16def compare_plots(imagefile1,imagefile2):
17    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))17    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
18    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))18    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
19    if img1.size!=img2.size:19    if img1.size!=img2.size:
20        return False20        return False
21    diff = img1 - img2  21    diff = img1 - img2  
22    nm = sum(abs(diff))  22    nm = sum(abs(diff))  
23    nz = norm(diff.ravel(), 0)  23    nz = norm(diff.ravel(), 0)  
24    return nm/img1.size < 1 and nz/img1.size < 124    return nm/img1.size < 1 and nz/img1.size < 1
25def to_grayscale(arr):25def to_grayscale(arr):
26    if len(arr.shape) == 3:26    if len(arr.shape) == 3:
27        return average(arr, -1)  27        return average(arr, -1)  
28    else:28    else:
29        return arr29        return arr
30def normalize(arr):30def normalize(arr):
31    rng = arr.max()-arr.min()31    rng = arr.max()-arr.min()
32    amin = arr.min()32    amin = arr.min()
33    return (arr-amin)*255/rngimport numpy as np33    return (arr-amin)*255/rngimport numpy as np
34cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='34cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
n35quartile_boundaries=np.percentile(scores,np.arange(0,100,25))n35quartile_boundaries = np.percentile(scores,np.arange(0,100,25))
36best_cultivar_indices = np.where(scores>=quartile_boundaries[-1])36top_indices, = np.where(scores>quartile_boundaries[-1])
37print(f'Cultivars with the following IDs are in the top quartile with a score of37print(f'Cultivars with the following IDs are in the top quartile with a score of
> {quartile_boundaries[-1]} or better:')> {quartile_boundaries[-1]} or better:')
t38best=cultivarIDs[best_cultivar_indices]t38best=cultivarIDs[top_indices]
39best.sort()39best.sort()
40print(', '.join([str(int(x)) for x in best]))40print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 424, P-Value: 9.82e-02

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4from math import sin, pi4from math import sin, pi
5def make_plot(filename):5def make_plot(filename):
6    plt.xlim([0,4*pi])6    plt.xlim([0,4*pi])
7    plt.ylim([-1,1])7    plt.ylim([-1,1])
8    x = np.linspace(0,13, num=80)8    x = np.linspace(0,13, num=80)
9    y = [sin(x) for x in x]9    y = [sin(x) for x in x]
10    plt.xlabel('x (radians)')10    plt.xlabel('x (radians)')
11    plt.ylabel('sin(x)')11    plt.ylabel('sin(x)')
12    plt.plot(x,y, '-b')12    plt.plot(x,y, '-b')
13    plt.savefig(filename)13    plt.savefig(filename)
14if __name__=='__main__':14if __name__=='__main__':
15    make_plot('my_plot.png')15    make_plot('my_plot.png')
16    if compare_plots('my_plot.png','instructors_plot.png'):16    if compare_plots('my_plot.png','instructors_plot.png'):
17        print('Success!')17        print('Success!')
18    else:18    else:
19        print('Keep trying.')19        print('Keep trying.')
20import matplotlib.pyplot as plt20import matplotlib.pyplot as plt
21from scipy.linalg import norm21from scipy.linalg import norm
22from scipy import sum,average22from scipy import sum,average
23def compare_plots(imagefile1,imagefile2):23def compare_plots(imagefile1,imagefile2):
24    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))24    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
25    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))25    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
26    if img1.size!=img2.size:26    if img1.size!=img2.size:
27        return False27        return False
28    diff = img1 - img2  28    diff = img1 - img2  
29    nm = sum(abs(diff))  29    nm = sum(abs(diff))  
30    nz = norm(diff.ravel(), 0)  30    nz = norm(diff.ravel(), 0)  
31    return nm/img1.size < 1 and nz/img1.size < 131    return nm/img1.size < 1 and nz/img1.size < 1
32def to_grayscale(arr):32def to_grayscale(arr):
33    if len(arr.shape) == 3:33    if len(arr.shape) == 3:
34        return average(arr, -1)  34        return average(arr, -1)  
35    else:35    else:
36        return arr36        return arr
37def normalize(arr):37def normalize(arr):
38    rng = arr.max()-arr.min()38    rng = arr.max()-arr.min()
39    amin = arr.min()39    amin = arr.min()
40    return (arr-amin)*255/rngimport numpy as np40    return (arr-amin)*255/rngimport numpy as np
41cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='41cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
t42pctl = np.percentile(scores,np.arange(0,100,25))t42quartile_boundaries = np.percentile(scores,np.arange(0,100,25))
43best_cultivar_indices, = np.where(scores>pctl[-1])43top_indices, = np.where(scores>quartile_boundaries[-1])
44print(f'Cultivars with the following IDs are in the top quartile with a score of44print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
45best=cultivarIDs[best_cultivar_indices]45best=cultivarIDs[best_cultivar_indices]
46best.sort()46best.sort()
47print(', '.join([str(int(x)) for x in best]))47print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 287, P-Value: 9.82e-02

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4from math import sin, pi4from math import sin, pi
5def make_plot(filename):5def make_plot(filename):
6    plt.xlim([0,4*pi])6    plt.xlim([0,4*pi])
7    plt.ylim([-1,1])7    plt.ylim([-1,1])
8    x = np.linspace(0,13, num=80)8    x = np.linspace(0,13, num=80)
9    y = [sin(x) for x in x]9    y = [sin(x) for x in x]
10    plt.xlabel('x (radians)')10    plt.xlabel('x (radians)')
11    plt.ylabel('sin(x)')11    plt.ylabel('sin(x)')
12    plt.plot(x,y, '-b')12    plt.plot(x,y, '-b')
13    plt.savefig(filename)13    plt.savefig(filename)
14if __name__=='__main__':14if __name__=='__main__':
15    make_plot('my_plot.png')15    make_plot('my_plot.png')
16    if compare_plots('my_plot.png','instructors_plot.png'):16    if compare_plots('my_plot.png','instructors_plot.png'):
17        print('Success!')17        print('Success!')
18    else:18    else:
19        print('Keep trying.')19        print('Keep trying.')
20import matplotlib.pyplot as plt20import matplotlib.pyplot as plt
21from scipy.linalg import norm21from scipy.linalg import norm
22from scipy import sum,average22from scipy import sum,average
23def compare_plots(imagefile1,imagefile2):23def compare_plots(imagefile1,imagefile2):
24    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))24    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
25    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))25    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
26    if img1.size!=img2.size:26    if img1.size!=img2.size:
27        return False27        return False
28    diff = img1 - img2  28    diff = img1 - img2  
29    nm = sum(abs(diff))  29    nm = sum(abs(diff))  
30    nz = norm(diff.ravel(), 0)  30    nz = norm(diff.ravel(), 0)  
31    return nm/img1.size < 1 and nz/img1.size < 131    return nm/img1.size < 1 and nz/img1.size < 1
32def to_grayscale(arr):32def to_grayscale(arr):
33    if len(arr.shape) == 3:33    if len(arr.shape) == 3:
34        return average(arr, -1)  34        return average(arr, -1)  
35    else:35    else:
36        return arr36        return arr
37def normalize(arr):37def normalize(arr):
38    rng = arr.max()-arr.min()38    rng = arr.max()-arr.min()
39    amin = arr.min()39    amin = arr.min()
40    return (arr-amin)*255/rngimport numpy as np40    return (arr-amin)*255/rngimport numpy as np
41cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='41cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
t42quartile_boundaries = np.percentile(scores,np.arange(0,100,25))t42pctl = np.percentile(scores,np.arange(0,100,25))
43top_indices, = np.where(scores>quartile_boundaries[-1])43best_cultivar_indices, = np.where(scores>pctl[-1])
44print(f'Cultivars with the following IDs are in the top quartile with a score of44print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
45best=cultivarIDs[best_cultivar_indices]45best=cultivarIDs[best_cultivar_indices]
46best.sort()46best.sort()
47print(', '.join([str(int(x)) for x in best]))47print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 428, P-Value: 9.95e-02

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
5    x = np.linspace(0,np.pi * 4,100)5    x = np.linspace(0,np.pi * 4,100)
6    y = np.sin(x)6    y = np.sin(x)
n7    plt.plot(x,y,'-b')n7    plt.plot(x,y,'b')
8    plt.xlabel('x(radians)')
9    plt.ylabel('sin(x)')
8    plt.margins(0,0)10    plt.margins(0,0)
n9    plt.xlabel('x (radians)')n
10    plt.ylabel('sin(x)')
11    plt.savefig(filename)11    plt.savefig(filename)
12if __name__=='__main__':12if __name__=='__main__':
13    make_plot('my_plot.png')13    make_plot('my_plot.png')
14    if compare_plots('my_plot.png','instructors_plot.png'):14    if compare_plots('my_plot.png','instructors_plot.png'):
15        print('Success!')15        print('Success!')
16    else:16    else:
17        print('Keep trying.')17        print('Keep trying.')
18import matplotlib.pyplot as plt18import matplotlib.pyplot as plt
19from scipy.linalg import norm19from scipy.linalg import norm
20from scipy import sum,average20from scipy import sum,average
21def compare_plots(imagefile1,imagefile2):21def compare_plots(imagefile1,imagefile2):
22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
24    if img1.size!=img2.size:24    if img1.size!=img2.size:
25        return False25        return False
26    diff = img1 - img2  26    diff = img1 - img2  
27    nm = sum(abs(diff))  27    nm = sum(abs(diff))  
28    nz = norm(diff.ravel(), 0)  28    nz = norm(diff.ravel(), 0)  
29    return nm/img1.size < 1 and nz/img1.size < 129    return nm/img1.size < 1 and nz/img1.size < 1
30def to_grayscale(arr):30def to_grayscale(arr):
31    if len(arr.shape) == 3:31    if len(arr.shape) == 3:
32        return average(arr, -1)  32        return average(arr, -1)  
33    else:33    else:
34        return arr34        return arr
35def normalize(arr):35def normalize(arr):
36    rng = arr.max()-arr.min()36    rng = arr.max()-arr.min()
37    amin = arr.min()37    amin = arr.min()
38    return (arr-amin)*255/rngimport numpy as np38    return (arr-amin)*255/rngimport numpy as np
39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
t40pctl = np.percentile(scores, np.arange(0, 100, 25))t40pctl = np.percentile(scores, np.arange(0,100,25))
41best_cultivar_indices = np.where(scores >= pctl[-1])41best_cultivar_indices = np.where(scores>= pctl[-1])
42print(f'Cultivars with the following IDs are in the top quartile with a score of42print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
43best=cultivarIDs[best_cultivar_indices]43best=cultivarIDs[best_cultivar_indices]
44best.sort()44best.sort()
45print(', '.join([str(int(x)) for x in best]))45print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 371, P-Value: 1.01e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
n4from math import sinn
5def make_plot(filename):4def make_plot(filename):
n6    x=np.arange(0,4*np.pi,0.01) n5    x = np.arange(0,4 *np.pi,0.01)
7    y=np.sin(x) 6    y = np.sin(x)
8    plt.plot(x,y)7    plt.plot(x,y)
nn8    plt.ylim([-1,1])
9    plt.xlabel('x (radians)')
9    plt.ylabel('sin(x)')10    plt.ylabel('sin(x)')
n10    plt.xlabel('x (radians)')n
11    plt.ylim([-1,1])
12    plt.xlim([0,4*np.pi])11    plt.xlim([0,4*np.pi])
13    plt.savefig(filename)12    plt.savefig(filename)
14if __name__=='__main__':13if __name__=='__main__':
15    make_plot('my_plot.png')14    make_plot('my_plot.png')
16    if compare_plots('my_plot.png','instructors_plot.png'):15    if compare_plots('my_plot.png','instructors_plot.png'):
17        print('Success!')16        print('Success!')
18    else:17    else:
19        print('Keep trying.')18        print('Keep trying.')
20import matplotlib.pyplot as plt19import matplotlib.pyplot as plt
21from scipy.linalg import norm20from scipy.linalg import norm
22from scipy import sum,average21from scipy import sum,average
23def compare_plots(imagefile1,imagefile2):22def compare_plots(imagefile1,imagefile2):
24    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
25    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
26    if img1.size!=img2.size:25    if img1.size!=img2.size:
27        return False26        return False
28    diff = img1 - img2  27    diff = img1 - img2  
29    nm = sum(abs(diff))  28    nm = sum(abs(diff))  
30    nz = norm(diff.ravel(), 0)  29    nz = norm(diff.ravel(), 0)  
31    return nm/img1.size < 1 and nz/img1.size < 130    return nm/img1.size < 1 and nz/img1.size < 1
32def to_grayscale(arr):31def to_grayscale(arr):
33    if len(arr.shape) == 3:32    if len(arr.shape) == 3:
34        return average(arr, -1)  33        return average(arr, -1)  
35    else:34    else:
36        return arr35        return arr
37def normalize(arr):36def normalize(arr):
38    rng = arr.max()-arr.min()37    rng = arr.max()-arr.min()
39    amin = arr.min()38    amin = arr.min()
40    return (arr-amin)*255/rngimport numpy as np39    return (arr-amin)*255/rngimport numpy as np
41cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
42pctl = np.percentile(scores,np.arange(0,100,25))41pctl = np.percentile(scores,np.arange(0,100,25))
t43best_cultivar_indices = np.where(scores>pctl[-1])t42best_cultivar_indices, = np.where(scores>pctl[-1])
44print(f'Cultivars with the following IDs are in the top quartile with a score of43print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
45best=cultivarIDs[best_cultivar_indices]44best=cultivarIDs[best_cultivar_indices]
46best.sort()45best.sort()
47print(', '.join([str(int(x)) for x in best]))46print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 395, P-Value: 1.02e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
5        x = np.linspace(0,np.pi * 4,100)5        x = np.linspace(0,np.pi * 4,100)
6        y = np.sin(x)6        y = np.sin(x)
7        plt.plot(x,y,'b')7        plt.plot(x,y,'b')
8        plt.xlabel('x(radians)')8        plt.xlabel('x(radians)')
9        plt.ylabel('sin(x)')9        plt.ylabel('sin(x)')
10        plt.margins(0,0)10        plt.margins(0,0)
t11        plt.savefig(filename)t11        plt.savefig(filename) 
12if __name__=='__main__':12if __name__=='__main__':
13    make_plot('my_plot.png')13    make_plot('my_plot.png')
14    if compare_plots('my_plot.png','instructors_plot.png'):14    if compare_plots('my_plot.png','instructors_plot.png'):
15        print('Success!')15        print('Success!')
16    else:16    else:
17        print('Keep trying.')17        print('Keep trying.')
18import matplotlib.pyplot as plt18import matplotlib.pyplot as plt
19from scipy.linalg import norm19from scipy.linalg import norm
20from scipy import sum,average20from scipy import sum,average
21def compare_plots(imagefile1,imagefile2):21def compare_plots(imagefile1,imagefile2):
22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
24    if img1.size!=img2.size:24    if img1.size!=img2.size:
25        return False25        return False
26    diff = img1 - img2  26    diff = img1 - img2  
27    nm = sum(abs(diff))  27    nm = sum(abs(diff))  
28    nz = norm(diff.ravel(), 0)  28    nz = norm(diff.ravel(), 0)  
29    return nm/img1.size < 1 and nz/img1.size < 129    return nm/img1.size < 1 and nz/img1.size < 1
30def to_grayscale(arr):30def to_grayscale(arr):
31    if len(arr.shape) == 3:31    if len(arr.shape) == 3:
32        return average(arr, -1)  32        return average(arr, -1)  
33    else:33    else:
34        return arr34        return arr
35def normalize(arr):35def normalize(arr):
36    rng = arr.max()-arr.min()36    rng = arr.max()-arr.min()
37    amin = arr.min()37    amin = arr.min()
38    return (arr-amin)*255/rngimport numpy as np38    return (arr-amin)*255/rngimport numpy as np
39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
40pctl = np.percentile(scores, np.arange(0,100,25))40pctl = np.percentile(scores, np.arange(0,100,25))
41best_cultivar_indices = np.where(scores >= pctl[-1])41best_cultivar_indices = np.where(scores >= pctl[-1])
42print(f'Cultivars with the following IDs are in the top quartile with a score of42print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
43best=cultivarIDs[best_cultivar_indices]43best=cultivarIDs[best_cultivar_indices]
44best.sort()44best.sort()
45print(', '.join([str(int(x)) for x in best]))45print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 370, P-Value: 1.05e-01

Student (left) and Nearest Neighbor (right).


f1from cmath import pif1from cmath import pi
2import matplotlib.pyplot as plt2import matplotlib.pyplot as plt
3import numpy as np3import numpy as np
4from compare_plots import compare_plots4from compare_plots import compare_plots
5def make_plot(filename):5def make_plot(filename):
n6    x = np.linspace(0,4*pi,80)n6    xvals = np.linspace(0,4*pi,80)
7    sinx = np.sin(x)7    yvals = np.sin(xvals)
8    plt.plot(x,sinx, '-b')8    plt.plot(xvals,yvals, '-b')
9    plt.xlim([0,4*pi])
10    plt.ylim([-1,1])
11    plt.xlabel('x (radians)')9    plt.xlabel('x (radians)')
12    plt.ylabel('sin(x)')10    plt.ylabel('sin(x)')
nn11    plt.xlim([0,4*pi])
12    plt.ylim([-1,1.00])
13    plt.savefig(filename)13    plt.savefig(filename)
14if __name__=='__main__':14if __name__=='__main__':
15    make_plot('my_plot.png')15    make_plot('my_plot.png')
16    if compare_plots('my_plot.png','instructors_plot.png'):16    if compare_plots('my_plot.png','instructors_plot.png'):
17        print('Success!')17        print('Success!')
18    else:18    else:
19        print('Keep trying.')19        print('Keep trying.')
20import matplotlib.pyplot as plt20import matplotlib.pyplot as plt
21from scipy.linalg import norm21from scipy.linalg import norm
22from scipy import sum,average22from scipy import sum,average
23def compare_plots(imagefile1,imagefile2):23def compare_plots(imagefile1,imagefile2):
24    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))24    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
25    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))25    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
26    if img1.size!=img2.size:26    if img1.size!=img2.size:
27        return False27        return False
28    diff = img1 - img2  28    diff = img1 - img2  
29    nm = sum(abs(diff))  29    nm = sum(abs(diff))  
30    nz = norm(diff.ravel(), 0)  30    nz = norm(diff.ravel(), 0)  
31    return nm/img1.size < 1 and nz/img1.size < 131    return nm/img1.size < 1 and nz/img1.size < 1
32def to_grayscale(arr):32def to_grayscale(arr):
33    if len(arr.shape) == 3:33    if len(arr.shape) == 3:
34        return average(arr, -1)  34        return average(arr, -1)  
35    else:35    else:
36        return arr36        return arr
37def normalize(arr):37def normalize(arr):
38    rng = arr.max()-arr.min()38    rng = arr.max()-arr.min()
39    amin = arr.min()39    amin = arr.min()
40    return (arr-amin)*255/rngimport numpy as np40    return (arr-amin)*255/rngimport numpy as np
t41cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True, delimiter=t41cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>',')>,')
42quartile_boundaries = np.percentile(scores,np.arange(0,100,25))42quartile_boundaries = np.percentile(scores,np.arange(0,100,25))
43best_cultivar_indices = np.where(scores>=quartile_boundaries[-1])43best_cultivar_indices = np.where(scores>=quartile_boundaries[-1])
44print(f'Cultivars with the following IDs are in the top quartile with a score of44print(f'Cultivars with the following IDs are in the top quartile with a score of
> {quartile_boundaries[-1]} or better:')> {quartile_boundaries[-1]} or better:')
45best=cultivarIDs[best_cultivar_indices]45best=cultivarIDs[best_cultivar_indices]
46best.sort()46best.sort()
47print(', '.join([str(int(x)) for x in best]))47print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 188, P-Value: 1.05e-01

Student (left) and Nearest Neighbor (right).


f1from cmath import pif1from cmath import pi
2import matplotlib.pyplot as plt2import matplotlib.pyplot as plt
3import numpy as np3import numpy as np
4from compare_plots import compare_plots4from compare_plots import compare_plots
5def make_plot(filename):5def make_plot(filename):
n6    xvals = np.linspace(0,4*pi,80)n6    x = np.linspace(0,4*pi,80)
7    yvals = np.sin(xvals)7    sinx = np.sin(x)
8    plt.plot(xvals,yvals, '-b')8    plt.plot(x,sinx, '-b')
9    plt.xlim([0,4*pi])
10    plt.ylim([-1,1])
9    plt.xlabel('x (radians)')11    plt.xlabel('x (radians)')
10    plt.ylabel('sin(x)')12    plt.ylabel('sin(x)')
n11    plt.xlim([0,4*pi])n
12    plt.ylim([-1,1.00])
13    plt.savefig(filename)13    plt.savefig(filename)
14if __name__=='__main__':14if __name__=='__main__':
15    make_plot('my_plot.png')15    make_plot('my_plot.png')
16    if compare_plots('my_plot.png','instructors_plot.png'):16    if compare_plots('my_plot.png','instructors_plot.png'):
17        print('Success!')17        print('Success!')
18    else:18    else:
19        print('Keep trying.')19        print('Keep trying.')
20import matplotlib.pyplot as plt20import matplotlib.pyplot as plt
21from scipy.linalg import norm21from scipy.linalg import norm
22from scipy import sum,average22from scipy import sum,average
23def compare_plots(imagefile1,imagefile2):23def compare_plots(imagefile1,imagefile2):
24    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))24    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
25    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))25    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
26    if img1.size!=img2.size:26    if img1.size!=img2.size:
27        return False27        return False
28    diff = img1 - img2  28    diff = img1 - img2  
29    nm = sum(abs(diff))  29    nm = sum(abs(diff))  
30    nz = norm(diff.ravel(), 0)  30    nz = norm(diff.ravel(), 0)  
31    return nm/img1.size < 1 and nz/img1.size < 131    return nm/img1.size < 1 and nz/img1.size < 1
32def to_grayscale(arr):32def to_grayscale(arr):
33    if len(arr.shape) == 3:33    if len(arr.shape) == 3:
34        return average(arr, -1)  34        return average(arr, -1)  
35    else:35    else:
36        return arr36        return arr
37def normalize(arr):37def normalize(arr):
38    rng = arr.max()-arr.min()38    rng = arr.max()-arr.min()
39    amin = arr.min()39    amin = arr.min()
40    return (arr-amin)*255/rngimport numpy as np40    return (arr-amin)*255/rngimport numpy as np
t41cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='t41cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True, delimiter=
>,')>',')
42quartile_boundaries = np.percentile(scores,np.arange(0,100,25))42quartile_boundaries = np.percentile(scores,np.arange(0,100,25))
43best_cultivar_indices = np.where(scores>=quartile_boundaries[-1])43best_cultivar_indices = np.where(scores>=quartile_boundaries[-1])
44print(f'Cultivars with the following IDs are in the top quartile with a score of44print(f'Cultivars with the following IDs are in the top quartile with a score of
> {quartile_boundaries[-1]} or better:')> {quartile_boundaries[-1]} or better:')
45best=cultivarIDs[best_cultivar_indices]45best=cultivarIDs[best_cultivar_indices]
46best.sort()46best.sort()
47print(', '.join([str(int(x)) for x in best]))47print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 163, P-Value: 1.09e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
n5    x = np.linspace(0,4*np.pi,100)n5    x = np.linspace(0,np.pi * 4,100)
6    y= np.sin(x)6    y = np.sin(x)
7    plt.plot(x,y, 'b')7    plt.plot(x,y,'b')
8    plt.xlabel('x (radians)')8    plt.xlabel('x(radians)')
9    plt.ylabel('sin(x)')9    plt.ylabel('sin(x)')
10    plt.margins(0,0)10    plt.margins(0,0)
11    plt.savefig(filename)11    plt.savefig(filename)
12if __name__=='__main__':12if __name__=='__main__':
13    make_plot('my_plot.png')13    make_plot('my_plot.png')
14    if compare_plots('my_plot.png','instructors_plot.png'):14    if compare_plots('my_plot.png','instructors_plot.png'):
15        print('Success!')15        print('Success!')
16    else:16    else:
17        print('Keep trying.')17        print('Keep trying.')
18import matplotlib.pyplot as plt18import matplotlib.pyplot as plt
19from scipy.linalg import norm19from scipy.linalg import norm
20from scipy import sum,average20from scipy import sum,average
21def compare_plots(imagefile1,imagefile2):21def compare_plots(imagefile1,imagefile2):
22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
24    if img1.size!=img2.size:24    if img1.size!=img2.size:
25        return False25        return False
26    diff = img1 - img2  26    diff = img1 - img2  
27    nm = sum(abs(diff))  27    nm = sum(abs(diff))  
28    nz = norm(diff.ravel(), 0)  28    nz = norm(diff.ravel(), 0)  
29    return nm/img1.size < 1 and nz/img1.size < 129    return nm/img1.size < 1 and nz/img1.size < 1
30def to_grayscale(arr):30def to_grayscale(arr):
31    if len(arr.shape) == 3:31    if len(arr.shape) == 3:
32        return average(arr, -1)  32        return average(arr, -1)  
33    else:33    else:
34        return arr34        return arr
35def normalize(arr):35def normalize(arr):
36    rng = arr.max()-arr.min()36    rng = arr.max()-arr.min()
37    amin = arr.min()37    amin = arr.min()
38    return (arr-amin)*255/rngimport numpy as np38    return (arr-amin)*255/rngimport numpy as np
39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
t40pctl = np.percentile(scores,np.arange(0,100,25))t40pctl = np.percentile(scores, np.arange(0,100,25))
41best_cultivar_indices = np.where(scores >= pctl[-1])41best_cultivar_indices = np.where(scores>= pctl[-1])
42print(f'Cultivars with the following IDs are in the top quartile with a score of42print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
43best=cultivarIDs[best_cultivar_indices]43best=cultivarIDs[best_cultivar_indices]
44best.sort()44best.sort()
45print(', '.join([str(int(x)) for x in best]))45print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 293, P-Value: 1.10e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
5    x = np.linspace(0,4*np.pi,num=80)5    x = np.linspace(0,4*np.pi,num=80)
6    y = np.sin(x)6    y = np.sin(x)
nn7    plt.plot(x, y,'-b')
7    plt.xlim([0,12.55])8    plt.xlim([0,4*np.pi])
8    plt.ylim([-1,1])9    plt.ylim([-1,1])
n9    plt.plot(x,y,'-b')n
10    plt.xlabel('x (radians)')10    plt.xlabel('x (radians)')
11    plt.ylabel('sin(x)')11    plt.ylabel('sin(x)')
12    plt.savefig(filename)12    plt.savefig(filename)
13if __name__=='__main__':13if __name__=='__main__':
14    make_plot('my_plot.png')14    make_plot('my_plot.png')
15    if compare_plots('my_plot.png','instructors_plot.png'):15    if compare_plots('my_plot.png','instructors_plot.png'):
16        print('Success!')16        print('Success!')
17    else:17    else:
18        print('Keep trying.')18        print('Keep trying.')
19import matplotlib.pyplot as plt19import matplotlib.pyplot as plt
20from scipy.linalg import norm20from scipy.linalg import norm
21from scipy import sum,average21from scipy import sum,average
22def compare_plots(imagefile1,imagefile2):22def compare_plots(imagefile1,imagefile2):
23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
25    if img1.size!=img2.size:25    if img1.size!=img2.size:
26        return False26        return False
27    diff = img1 - img2  27    diff = img1 - img2  
28    nm = sum(abs(diff))  28    nm = sum(abs(diff))  
29    nz = norm(diff.ravel(), 0)  29    nz = norm(diff.ravel(), 0)  
30    return nm/img1.size < 1 and nz/img1.size < 130    return nm/img1.size < 1 and nz/img1.size < 1
31def to_grayscale(arr):31def to_grayscale(arr):
32    if len(arr.shape) == 3:32    if len(arr.shape) == 3:
33        return average(arr, -1)  33        return average(arr, -1)  
34    else:34    else:
35        return arr35        return arr
36def normalize(arr):36def normalize(arr):
37    rng = arr.max()-arr.min()37    rng = arr.max()-arr.min()
38    amin = arr.min()38    amin = arr.min()
39    return (arr-amin)*255/rngimport numpy as np39    return (arr-amin)*255/rngimport numpy as np
40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
t41pctl = np.percentile(scores, np.arange(0,100,25))t41pctl = np.percentile(scores,np.arange(0,100,25))
42best_cultivar_indices = np.where(scores > pctl[-1])42best_cultivar_indices = np.where(scores> pctl[-1])
43print(f'Cultivars with the following IDs are in the top quartile with a score of43print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
44best=cultivarIDs[best_cultivar_indices]44best=cultivarIDs[best_cultivar_indices]
45best.sort()45best.sort()
46print(', '.join([str(int(x)) for x in best]))46print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 400, P-Value: 1.14e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
n5    x = np.arange(0,4*np.pi,0.005)n5    x = np.arange(0,4 *np.pi,0.01)
6    y= np.sin(x)6    y = np.sin(x)
7    plt.plot(x,y)
8    plt.ylim([-1,1])
9    plt.xlabel('x (radians)')
10    plt.ylabel('sin(x)')
7    plt.xlim([0,4*np.pi])11    plt.xlim([0,4*np.pi])
n8    plt.ylim([-1,1])n
9    plt.xlabel('x(radians)')
10    plt.ylabel("sin(x)")
11    plt.plot(x,y,"-b")
12    plt.savefig(filename)12    plt.savefig(filename)
13if __name__=='__main__':13if __name__=='__main__':
14    make_plot('my_plot.png')14    make_plot('my_plot.png')
15    if compare_plots('my_plot.png','instructors_plot.png'):15    if compare_plots('my_plot.png','instructors_plot.png'):
16        print('Success!')16        print('Success!')
17    else:17    else:
18        print('Keep trying.')18        print('Keep trying.')
19import matplotlib.pyplot as plt19import matplotlib.pyplot as plt
20from scipy.linalg import norm20from scipy.linalg import norm
21from scipy import sum,average21from scipy import sum,average
22def compare_plots(imagefile1,imagefile2):22def compare_plots(imagefile1,imagefile2):
23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
25    if img1.size!=img2.size:25    if img1.size!=img2.size:
26        return False26        return False
27    diff = img1 - img2  27    diff = img1 - img2  
28    nm = sum(abs(diff))  28    nm = sum(abs(diff))  
29    nz = norm(diff.ravel(), 0)  29    nz = norm(diff.ravel(), 0)  
30    return nm/img1.size < 1 and nz/img1.size < 130    return nm/img1.size < 1 and nz/img1.size < 1
31def to_grayscale(arr):31def to_grayscale(arr):
32    if len(arr.shape) == 3:32    if len(arr.shape) == 3:
33        return average(arr, -1)  33        return average(arr, -1)  
34    else:34    else:
35        return arr35        return arr
36def normalize(arr):36def normalize(arr):
37    rng = arr.max()-arr.min()37    rng = arr.max()-arr.min()
38    amin = arr.min()38    amin = arr.min()
39    return (arr-amin)*255/rngimport numpy as np39    return (arr-amin)*255/rngimport numpy as np
40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
41pctl = np.percentile(scores,np.arange(0,100,25))41pctl = np.percentile(scores,np.arange(0,100,25))
t42best_cultivar_indices = np.where(scores>pctl[-1])t42best_cultivar_indices, = np.where(scores>pctl[-1])
43print(f'Cultivars with the following IDs are in the top quartile with a score of43print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
44best=cultivarIDs[best_cultivar_indices]44best=cultivarIDs[best_cultivar_indices]
45best.sort()45best.sort()
46print(', '.join([str(int(x)) for x in best]))46print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 374, P-Value: 1.16e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
n5    x = np.linspace(0,4*np.pi,80)n5    x = np.linspace(0,4*np.pi,80) 
6    plt.plot(x,np.sin(x),'-b')    6    plt.plot(x,np.sin(x),'-b')    
7    plt.xlim(0,4*np.pi)           7    plt.xlim(0,4*np.pi)           
8    plt.ylim(-1,1)               8    plt.ylim(-1,1)               
9    plt.xlabel("x (radians)")     9    plt.xlabel("x (radians)")     
10    plt.ylabel("sin(x)")          10    plt.ylabel("sin(x)")          
11    plt.savefig(filename)11    plt.savefig(filename)
12if __name__=='__main__':12if __name__=='__main__':
13    make_plot('my_plot.png')13    make_plot('my_plot.png')
14    if compare_plots('my_plot.png','instructors_plot.png'):14    if compare_plots('my_plot.png','instructors_plot.png'):
15        print('Success!')15        print('Success!')
16    else:16    else:
17        print('Keep trying.')17        print('Keep trying.')
18import matplotlib.pyplot as plt18import matplotlib.pyplot as plt
19from scipy.linalg import norm19from scipy.linalg import norm
20from scipy import sum,average20from scipy import sum,average
21def compare_plots(imagefile1,imagefile2):21def compare_plots(imagefile1,imagefile2):
22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
24    if img1.size!=img2.size:24    if img1.size!=img2.size:
25        return False25        return False
26    diff = img1 - img2  26    diff = img1 - img2  
27    nm = sum(abs(diff))  27    nm = sum(abs(diff))  
28    nz = norm(diff.ravel(), 0)  28    nz = norm(diff.ravel(), 0)  
29    return nm/img1.size < 1 and nz/img1.size < 129    return nm/img1.size < 1 and nz/img1.size < 1
30def to_grayscale(arr):30def to_grayscale(arr):
31    if len(arr.shape) == 3:31    if len(arr.shape) == 3:
32        return average(arr, -1)  32        return average(arr, -1)  
33    else:33    else:
34        return arr34        return arr
35def normalize(arr):35def normalize(arr):
36    rng = arr.max()-arr.min()36    rng = arr.max()-arr.min()
37    amin = arr.min()37    amin = arr.min()
38    return (arr-amin)*255/rngimport numpy as np38    return (arr-amin)*255/rngimport numpy as np
39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
t40pctl = np.percentile(scores,np.arange(0,100,25))t40pctl = np.percentile(scores, np.arange(0,100,25))
41best_cultivar_indices = np.where(scores >= pctl[-1])41best_cultivar_indices = np.where(scores >= pctl[-1])
42print(f'Cultivars with the following IDs are in the top quartile with a score of42print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
43best=cultivarIDs[best_cultivar_indices]43best=cultivarIDs[best_cultivar_indices]
44best.sort()44best.sort()
45print(', '.join([str(int(x)) for x in best]))45print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 240, P-Value: 1.16e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
n5    x = np.linspace(0,4*np.pi,80) n5    x = np.linspace(0,4*np.pi,80)
6    plt.plot(x,np.sin(x),'-b')    6    plt.plot(x,np.sin(x),'-b')    
7    plt.xlim(0,4*np.pi)           7    plt.xlim(0,4*np.pi)           
8    plt.ylim(-1,1)               8    plt.ylim(-1,1)               
9    plt.xlabel("x (radians)")     9    plt.xlabel("x (radians)")     
10    plt.ylabel("sin(x)")          10    plt.ylabel("sin(x)")          
11    plt.savefig(filename)11    plt.savefig(filename)
12if __name__=='__main__':12if __name__=='__main__':
13    make_plot('my_plot.png')13    make_plot('my_plot.png')
14    if compare_plots('my_plot.png','instructors_plot.png'):14    if compare_plots('my_plot.png','instructors_plot.png'):
15        print('Success!')15        print('Success!')
16    else:16    else:
17        print('Keep trying.')17        print('Keep trying.')
18import matplotlib.pyplot as plt18import matplotlib.pyplot as plt
19from scipy.linalg import norm19from scipy.linalg import norm
20from scipy import sum,average20from scipy import sum,average
21def compare_plots(imagefile1,imagefile2):21def compare_plots(imagefile1,imagefile2):
22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
24    if img1.size!=img2.size:24    if img1.size!=img2.size:
25        return False25        return False
26    diff = img1 - img2  26    diff = img1 - img2  
27    nm = sum(abs(diff))  27    nm = sum(abs(diff))  
28    nz = norm(diff.ravel(), 0)  28    nz = norm(diff.ravel(), 0)  
29    return nm/img1.size < 1 and nz/img1.size < 129    return nm/img1.size < 1 and nz/img1.size < 1
30def to_grayscale(arr):30def to_grayscale(arr):
31    if len(arr.shape) == 3:31    if len(arr.shape) == 3:
32        return average(arr, -1)  32        return average(arr, -1)  
33    else:33    else:
34        return arr34        return arr
35def normalize(arr):35def normalize(arr):
36    rng = arr.max()-arr.min()36    rng = arr.max()-arr.min()
37    amin = arr.min()37    amin = arr.min()
38    return (arr-amin)*255/rngimport numpy as np38    return (arr-amin)*255/rngimport numpy as np
39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
t40pctl = np.percentile(scores, np.arange(0,100,25))t40pctl = np.percentile(scores,np.arange(0,100,25))
41best_cultivar_indices = np.where(scores >= pctl[-1])41best_cultivar_indices = np.where(scores >= pctl[-1])
42print(f'Cultivars with the following IDs are in the top quartile with a score of42print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
43best=cultivarIDs[best_cultivar_indices]43best=cultivarIDs[best_cultivar_indices]
44best.sort()44best.sort()
45print(', '.join([str(int(x)) for x in best]))45print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 93, P-Value: 1.17e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
n5    x = np.linspace(0,13, num=80)n5    x = np.linspace(0,13, num= 80)
6    y = np.sin(x)
6    plt.xlabel('x (radians)')7    plt.xlabel('x (radians)')
nn8    plt.ylabel('sin(x)')
7    plt.xlim([0,12.5664])9    plt.xlim([0,12.5664])
n8    y = np.sin(x)n
9    plt.ylabel('sin(x)')
10    plt.ylim([-1,1])10    plt.ylim([-1,1])
11    plt.plot(x,y,'b')11    plt.plot(x,y,'b')
12    plt.savefig(filename)12    plt.savefig(filename)
13if __name__=='__main__':13if __name__=='__main__':
14    make_plot('my_plot.png')14    make_plot('my_plot.png')
15    if compare_plots('my_plot.png','instructors_plot.png'):15    if compare_plots('my_plot.png','instructors_plot.png'):
16        print('Success!')16        print('Success!')
17    else:17    else:
18        print('Keep trying.')18        print('Keep trying.')
19import matplotlib.pyplot as plt19import matplotlib.pyplot as plt
20from scipy.linalg import norm20from scipy.linalg import norm
21from scipy import sum,average21from scipy import sum,average
22def compare_plots(imagefile1,imagefile2):22def compare_plots(imagefile1,imagefile2):
23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
25    if img1.size!=img2.size:25    if img1.size!=img2.size:
26        return False26        return False
27    diff = img1 - img2  27    diff = img1 - img2  
28    nm = sum(abs(diff))  28    nm = sum(abs(diff))  
29    nz = norm(diff.ravel(), 0)  29    nz = norm(diff.ravel(), 0)  
30    return nm/img1.size < 1 and nz/img1.size < 130    return nm/img1.size < 1 and nz/img1.size < 1
31def to_grayscale(arr):31def to_grayscale(arr):
32    if len(arr.shape) == 3:32    if len(arr.shape) == 3:
33        return average(arr, -1)  33        return average(arr, -1)  
34    else:34    else:
35        return arr35        return arr
36def normalize(arr):36def normalize(arr):
37    rng = arr.max()-arr.min()37    rng = arr.max()-arr.min()
38    amin = arr.min()38    amin = arr.min()
39    return (arr-amin)*255/rngimport numpy as np39    return (arr-amin)*255/rngimport numpy as np
40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
t41quartile_boundary = np.percentile(scores,np.arange(0,100,25))t41quartile_boundaries = np.percentile(scores,np.arange(0,100,25))
42best_cultivar_indices, = np.where(scores>quartile_boundary[-1])42best_cultivar_indices, = np.where(scores>quartile_boundaries[-1])
43print(f'Cultivars with the following IDs are in the top quartile with a score of43print(f'Cultivars with the following IDs are in the top quartile with a score of
> {quartile_boundary[-1]} or better:')> {quartile_boundaries[-1]} or better:')
44best=cultivarIDs[best_cultivar_indices]44best=cultivarIDs[best_cultivar_indices]
45best.sort()45best.sort()
46print(', '.join([str(int(x)) for x in best]))46print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 185, P-Value: 1.17e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
n5    x = np.arange(0,(4*np.pi),0.1)n5    x = np.arange(0,4 *np.pi,0.01)
6    y = np.sin(x)6    y = np.sin(x)
n7    plt.plot(x,y,'-b')n7    plt.plot(x,y)
8    plt.xlim([0,4*np.pi])
9    plt.ylim([-1.00, 1.00])8    plt.ylim([-1,1])
10    plt.xlabel('x (radians)')9    plt.xlabel('x (radians)')
11    plt.ylabel('sin(x)')10    plt.ylabel('sin(x)')
nn11    plt.xlim([0,4*np.pi])
12    plt.savefig(filename)12    plt.savefig(filename)
13if __name__=='__main__':13if __name__=='__main__':
14    make_plot('my_plot.png')14    make_plot('my_plot.png')
15    if compare_plots('my_plot.png','instructors_plot.png'):15    if compare_plots('my_plot.png','instructors_plot.png'):
16        print('Success!')16        print('Success!')
17    else:17    else:
18        print('Keep trying.')18        print('Keep trying.')
19import matplotlib.pyplot as plt19import matplotlib.pyplot as plt
20from scipy.linalg import norm20from scipy.linalg import norm
21from scipy import sum,average21from scipy import sum,average
22def compare_plots(imagefile1,imagefile2):22def compare_plots(imagefile1,imagefile2):
23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
25    if img1.size!=img2.size:25    if img1.size!=img2.size:
26        return False26        return False
27    diff = img1 - img2  27    diff = img1 - img2  
28    nm = sum(abs(diff))  28    nm = sum(abs(diff))  
29    nz = norm(diff.ravel(), 0)  29    nz = norm(diff.ravel(), 0)  
30    return nm/img1.size < 1 and nz/img1.size < 130    return nm/img1.size < 1 and nz/img1.size < 1
31def to_grayscale(arr):31def to_grayscale(arr):
32    if len(arr.shape) == 3:32    if len(arr.shape) == 3:
33        return average(arr, -1)  33        return average(arr, -1)  
34    else:34    else:
35        return arr35        return arr
36def normalize(arr):36def normalize(arr):
37    rng = arr.max()-arr.min()37    rng = arr.max()-arr.min()
38    amin = arr.min()38    amin = arr.min()
39    return (arr-amin)*255/rngimport numpy as np39    return (arr-amin)*255/rngimport numpy as np
40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
41pctl = np.percentile(scores,np.arange(0,100,25))41pctl = np.percentile(scores,np.arange(0,100,25))
t42best_cultivar_indices = np.where(scores >pctl[-1])t42best_cultivar_indices, = np.where(scores>pctl[-1])
43print(f'Cultivars with the following IDs are in the top quartile with a score of43print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
44best=cultivarIDs[best_cultivar_indices]44best=cultivarIDs[best_cultivar_indices]
45best.sort()45best.sort()
46print(', '.join([str(int(x)) for x in best]))46print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 486, P-Value: 1.17e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
n5    x = np.linspace(0,13, num= 80)n5    x = np.linspace(0,13, num=80)
6    plt.xlabel('x (radians)')
7    plt.xlim([0,12.5664])
6    y = np.sin(x)8    y = np.sin(x)
n7    plt.xlabel('x (radians)')n
8    plt.ylabel('sin(x)')9    plt.ylabel('sin(x)')
n9    plt.xlim([0,12.5664])n
10    plt.ylim([-1,1])10    plt.ylim([-1,1])
11    plt.plot(x,y,'b')11    plt.plot(x,y,'b')
12    plt.savefig(filename)12    plt.savefig(filename)
13if __name__=='__main__':13if __name__=='__main__':
14    make_plot('my_plot.png')14    make_plot('my_plot.png')
15    if compare_plots('my_plot.png','instructors_plot.png'):15    if compare_plots('my_plot.png','instructors_plot.png'):
16        print('Success!')16        print('Success!')
17    else:17    else:
18        print('Keep trying.')18        print('Keep trying.')
19import matplotlib.pyplot as plt19import matplotlib.pyplot as plt
20from scipy.linalg import norm20from scipy.linalg import norm
21from scipy import sum,average21from scipy import sum,average
22def compare_plots(imagefile1,imagefile2):22def compare_plots(imagefile1,imagefile2):
23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
25    if img1.size!=img2.size:25    if img1.size!=img2.size:
26        return False26        return False
27    diff = img1 - img2  27    diff = img1 - img2  
28    nm = sum(abs(diff))  28    nm = sum(abs(diff))  
29    nz = norm(diff.ravel(), 0)  29    nz = norm(diff.ravel(), 0)  
30    return nm/img1.size < 1 and nz/img1.size < 130    return nm/img1.size < 1 and nz/img1.size < 1
31def to_grayscale(arr):31def to_grayscale(arr):
32    if len(arr.shape) == 3:32    if len(arr.shape) == 3:
33        return average(arr, -1)  33        return average(arr, -1)  
34    else:34    else:
35        return arr35        return arr
36def normalize(arr):36def normalize(arr):
37    rng = arr.max()-arr.min()37    rng = arr.max()-arr.min()
38    amin = arr.min()38    amin = arr.min()
39    return (arr-amin)*255/rngimport numpy as np39    return (arr-amin)*255/rngimport numpy as np
40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
t41quartile_boundaries = np.percentile(scores,np.arange(0,100,25))t41quartile_boundary = np.percentile(scores,np.arange(0,100,25))
42best_cultivar_indices, = np.where(scores>quartile_boundaries[-1])42best_cultivar_indices, = np.where(scores>quartile_boundary[-1])
43print(f'Cultivars with the following IDs are in the top quartile with a score of43print(f'Cultivars with the following IDs are in the top quartile with a score of
> {quartile_boundaries[-1]} or better:')> {quartile_boundary[-1]} or better:')
44best=cultivarIDs[best_cultivar_indices]44best=cultivarIDs[best_cultivar_indices]
45best.sort()45best.sort()
46print(', '.join([str(int(x)) for x in best]))46print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 224, P-Value: 1.19e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
n5    x = np.linspace(0,4*np.pi,80) n5    x = np.linspace(0,4*np.pi,80)
6    plt.plot(x,np.sin(x),'-b')  6    plt.plot(x,np.sin(x),'-b')    
7    plt.xlim(0,4*np.pi)           7    plt.xlim(0,4*np.pi)           
8    plt.ylim(-1,1)                8    plt.ylim(-1,1)                
9    plt.xlabel("x (radians)")     9    plt.xlabel("x (radians)")     
t10    plt.ylabel("sin(x)")        t10    plt.ylabel("sin(x)") 
11    plt.savefig(filename)11    plt.savefig(filename)
12if __name__=='__main__':12if __name__=='__main__':
13    make_plot('my_plot.png')13    make_plot('my_plot.png')
14    if compare_plots('my_plot.png','instructors_plot.png'):14    if compare_plots('my_plot.png','instructors_plot.png'):
15        print('Success!')15        print('Success!')
16    else:16    else:
17        print('Keep trying.')17        print('Keep trying.')
18import matplotlib.pyplot as plt18import matplotlib.pyplot as plt
19from scipy.linalg import norm19from scipy.linalg import norm
20from scipy import sum,average20from scipy import sum,average
21def compare_plots(imagefile1,imagefile2):21def compare_plots(imagefile1,imagefile2):
22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
24    if img1.size!=img2.size:24    if img1.size!=img2.size:
25        return False25        return False
26    diff = img1 - img2  26    diff = img1 - img2  
27    nm = sum(abs(diff))  27    nm = sum(abs(diff))  
28    nz = norm(diff.ravel(), 0)  28    nz = norm(diff.ravel(), 0)  
29    return nm/img1.size < 1 and nz/img1.size < 129    return nm/img1.size < 1 and nz/img1.size < 1
30def to_grayscale(arr):30def to_grayscale(arr):
31    if len(arr.shape) == 3:31    if len(arr.shape) == 3:
32        return average(arr, -1)  32        return average(arr, -1)  
33    else:33    else:
34        return arr34        return arr
35def normalize(arr):35def normalize(arr):
36    rng = arr.max()-arr.min()36    rng = arr.max()-arr.min()
37    amin = arr.min()37    amin = arr.min()
38    return (arr-amin)*255/rngimport numpy as np38    return (arr-amin)*255/rngimport numpy as np
39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
40pctl = np.percentile(scores, np.arange(0,100,25))40pctl = np.percentile(scores, np.arange(0,100,25))
41best_cultivar_indices = np.where(scores >= pctl[-1])41best_cultivar_indices = np.where(scores >= pctl[-1])
42print(f'Cultivars with the following IDs are in the top quartile with a score of42print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
43best=cultivarIDs[best_cultivar_indices]43best=cultivarIDs[best_cultivar_indices]
44best.sort()44best.sort()
45print(', '.join([str(int(x)) for x in best]))45print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 397, P-Value: 1.19e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
n3from compare_plots import compare_plotsn
4def make_plot(filename):3def make_plot(filename):
5    x = np.linspace(0, 4*np.pi, 80)4    x = np.linspace(0, 4*np.pi, 80)
6    y = np.sin(x)5    y = np.sin(x)
nn6    plt.xlim(0, 4*np.pi)
7    plt.ylim([-1.00,1.00])
7    plt.xlabel('x (radians)')8    plt.xlabel('x (radians)')
8    plt.ylabel('sin(x)')9    plt.ylabel('sin(x)')
n9    plt.xlim(0, 4*np.pi)n
10    plt.ylim(-1,1)
11    plt.plot(x, y, '-b')10    plt.plot(x, y, '-b')
12    plt.savefig(filename)11    plt.savefig(filename)
13if __name__=='__main__':12if __name__=='__main__':
14    make_plot('my_plot.png')13    make_plot('my_plot.png')
t15    if compare_plots('my_plot.png','instructors_plot.png'):t14    if compare_plots('my_plot.png', 'instructors_plot.png'):
16        print('Success!')15        print('Success')
17    else:16    else:
18        print('Keep trying.')17        print('Keep trying.')
19import matplotlib.pyplot as plt18import matplotlib.pyplot as plt
20from scipy.linalg import norm19from scipy.linalg import norm
21from scipy import sum,average20from scipy import sum,average
22def compare_plots(imagefile1,imagefile2):21def compare_plots(imagefile1,imagefile2):
23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
25    if img1.size!=img2.size:24    if img1.size!=img2.size:
26        return False25        return False
27    diff = img1 - img2  26    diff = img1 - img2  
28    nm = sum(abs(diff))  27    nm = sum(abs(diff))  
29    nz = norm(diff.ravel(), 0)  28    nz = norm(diff.ravel(), 0)  
30    return nm/img1.size < 1 and nz/img1.size < 129    return nm/img1.size < 1 and nz/img1.size < 1
31def to_grayscale(arr):30def to_grayscale(arr):
32    if len(arr.shape) == 3:31    if len(arr.shape) == 3:
33        return average(arr, -1)  32        return average(arr, -1)  
34    else:33    else:
35        return arr34        return arr
36def normalize(arr):35def normalize(arr):
37    rng = arr.max()-arr.min()36    rng = arr.max()-arr.min()
38    amin = arr.min()37    amin = arr.min()
39    return (arr-amin)*255/rngimport numpy as np38    return (arr-amin)*255/rngimport numpy as np
40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
41quartile_boundaries = np.percentile(scores,np.arange(0,100,25))40quartile_boundaries = np.percentile(scores,np.arange(0,100,25))
42top_indices, = np.where(scores>quartile_boundaries[-1])41top_indices, = np.where(scores>quartile_boundaries[-1])
43print(f'Cultivars with the following IDs are in the top quartile with a score of42print(f'Cultivars with the following IDs are in the top quartile with a score of
> {quartile_boundaries[-1]} or better:')> {quartile_boundaries[-1]} or better:')
44best=cultivarIDs[top_indices]43best=cultivarIDs[top_indices]
45best.sort()44best.sort()
46print(', '.join([str(int(x)) for x in best]))45print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 104, P-Value: 1.19e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
n5    x = np.linspace(0,4*np.pi,80)n5    x = np.linspace(0,4*np.pi,80) 
6    plt.plot(x,np.sin(x),'-b')    6    plt.plot(x,np.sin(x),'-b')  
7    plt.xlim(0,4*np.pi)           7    plt.xlim(0,4*np.pi)           
8    plt.ylim(-1,1)                8    plt.ylim(-1,1)                
9    plt.xlabel("x (radians)")     9    plt.xlabel("x (radians)")     
t10    plt.ylabel("sin(x)") t10    plt.ylabel("sin(x)")        
11    plt.savefig(filename)11    plt.savefig(filename)
12if __name__=='__main__':12if __name__=='__main__':
13    make_plot('my_plot.png')13    make_plot('my_plot.png')
14    if compare_plots('my_plot.png','instructors_plot.png'):14    if compare_plots('my_plot.png','instructors_plot.png'):
15        print('Success!')15        print('Success!')
16    else:16    else:
17        print('Keep trying.')17        print('Keep trying.')
18import matplotlib.pyplot as plt18import matplotlib.pyplot as plt
19from scipy.linalg import norm19from scipy.linalg import norm
20from scipy import sum,average20from scipy import sum,average
21def compare_plots(imagefile1,imagefile2):21def compare_plots(imagefile1,imagefile2):
22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
24    if img1.size!=img2.size:24    if img1.size!=img2.size:
25        return False25        return False
26    diff = img1 - img2  26    diff = img1 - img2  
27    nm = sum(abs(diff))  27    nm = sum(abs(diff))  
28    nz = norm(diff.ravel(), 0)  28    nz = norm(diff.ravel(), 0)  
29    return nm/img1.size < 1 and nz/img1.size < 129    return nm/img1.size < 1 and nz/img1.size < 1
30def to_grayscale(arr):30def to_grayscale(arr):
31    if len(arr.shape) == 3:31    if len(arr.shape) == 3:
32        return average(arr, -1)  32        return average(arr, -1)  
33    else:33    else:
34        return arr34        return arr
35def normalize(arr):35def normalize(arr):
36    rng = arr.max()-arr.min()36    rng = arr.max()-arr.min()
37    amin = arr.min()37    amin = arr.min()
38    return (arr-amin)*255/rngimport numpy as np38    return (arr-amin)*255/rngimport numpy as np
39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
40pctl = np.percentile(scores, np.arange(0,100,25))40pctl = np.percentile(scores, np.arange(0,100,25))
41best_cultivar_indices = np.where(scores >= pctl[-1])41best_cultivar_indices = np.where(scores >= pctl[-1])
42print(f'Cultivars with the following IDs are in the top quartile with a score of42print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
43best=cultivarIDs[best_cultivar_indices]43best=cultivarIDs[best_cultivar_indices]
44best.sort()44best.sort()
45print(', '.join([str(int(x)) for x in best]))45print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 196, P-Value: 1.19e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
nn3from compare_plots import compare_plots
3def make_plot(filename):4def make_plot(filename):
4    x = np.linspace(0, 4*np.pi, 80)5    x = np.linspace(0, 4*np.pi, 80)
5    y = np.sin(x)6    y = np.sin(x)
n6    plt.xlim(0, 4*np.pi)n
7    plt.ylim([-1.00,1.00])
8    plt.xlabel('x (radians)')7    plt.xlabel('x (radians)')
9    plt.ylabel('sin(x)')8    plt.ylabel('sin(x)')
nn9    plt.xlim(0, 4*np.pi)
10    plt.ylim(-1,1)
10    plt.plot(x, y, '-b')11    plt.plot(x, y, '-b')
11    plt.savefig(filename)12    plt.savefig(filename)
12if __name__=='__main__':13if __name__=='__main__':
13    make_plot('my_plot.png')14    make_plot('my_plot.png')
t14    if compare_plots('my_plot.png', 'instructors_plot.png'):t15    if compare_plots('my_plot.png','instructors_plot.png'):
15        print('Success')16        print('Success!')
16    else:17    else:
17        print('Keep trying.')18        print('Keep trying.')
18import matplotlib.pyplot as plt19import matplotlib.pyplot as plt
19from scipy.linalg import norm20from scipy.linalg import norm
20from scipy import sum,average21from scipy import sum,average
21def compare_plots(imagefile1,imagefile2):22def compare_plots(imagefile1,imagefile2):
22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
24    if img1.size!=img2.size:25    if img1.size!=img2.size:
25        return False26        return False
26    diff = img1 - img2  27    diff = img1 - img2  
27    nm = sum(abs(diff))  28    nm = sum(abs(diff))  
28    nz = norm(diff.ravel(), 0)  29    nz = norm(diff.ravel(), 0)  
29    return nm/img1.size < 1 and nz/img1.size < 130    return nm/img1.size < 1 and nz/img1.size < 1
30def to_grayscale(arr):31def to_grayscale(arr):
31    if len(arr.shape) == 3:32    if len(arr.shape) == 3:
32        return average(arr, -1)  33        return average(arr, -1)  
33    else:34    else:
34        return arr35        return arr
35def normalize(arr):36def normalize(arr):
36    rng = arr.max()-arr.min()37    rng = arr.max()-arr.min()
37    amin = arr.min()38    amin = arr.min()
38    return (arr-amin)*255/rngimport numpy as np39    return (arr-amin)*255/rngimport numpy as np
39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
40quartile_boundaries = np.percentile(scores,np.arange(0,100,25))41quartile_boundaries = np.percentile(scores,np.arange(0,100,25))
41top_indices, = np.where(scores>quartile_boundaries[-1])42top_indices, = np.where(scores>quartile_boundaries[-1])
42print(f'Cultivars with the following IDs are in the top quartile with a score of43print(f'Cultivars with the following IDs are in the top quartile with a score of
> {quartile_boundaries[-1]} or better:')> {quartile_boundaries[-1]} or better:')
43best=cultivarIDs[top_indices]44best=cultivarIDs[top_indices]
44best.sort()45best.sort()
45print(', '.join([str(int(x)) for x in best]))46print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 17, P-Value: 1.23e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
n5    FREQUENCY = 1/(2*np.pi)n
6    RADIAN_STEP = 1/80.05    RADIAN_STEP = 1/80.0
7    t1 = np.arange(0.0, 4*np.pi, RADIAN_STEP)6    t1 = np.arange(0.0, 4*np.pi, RADIAN_STEP)
8    wave = np.sin(t1)7    wave = np.sin(t1)
9    plt.plot(t1, wave)8    plt.plot(t1, wave)
10    plt.xlabel("x (radians)")9    plt.xlabel("x (radians)")
11    plt.ylabel("sin(x)")10    plt.ylabel("sin(x)")
12    plt.axis([0, 4*np.pi, -1.00, 1.00])11    plt.axis([0, 4*np.pi, -1.00, 1.00])
13    plt.show()12    plt.show()
14    plt.savefig(filename)13    plt.savefig(filename)
15if __name__=='__main__':14if __name__=='__main__':
16    make_plot('my_plot.png')15    make_plot('my_plot.png')
17    if compare_plots('my_plot.png','instructors_plot.png'):16    if compare_plots('my_plot.png','instructors_plot.png'):
18        print('Success!')17        print('Success!')
19    else:18    else:
20        print('Keep trying.')19        print('Keep trying.')
21import matplotlib.pyplot as plt20import matplotlib.pyplot as plt
22from scipy.linalg import norm21from scipy.linalg import norm
23from scipy import sum,average22from scipy import sum,average
24def compare_plots(imagefile1,imagefile2):23def compare_plots(imagefile1,imagefile2):
25    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))24    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
26    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))25    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
27    if img1.size!=img2.size:26    if img1.size!=img2.size:
28        return False27        return False
29    diff = img1 - img2  28    diff = img1 - img2  
30    nm = sum(abs(diff))  29    nm = sum(abs(diff))  
31    nz = norm(diff.ravel(), 0)  30    nz = norm(diff.ravel(), 0)  
32    return nm/img1.size < 1 and nz/img1.size < 131    return nm/img1.size < 1 and nz/img1.size < 1
33def to_grayscale(arr):32def to_grayscale(arr):
34    if len(arr.shape) == 3:33    if len(arr.shape) == 3:
35        return average(arr, -1)  34        return average(arr, -1)  
36    else:35    else:
37        return arr36        return arr
38def normalize(arr):37def normalize(arr):
39    rng = arr.max()-arr.min()38    rng = arr.max()-arr.min()
40    amin = arr.min()39    amin = arr.min()
41    return (arr-amin)*255/rngimport numpy as np40    return (arr-amin)*255/rngimport numpy as np
42cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='41cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
t43pctl = np.percentile(scores, np.arange(0, 100, 25))t42pctl= np.percentile(scores, np.arange(0,100,25))
44best_cultivar_indices = np.where(scores>pctl[-1])43best_cultivar_indices = np.where(scores >pctl[-1])
45print(f'Cultivars with the following IDs are in the top quartile with a score of44print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
46best=cultivarIDs[best_cultivar_indices]45best=cultivarIDs[best_cultivar_indices]
47best.sort()46best.sort()
48print(', '.join([str(int(x)) for x in best]))47print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 278, P-Value: 1.34e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
n5    x=np.linspace(0,np.pi * 4,100)n5    x = np.linspace(0,np.pi * 4,100)
6    y = np.sin(x)6    y = np.sin(x)
7    plt.plot(x,y,'b')7    plt.plot(x,y,'b')
8    plt.xlabel('x(radians)')8    plt.xlabel('x(radians)')
9    plt.ylabel('sin(x)')9    plt.ylabel('sin(x)')
10    plt.margins(0,0)10    plt.margins(0,0)
11    plt.savefig(filename)11    plt.savefig(filename)
12if __name__=='__main__':12if __name__=='__main__':
13    make_plot('my_plot.png')13    make_plot('my_plot.png')
14    if compare_plots('my_plot.png','instructors_plot.png'):14    if compare_plots('my_plot.png','instructors_plot.png'):
15        print('Success!')15        print('Success!')
16    else:16    else:
17        print('Keep trying.')17        print('Keep trying.')
18import matplotlib.pyplot as plt18import matplotlib.pyplot as plt
19from scipy.linalg import norm19from scipy.linalg import norm
20from scipy import sum,average20from scipy import sum,average
21def compare_plots(imagefile1,imagefile2):21def compare_plots(imagefile1,imagefile2):
22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
24    if img1.size!=img2.size:24    if img1.size!=img2.size:
25        return False25        return False
26    diff = img1 - img2  26    diff = img1 - img2  
27    nm = sum(abs(diff))  27    nm = sum(abs(diff))  
28    nz = norm(diff.ravel(), 0)  28    nz = norm(diff.ravel(), 0)  
29    return nm/img1.size < 1 and nz/img1.size < 129    return nm/img1.size < 1 and nz/img1.size < 1
30def to_grayscale(arr):30def to_grayscale(arr):
31    if len(arr.shape) == 3:31    if len(arr.shape) == 3:
32        return average(arr, -1)  32        return average(arr, -1)  
33    else:33    else:
34        return arr34        return arr
35def normalize(arr):35def normalize(arr):
36    rng = arr.max()-arr.min()36    rng = arr.max()-arr.min()
37    amin = arr.min()37    amin = arr.min()
38    return (arr-amin)*255/rngimport numpy as np38    return (arr-amin)*255/rngimport numpy as np
39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
t40pct1 = np.percentile(scores, np.arange(0,100,25))t40pctl = np.percentile(scores, np.arange(0,100,25))
41best_cultivar_indicies = np.where(scores >= pct1[-1])41best_cultivar_indices = np.where(scores>= pctl[-1])
42print(f'Cultivars with the following IDs are in the top quartile with a score of42print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pct1[-1]} or better:')> {pctl[-1]} or better:')
43best=cultivarIDs[best_cultivar_indicies]43best=cultivarIDs[best_cultivar_indices]
44best.sort()44best.sort()
45print(', '.join([str(int(x)) for x in best]))45print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 455, P-Value: 1.34e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
n5    x = np.linspace(0, np.pi *4, 100)n5    x = np.linspace(0,np.pi * 4,100)
6    y = np.sin(x)6    y = np.sin(x)
n7    plt.plot(x, y, '-b')n7    plt.plot(x,y,'-b')
8    plt.margins (0,0)8    plt.margins(0,0)
9    plt.xlabel('x (radians)')9    plt.xlabel('x (radians)')
10    plt.ylabel('sin(x)')10    plt.ylabel('sin(x)')
11    plt.savefig(filename)11    plt.savefig(filename)
12if __name__=='__main__':12if __name__=='__main__':
13    make_plot('my_plot.png')13    make_plot('my_plot.png')
14    if compare_plots('my_plot.png','instructors_plot.png'):14    if compare_plots('my_plot.png','instructors_plot.png'):
15        print('Success!')15        print('Success!')
16    else:16    else:
17        print('Keep trying.')17        print('Keep trying.')
18import matplotlib.pyplot as plt18import matplotlib.pyplot as plt
19from scipy.linalg import norm19from scipy.linalg import norm
20from scipy import sum,average20from scipy import sum,average
21def compare_plots(imagefile1,imagefile2):21def compare_plots(imagefile1,imagefile2):
22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
24    if img1.size!=img2.size:24    if img1.size!=img2.size:
25        return False25        return False
26    diff = img1 - img2  26    diff = img1 - img2  
27    nm = sum(abs(diff))  27    nm = sum(abs(diff))  
28    nz = norm(diff.ravel(), 0)  28    nz = norm(diff.ravel(), 0)  
29    return nm/img1.size < 1 and nz/img1.size < 129    return nm/img1.size < 1 and nz/img1.size < 1
30def to_grayscale(arr):30def to_grayscale(arr):
31    if len(arr.shape) == 3:31    if len(arr.shape) == 3:
32        return average(arr, -1)  32        return average(arr, -1)  
33    else:33    else:
34        return arr34        return arr
35def normalize(arr):35def normalize(arr):
36    rng = arr.max()-arr.min()36    rng = arr.max()-arr.min()
37    amin = arr.min()37    amin = arr.min()
38    return (arr-amin)*255/rngimport numpy as np38    return (arr-amin)*255/rngimport numpy as np
39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
t40pctl = np.percentile(scores, np.arange(0,100,25))t40pctl = np.percentile(scores, np.arange(0, 100, 25))
41best_cultivar_indices = np.where(scores >= pctl[-1])41best_cultivar_indices = np.where(scores >= pctl[-1])
42print(f'Cultivars with the following IDs are in the top quartile with a score of42print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
43best=cultivarIDs[best_cultivar_indices]43best=cultivarIDs[best_cultivar_indices]
44best.sort()44best.sort()
45print(', '.join([str(int(x)) for x in best]))45print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 492, P-Value: 1.34e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
n5    x = np.linspace(0, np.pi * 4,100)n5    x = np.linspace(0, np.pi *4, 100)
6    y = np.sin(x)6    y = np.sin(x)
n7    plt.plot(x, y, 'b')n7    plt.plot(x, y, '-b')
8    plt.margins (0,0)
8    plt.xlabel('x(radians)')9    plt.xlabel('x (radians)')
9    plt.ylabel('sin(x)')10    plt.ylabel('sin(x)')
t10    plt.margins(0, 0)t
11    plt.savefig(filename)11    plt.savefig(filename)
12if __name__=='__main__':12if __name__=='__main__':
13    make_plot('my_plot.png')13    make_plot('my_plot.png')
14    if compare_plots('my_plot.png','instructors_plot.png'):14    if compare_plots('my_plot.png','instructors_plot.png'):
15        print('Success!')15        print('Success!')
16    else:16    else:
17        print('Keep trying.')17        print('Keep trying.')
18import matplotlib.pyplot as plt18import matplotlib.pyplot as plt
19from scipy.linalg import norm19from scipy.linalg import norm
20from scipy import sum,average20from scipy import sum,average
21def compare_plots(imagefile1,imagefile2):21def compare_plots(imagefile1,imagefile2):
22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
24    if img1.size!=img2.size:24    if img1.size!=img2.size:
25        return False25        return False
26    diff = img1 - img2  26    diff = img1 - img2  
27    nm = sum(abs(diff))  27    nm = sum(abs(diff))  
28    nz = norm(diff.ravel(), 0)  28    nz = norm(diff.ravel(), 0)  
29    return nm/img1.size < 1 and nz/img1.size < 129    return nm/img1.size < 1 and nz/img1.size < 1
30def to_grayscale(arr):30def to_grayscale(arr):
31    if len(arr.shape) == 3:31    if len(arr.shape) == 3:
32        return average(arr, -1)  32        return average(arr, -1)  
33    else:33    else:
34        return arr34        return arr
35def normalize(arr):35def normalize(arr):
36    rng = arr.max()-arr.min()36    rng = arr.max()-arr.min()
37    amin = arr.min()37    amin = arr.min()
38    return (arr-amin)*255/rngimport numpy as np38    return (arr-amin)*255/rngimport numpy as np
39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
40pctl = np.percentile(scores, np.arange(0,100,25))40pctl = np.percentile(scores, np.arange(0,100,25))
41best_cultivar_indices = np.where(scores >= pctl[-1])41best_cultivar_indices = np.where(scores >= pctl[-1])
42print(f'Cultivars with the following IDs are in the top quartile with a score of42print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
43best=cultivarIDs[best_cultivar_indices]43best=cultivarIDs[best_cultivar_indices]
44best.sort()44best.sort()
45print(', '.join([str(int(x)) for x in best]))45print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 85, P-Value: 1.37e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
n5    x = np.linspace(0,4*np.pi,80)n5    x=np.linspace(0,4*np.pi,80)
6    plt.plot(x,np.sin(x),'-b')6    plt.plot(x,np.sin(x),'-b')
n7    plt.xlim(0,4*np.pi,80)n7    plt.xlim([0,4*np.pi])
8    plt.ylim([-1,1])8    plt.ylim([-1,1])
n9    plt.xlabel('x(radian)')n9    plt.xlabel('x (radians)')
10    plt.ylabel('sin(x)')10    plt.ylabel('sin(x)')
11    plt.savefig(filename)11    plt.savefig(filename)
12if __name__=='__main__':12if __name__=='__main__':
13    make_plot('my_plot.png')13    make_plot('my_plot.png')
14    if compare_plots('my_plot.png','instructors_plot.png'):14    if compare_plots('my_plot.png','instructors_plot.png'):
15        print('Success!')15        print('Success!')
16    else:16    else:
17        print('Keep trying.')17        print('Keep trying.')
18import matplotlib.pyplot as plt18import matplotlib.pyplot as plt
19from scipy.linalg import norm19from scipy.linalg import norm
20from scipy import sum,average20from scipy import sum,average
21def compare_plots(imagefile1,imagefile2):21def compare_plots(imagefile1,imagefile2):
22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
24    if img1.size!=img2.size:24    if img1.size!=img2.size:
25        return False25        return False
26    diff = img1 - img2  26    diff = img1 - img2  
27    nm = sum(abs(diff))  27    nm = sum(abs(diff))  
28    nz = norm(diff.ravel(), 0)  28    nz = norm(diff.ravel(), 0)  
29    return nm/img1.size < 1 and nz/img1.size < 129    return nm/img1.size < 1 and nz/img1.size < 1
30def to_grayscale(arr):30def to_grayscale(arr):
31    if len(arr.shape) == 3:31    if len(arr.shape) == 3:
32        return average(arr, -1)  32        return average(arr, -1)  
33    else:33    else:
34        return arr34        return arr
35def normalize(arr):35def normalize(arr):
36    rng = arr.max()-arr.min()36    rng = arr.max()-arr.min()
37    amin = arr.min()37    amin = arr.min()
38    return (arr-amin)*255/rngimport numpy as np38    return (arr-amin)*255/rngimport numpy as np
39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
t40percent = np.percentile(scores, np.arange(0,100,25))t40pctl = np.percentile(scores, np.arange(0,100,25))
41best_cultivar_indices = np.where(scores>= percent[-1])41best_cultivar_indices = np.where(scores >= pctl[-1])
42print(f'Cultivars with the following IDs are in the top quartile with a score of42print(f'Cultivars with the following IDs are in the top quartile with a score of
> {percent[-1]} or better:')> {pctl[-1]} or better:')
43best=cultivarIDs[best_cultivar_indices]43best=cultivarIDs[best_cultivar_indices]
44best.sort()44best.sort()
45print(', '.join([str(int(x)) for x in best]))45print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 461, P-Value: 1.38e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
n5    plt.axis([0,(4*np.pi),-1,1])n
6    plt.xticks(list(range(0,13,2)))5    plt.xticks(list(range(0,13,2)))
t7    plt.xlabel('x (radians)')t6    plt.axis([0,4*np.pi,-1,1])
8    plt.ylabel('sin(x)')
9    x = np.linspace(0.0, 4*np.pi, 80)7    x = np.linspace(0, 4*np.pi, 80)
10    wave = np.sin(x)8    wave_f = np.sin(x)
9    plt.xlabel('sin(x)')
10    plt.ylabel('x (radians)')
11    plt.plot(x, wave)11    plt.plot(x,wave_f)
12    plt.savefig(filename)12    plt.savefig(filename)
13if __name__=='__main__':13if __name__=='__main__':
14    make_plot('my_plot.png')14    make_plot('my_plot.png')
15    if compare_plots('my_plot.png','instructors_plot.png'):15    if compare_plots('my_plot.png','instructors_plot.png'):
16        print('Success!')16        print('Success!')
17    else:17    else:
18        print('Keep trying.')18        print('Keep trying.')
19import matplotlib.pyplot as plt19import matplotlib.pyplot as plt
20from scipy.linalg import norm20from scipy.linalg import norm
21from scipy import sum,average21from scipy import sum,average
22def compare_plots(imagefile1,imagefile2):22def compare_plots(imagefile1,imagefile2):
23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
25    if img1.size!=img2.size:25    if img1.size!=img2.size:
26        return False26        return False
27    diff = img1 - img2  27    diff = img1 - img2  
28    nm = sum(abs(diff))  28    nm = sum(abs(diff))  
29    nz = norm(diff.ravel(), 0)  29    nz = norm(diff.ravel(), 0)  
30    return nm/img1.size < 1 and nz/img1.size < 130    return nm/img1.size < 1 and nz/img1.size < 1
31def to_grayscale(arr):31def to_grayscale(arr):
32    if len(arr.shape) == 3:32    if len(arr.shape) == 3:
33        return average(arr, -1)  33        return average(arr, -1)  
34    else:34    else:
35        return arr35        return arr
36def normalize(arr):36def normalize(arr):
37    rng = arr.max()-arr.min()37    rng = arr.max()-arr.min()
38    amin = arr.min()38    amin = arr.min()
39    return (arr-amin)*255/rngimport numpy as np39    return (arr-amin)*255/rngimport numpy as np
40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
41pctl = np.percentile(scores,np.arange(0,100,25))41pctl = np.percentile(scores,np.arange(0,100,25))
42best_cultivar_indices, = np.where(scores>pctl[-1])42best_cultivar_indices, = np.where(scores>pctl[-1])
43print(f'Cultivars with the following IDs are in the top quartile with a score of43print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
44best=cultivarIDs[best_cultivar_indices]44best=cultivarIDs[best_cultivar_indices]
45best.sort()45best.sort()
46print(', '.join([str(int(x)) for x in best]))46print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 263, P-Value: 1.38e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
nn5    plt.axis([0,(4*np.pi),-1,1])
5    plt.xticks(list(range(0,13,2)))6    plt.xticks(list(range(0,13,2)))
t6    plt.axis([0,4*np.pi,-1,1])t7    plt.xlabel('x (radians)')
8    plt.ylabel('sin(x)')
7    x = np.linspace(0, 4*np.pi, 80)9    x = np.linspace(0.0, 4*np.pi, 80)
8    wave_f = np.sin(x)10    wave = np.sin(x)
9    plt.xlabel('sin(x)')
10    plt.ylabel('x (radians)')
11    plt.plot(x,wave_f)11    plt.plot(x, wave)
12    plt.savefig(filename)12    plt.savefig(filename)
13if __name__=='__main__':13if __name__=='__main__':
14    make_plot('my_plot.png')14    make_plot('my_plot.png')
15    if compare_plots('my_plot.png','instructors_plot.png'):15    if compare_plots('my_plot.png','instructors_plot.png'):
16        print('Success!')16        print('Success!')
17    else:17    else:
18        print('Keep trying.')18        print('Keep trying.')
19import matplotlib.pyplot as plt19import matplotlib.pyplot as plt
20from scipy.linalg import norm20from scipy.linalg import norm
21from scipy import sum,average21from scipy import sum,average
22def compare_plots(imagefile1,imagefile2):22def compare_plots(imagefile1,imagefile2):
23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
25    if img1.size!=img2.size:25    if img1.size!=img2.size:
26        return False26        return False
27    diff = img1 - img2  27    diff = img1 - img2  
28    nm = sum(abs(diff))  28    nm = sum(abs(diff))  
29    nz = norm(diff.ravel(), 0)  29    nz = norm(diff.ravel(), 0)  
30    return nm/img1.size < 1 and nz/img1.size < 130    return nm/img1.size < 1 and nz/img1.size < 1
31def to_grayscale(arr):31def to_grayscale(arr):
32    if len(arr.shape) == 3:32    if len(arr.shape) == 3:
33        return average(arr, -1)  33        return average(arr, -1)  
34    else:34    else:
35        return arr35        return arr
36def normalize(arr):36def normalize(arr):
37    rng = arr.max()-arr.min()37    rng = arr.max()-arr.min()
38    amin = arr.min()38    amin = arr.min()
39    return (arr-amin)*255/rngimport numpy as np39    return (arr-amin)*255/rngimport numpy as np
40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
41pctl = np.percentile(scores,np.arange(0,100,25))41pctl = np.percentile(scores,np.arange(0,100,25))
42best_cultivar_indices, = np.where(scores>pctl[-1])42best_cultivar_indices, = np.where(scores>pctl[-1])
43print(f'Cultivars with the following IDs are in the top quartile with a score of43print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
44best=cultivarIDs[best_cultivar_indices]44best=cultivarIDs[best_cultivar_indices]
45best.sort()45best.sort()
46print(', '.join([str(int(x)) for x in best]))46print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 20, P-Value: 1.45e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
n5    x = np.linspace(0,np.pi* 4,100)  n5    x = np.linspace(0,np.pi * 4,100)
6    y = np.sin(x)6    y = np.sin(x)
n7    plt.plot(x,y,'b')  n7    plt.plot(x,y,'b')
8    plt.xlabel('x(radians)')  8    plt.xlabel('x(radians)')
9    plt.ylabel('sin(x)')     9    plt.ylabel('sin(x)')
10    plt.margins(0,0)10    plt.margins(0,0)
n11    plt.savefig(filename)  n11    plt.savefig(filename)
12if __name__=='__main__':12if __name__=='__main__':
13    make_plot('my_plot.png')13    make_plot('my_plot.png')
14    if compare_plots('my_plot.png','instructors_plot.png'):14    if compare_plots('my_plot.png','instructors_plot.png'):
15        print('Success!')15        print('Success!')
16    else:16    else:
17        print('Keep trying.')17        print('Keep trying.')
18import matplotlib.pyplot as plt18import matplotlib.pyplot as plt
19from scipy.linalg import norm19from scipy.linalg import norm
20from scipy import sum,average20from scipy import sum,average
21def compare_plots(imagefile1,imagefile2):21def compare_plots(imagefile1,imagefile2):
22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
24    if img1.size!=img2.size:24    if img1.size!=img2.size:
25        return False25        return False
26    diff = img1 - img2  26    diff = img1 - img2  
27    nm = sum(abs(diff))  27    nm = sum(abs(diff))  
28    nz = norm(diff.ravel(), 0)  28    nz = norm(diff.ravel(), 0)  
29    return nm/img1.size < 1 and nz/img1.size < 129    return nm/img1.size < 1 and nz/img1.size < 1
30def to_grayscale(arr):30def to_grayscale(arr):
31    if len(arr.shape) == 3:31    if len(arr.shape) == 3:
32        return average(arr, -1)  32        return average(arr, -1)  
33    else:33    else:
34        return arr34        return arr
35def normalize(arr):35def normalize(arr):
36    rng = arr.max()-arr.min()36    rng = arr.max()-arr.min()
37    amin = arr.min()37    amin = arr.min()
38    return (arr-amin)*255/rngimport numpy as np38    return (arr-amin)*255/rngimport numpy as np
39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
t40pctl = np.percentile(scores,np.arange(0,100,25))t40pctl = np.percentile(scores, np.arange(0,100,25))
41best_cultivar_indices = np.where(scores >= pctl[-1])  41best_cultivar_indices = np.where(scores>= pctl[-1])
42print(f'Cultivars with the following IDs are in the top quartile with a score of42print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
43best=cultivarIDs[best_cultivar_indices]43best=cultivarIDs[best_cultivar_indices]
44best.sort()44best.sort()
45print(', '.join([str(int(x)) for x in best]))45print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 209, P-Value: 1.46e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
n5    x= np.linspace(0,4*np.pi,80)n5    x = np.linspace(0,4*np.pi,num=80)
6    y= np.sin(x)6    y = np.sin(x)
7    plt.plot(x,y,'b-')7    plt.plot(x, y,'-b')
8    plt.xlim([0,4*np.pi])
9    plt.ylim([-1,1])
8    plt.xlabel('x (radians)')10    plt.xlabel('x (radians)')
9    plt.ylabel('sin(x)')11    plt.ylabel('sin(x)')
n10    plt.ylim([-1,1])n
11    plt.xlim([0,4*np.pi])
12    plt.show()
13    plt.savefig(filename)12    plt.savefig(filename)
14if __name__=='__main__':13if __name__=='__main__':
15    make_plot('my_plot.png')14    make_plot('my_plot.png')
16    if compare_plots('my_plot.png','instructors_plot.png'):15    if compare_plots('my_plot.png','instructors_plot.png'):
17        print('Success!')16        print('Success!')
18    else:17    else:
19        print('Keep trying.')18        print('Keep trying.')
20import matplotlib.pyplot as plt19import matplotlib.pyplot as plt
21from scipy.linalg import norm20from scipy.linalg import norm
22from scipy import sum,average21from scipy import sum,average
23def compare_plots(imagefile1,imagefile2):22def compare_plots(imagefile1,imagefile2):
24    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
25    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
26    if img1.size!=img2.size:25    if img1.size!=img2.size:
27        return False26        return False
28    diff = img1 - img2  27    diff = img1 - img2  
29    nm = sum(abs(diff))  28    nm = sum(abs(diff))  
30    nz = norm(diff.ravel(), 0)  29    nz = norm(diff.ravel(), 0)  
31    return nm/img1.size < 1 and nz/img1.size < 130    return nm/img1.size < 1 and nz/img1.size < 1
32def to_grayscale(arr):31def to_grayscale(arr):
33    if len(arr.shape) == 3:32    if len(arr.shape) == 3:
34        return average(arr, -1)  33        return average(arr, -1)  
35    else:34    else:
36        return arr35        return arr
37def normalize(arr):36def normalize(arr):
38    rng = arr.max()-arr.min()37    rng = arr.max()-arr.min()
39    amin = arr.min()38    amin = arr.min()
40    return (arr-amin)*255/rngimport numpy as np39    return (arr-amin)*255/rngimport numpy as np
41cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
t42pctl = np.percentile(scores,np.arange(0,100,25) )t41pctl = np.percentile(scores,np.arange(0,100,25))
43best_cultivar_indices = np.where(scores> pctl[-1])42best_cultivar_indices = np.where(scores> pctl[-1])
44print(f'Cultivars with the following IDs are in the top quartile with a score of43print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
45best=cultivarIDs[best_cultivar_indices]44best=cultivarIDs[best_cultivar_indices]
46best.sort()45best.sort()
47print(', '.join([str(int(x)) for x in best]))46print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 161, P-Value: 1.51e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
n5    l=np.linspace(0,4*np.pi,80)n5    = np.linspace(0,4*np.pi,80)
6    b=np.sin(l)6    b = np.sin(a)
7    plt.xlabel('x (radians)')
8    plt.ylabel("sin(x)")7    plt.ylabel("sin(x)")
nn8    plt.xlabel("x (radians)")
9    plt.ylim(-1,1)
9    plt.xlim(0,4*np.pi)10    plt.xlim(0,4*np.pi)
n10    plt.ylim(-1,1)n
11    plt.plot(l,b,"-b")11    plt.plot(a,b,"-b")
12    plt.savefig(filename)12    plt.savefig(filename)
13if __name__=='__main__':13if __name__=='__main__':
14    make_plot('my_plot.png')14    make_plot('my_plot.png')
15    if compare_plots('my_plot.png','instructors_plot.png'):15    if compare_plots('my_plot.png','instructors_plot.png'):
16        print('Success!')16        print('Success!')
17    else:17    else:
18        print('Keep trying.')18        print('Keep trying.')
19import matplotlib.pyplot as plt19import matplotlib.pyplot as plt
20from scipy.linalg import norm20from scipy.linalg import norm
21from scipy import sum,average21from scipy import sum,average
22def compare_plots(imagefile1,imagefile2):22def compare_plots(imagefile1,imagefile2):
23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
25    if img1.size!=img2.size:25    if img1.size!=img2.size:
26        return False26        return False
27    diff = img1 - img2  27    diff = img1 - img2  
28    nm = sum(abs(diff))  28    nm = sum(abs(diff))  
29    nz = norm(diff.ravel(), 0)  29    nz = norm(diff.ravel(), 0)  
30    return nm/img1.size < 1 and nz/img1.size < 130    return nm/img1.size < 1 and nz/img1.size < 1
31def to_grayscale(arr):31def to_grayscale(arr):
32    if len(arr.shape) == 3:32    if len(arr.shape) == 3:
33        return average(arr, -1)  33        return average(arr, -1)  
34    else:34    else:
35        return arr35        return arr
36def normalize(arr):36def normalize(arr):
37    rng = arr.max()-arr.min()37    rng = arr.max()-arr.min()
38    amin = arr.min()38    amin = arr.min()
39    return (arr-amin)*255/rngimport numpy as np39    return (arr-amin)*255/rngimport numpy as np
40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
t41pctl = np.percentile(scores,np.arange(0,100,25))t41pctl = np.percentile(scores, np.arange(0,100,25))
42best_cultivar_indices, = np.where(scores>pctl[-1])42best_cultivar_indices, =np.where(scores>pctl[-1])
43print(f'Cultivars with the following IDs are in the top quartile with a score of43print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
44best=cultivarIDs[best_cultivar_indices]44best=cultivarIDs[best_cultivar_indices]
45best.sort()45best.sort()
46print(', '.join([str(int(x)) for x in best]))46print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 434, P-Value: 1.51e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
n5    = np.linspace(0,4*np.pi,80)n5    l=np.linspace(0,4*np.pi,80)
6    b = np.sin(a)6    b=np.sin(l)
7    plt.xlabel('x (radians)')
7    plt.ylabel("sin(x)")8    plt.ylabel("sin(x)")
n8    plt.xlabel("x (radians)")n9    plt.xlim(0,4*np.pi)
9    plt.ylim(-1,1)10    plt.ylim(-1,1)
n10    plt.xlim(0,4*np.pi)n
11    plt.plot(a,b,"-b")11    plt.plot(l,b,"-b")
12    plt.savefig(filename)12    plt.savefig(filename)
13if __name__=='__main__':13if __name__=='__main__':
14    make_plot('my_plot.png')14    make_plot('my_plot.png')
15    if compare_plots('my_plot.png','instructors_plot.png'):15    if compare_plots('my_plot.png','instructors_plot.png'):
16        print('Success!')16        print('Success!')
17    else:17    else:
18        print('Keep trying.')18        print('Keep trying.')
19import matplotlib.pyplot as plt19import matplotlib.pyplot as plt
20from scipy.linalg import norm20from scipy.linalg import norm
21from scipy import sum,average21from scipy import sum,average
22def compare_plots(imagefile1,imagefile2):22def compare_plots(imagefile1,imagefile2):
23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
25    if img1.size!=img2.size:25    if img1.size!=img2.size:
26        return False26        return False
27    diff = img1 - img2  27    diff = img1 - img2  
28    nm = sum(abs(diff))  28    nm = sum(abs(diff))  
29    nz = norm(diff.ravel(), 0)  29    nz = norm(diff.ravel(), 0)  
30    return nm/img1.size < 1 and nz/img1.size < 130    return nm/img1.size < 1 and nz/img1.size < 1
31def to_grayscale(arr):31def to_grayscale(arr):
32    if len(arr.shape) == 3:32    if len(arr.shape) == 3:
33        return average(arr, -1)  33        return average(arr, -1)  
34    else:34    else:
35        return arr35        return arr
36def normalize(arr):36def normalize(arr):
37    rng = arr.max()-arr.min()37    rng = arr.max()-arr.min()
38    amin = arr.min()38    amin = arr.min()
39    return (arr-amin)*255/rngimport numpy as np39    return (arr-amin)*255/rngimport numpy as np
40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
t41pctl = np.percentile(scores, np.arange(0,100,25))t41pctl = np.percentile(scores,np.arange(0,100,25))
42best_cultivar_indices, =np.where(scores>pctl[-1])42best_cultivar_indices, = np.where(scores>pctl[-1])
43print(f'Cultivars with the following IDs are in the top quartile with a score of43print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
44best=cultivarIDs[best_cultivar_indices]44best=cultivarIDs[best_cultivar_indices]
45best.sort()45best.sort()
46print(', '.join([str(int(x)) for x in best]))46print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 435, P-Value: 1.52e-01

Student (left) and Nearest Neighbor (right).


n1from cmath import pin
2import matplotlib.pyplot as plt1import matplotlib.pyplot as plt
3import numpy as np2import numpy as np
4from compare_plots import compare_plots3from compare_plots import compare_plots
5def make_plot(filename):4def make_plot(filename):
n6    plt.xlim([0, 4*(pi)])n5    plt.xlim([0, 4*(3.14159265)])
7    plt.ylim([-1.00, 1.00])6    plt.ylim([-1.00, 1.00])
8    plt.xticks(list(range(0, 13, 2)))7    plt.xticks(list(range(0, 13, 2)))
9    plt.xlabel("x (radians)")8    plt.xlabel("x (radians)")
10    plt.ylabel("sin(x)")9    plt.ylabel("sin(x)")
11    radians = np.linspace(0, 4*(3.14159265), 80)10    radians = np.linspace(0, 4*(3.14159265), 80)
12    sine = np.sin(radians)11    sine = np.sin(radians)
13    plt.plot(radians, sine, 'b-')12    plt.plot(radians, sine, 'b-')
14    plt.savefig(filename)13    plt.savefig(filename)
15if __name__=='__main__':14if __name__=='__main__':
16    make_plot('my_plot.png')15    make_plot('my_plot.png')
17    if compare_plots('my_plot.png','instructors_plot.png'):16    if compare_plots('my_plot.png','instructors_plot.png'):
18        print('Success!')17        print('Success!')
19    else:18    else:
20        print('Keep trying.')19        print('Keep trying.')
21import matplotlib.pyplot as plt20import matplotlib.pyplot as plt
22from scipy.linalg import norm21from scipy.linalg import norm
23from scipy import sum,average22from scipy import sum,average
24def compare_plots(imagefile1,imagefile2):23def compare_plots(imagefile1,imagefile2):
25    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))24    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
26    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))25    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
27    if img1.size!=img2.size:26    if img1.size!=img2.size:
28        return False27        return False
29    diff = img1 - img2  28    diff = img1 - img2  
30    nm = sum(abs(diff))  29    nm = sum(abs(diff))  
31    nz = norm(diff.ravel(), 0)  30    nz = norm(diff.ravel(), 0)  
32    return nm/img1.size < 1 and nz/img1.size < 131    return nm/img1.size < 1 and nz/img1.size < 1
33def to_grayscale(arr):32def to_grayscale(arr):
34    if len(arr.shape) == 3:33    if len(arr.shape) == 3:
35        return average(arr, -1)  34        return average(arr, -1)  
36    else:35    else:
37        return arr36        return arr
38def normalize(arr):37def normalize(arr):
39    rng = arr.max()-arr.min()38    rng = arr.max()-arr.min()
40    amin = arr.min()39    amin = arr.min()
41    return (arr-amin)*255/rngimport numpy as np40    return (arr-amin)*255/rngimport numpy as np
42cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='41cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
t43purcentile = np.percentile(scores,np.arange(0,100,25))t42pctl = np.percentile(scores,np.arange(0,100,25))
44best_cultivar_indices, = np.where(scores>purcentile[-1])43best_cultivar_indices, = np.where(scores>pctl[-1])
45print(f'Cultivars with the following IDs are in the top quartile with a score of44print(f'Cultivars with the following IDs are in the top quartile with a score of
> {purcentile[-1]} or better:')> {pctl[-1]} or better:')
46best=cultivarIDs[best_cultivar_indices]45best=cultivarIDs[best_cultivar_indices]
47best.sort()46best.sort()
48print(', '.join([str(int(x)) for x in best]))47print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 246, P-Value: 1.56e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
n5    x=np.linspace(0,4*np.pi,num=80)n5    x = np.linspace(0,4*np.pi,num=80)
6    y=np.sin(x)6    y = np.sin(x)
7    plt.plot(x, y,'-b')
8    plt.xlim([0,4*np.pi])
9    plt.ylim([-1,1])
7    plt.xlabel('x (radians)')10    plt.xlabel('x (radians)')
8    plt.ylabel('sin(x)')11    plt.ylabel('sin(x)')
n9    plt.plot(x,y,'-b')n
10    plt.ylim(-1,1)
11    plt.xlim(0,4*np.pi)
12    plt.savefig(filename)12    plt.savefig(filename)
13if __name__=='__main__':13if __name__=='__main__':
14    make_plot('my_plot.png')14    make_plot('my_plot.png')
n15    print(make_plot)n
16    if compare_plots('my_plot.png','instructors_plot.png'):15    if compare_plots('my_plot.png','instructors_plot.png'):
17        print('Success!')16        print('Success!')
18    else:17    else:
19        print('Keep trying.')18        print('Keep trying.')
20import matplotlib.pyplot as plt19import matplotlib.pyplot as plt
21from scipy.linalg import norm20from scipy.linalg import norm
22from scipy import sum,average21from scipy import sum,average
23def compare_plots(imagefile1,imagefile2):22def compare_plots(imagefile1,imagefile2):
24    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
25    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
26    if img1.size!=img2.size:25    if img1.size!=img2.size:
27        return False26        return False
28    diff = img1 - img2  27    diff = img1 - img2  
29    nm = sum(abs(diff))  28    nm = sum(abs(diff))  
30    nz = norm(diff.ravel(), 0)  29    nz = norm(diff.ravel(), 0)  
31    return nm/img1.size < 1 and nz/img1.size < 130    return nm/img1.size < 1 and nz/img1.size < 1
32def to_grayscale(arr):31def to_grayscale(arr):
33    if len(arr.shape) == 3:32    if len(arr.shape) == 3:
34        return average(arr, -1)  33        return average(arr, -1)  
35    else:34    else:
36        return arr35        return arr
37def normalize(arr):36def normalize(arr):
38    rng = arr.max()-arr.min()37    rng = arr.max()-arr.min()
39    amin = arr.min()38    amin = arr.min()
40    return (arr-amin)*255/rngimport numpy as np39    return (arr-amin)*255/rngimport numpy as np
41cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
42pctl = np.percentile(scores,np.arange(0,100,25))41pctl = np.percentile(scores,np.arange(0,100,25))
t43best_cultivar_indices, = np.where(scores>pctl[-1])t42best_cultivar_indices = np.where(scores> pctl[-1])
44print(f'Cultivars with the following IDs are in the top quartile with a score of43print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
45best=cultivarIDs[best_cultivar_indices]44best=cultivarIDs[best_cultivar_indices]
46best.sort()45best.sort()
47print(', '.join([str(int(x)) for x in best]))46print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 465, P-Value: 1.60e-01

Student (left) and Nearest Neighbor (right).


nn1import numpy as np
1import matplotlib.pyplot as plt2import matplotlib.pyplot as plt
n2import numpy as npn
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
n5    x = np.linspace(0,4*np.pi,num=80)n5    x = np.linspace(0,np.pi*4,num=80)
6    y = np.sin(x)6    y = np.sin(x)
7    plt.axis([0,np.pi*4,-1,1])7    plt.axis([0,np.pi*4,-1,1])
8    plt.plot(x,y,'-b')8    plt.plot(x,y,'-b')
9    plt.xlabel('x (radians)')9    plt.xlabel('x (radians)')
10    plt.ylabel('sin(x)')10    plt.ylabel('sin(x)')
11    plt.savefig(filename)11    plt.savefig(filename)
12if __name__=='__main__':12if __name__=='__main__':
13    make_plot('my_plot.png')13    make_plot('my_plot.png')
t14    plt.show()t
15    if compare_plots('my_plot.png','instructors_plot.png'):14    if compare_plots('my_plot.png','instructors_plot.png'):
16        print('Success!')15        print('Success!')
17    else:16    else:
18        print('Keep trying.')17        print('Keep trying.')
19import matplotlib.pyplot as plt18import matplotlib.pyplot as plt
20from scipy.linalg import norm19from scipy.linalg import norm
21from scipy import sum,average20from scipy import sum,average
22def compare_plots(imagefile1,imagefile2):21def compare_plots(imagefile1,imagefile2):
23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
25    if img1.size!=img2.size:24    if img1.size!=img2.size:
26        return False25        return False
27    diff = img1 - img2  26    diff = img1 - img2  
28    nm = sum(abs(diff))  27    nm = sum(abs(diff))  
29    nz = norm(diff.ravel(), 0)  28    nz = norm(diff.ravel(), 0)  
30    return nm/img1.size < 1 and nz/img1.size < 129    return nm/img1.size < 1 and nz/img1.size < 1
31def to_grayscale(arr):30def to_grayscale(arr):
32    if len(arr.shape) == 3:31    if len(arr.shape) == 3:
33        return average(arr, -1)  32        return average(arr, -1)  
34    else:33    else:
35        return arr34        return arr
36def normalize(arr):35def normalize(arr):
37    rng = arr.max()-arr.min()36    rng = arr.max()-arr.min()
38    amin = arr.min()37    amin = arr.min()
39    return (arr-amin)*255/rngimport numpy as np38    return (arr-amin)*255/rngimport numpy as np
40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
41my_array = scores40my_array = scores
42quartile_boundaries = np.percentile(my_array,np.arange(0,100,25))41quartile_boundaries = np.percentile(my_array,np.arange(0,100,25))
43top_indices, = np.where(my_array>quartile_boundaries[-1])42top_indices, = np.where(my_array>quartile_boundaries[-1])
44best_cultivar_indices=list(top_indices)43best_cultivar_indices=list(top_indices)
45pctl = quartile_boundaries44pctl = quartile_boundaries
46print(f'Cultivars with the following IDs are in the top quartile with a score of45print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
47best=cultivarIDs[best_cultivar_indices]46best=cultivarIDs[best_cultivar_indices]
48best.sort()47best.sort()
49print(', '.join([str(int(x)) for x in best]))48print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 137, P-Value: 1.60e-01

Student (left) and Nearest Neighbor (right).


nn1import matplotlib.pyplot as plt
1import numpy as np2import numpy as np
n2import matplotlib.pyplot as pltn
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
n5    x = np.linspace(0,np.pi*4,num=80)n5    x = np.linspace(0,4*np.pi,num=80)
6    y = np.sin(x)6    y = np.sin(x)
7    plt.axis([0,np.pi*4,-1,1])7    plt.axis([0,np.pi*4,-1,1])
8    plt.plot(x,y,'-b')8    plt.plot(x,y,'-b')
9    plt.xlabel('x (radians)')9    plt.xlabel('x (radians)')
10    plt.ylabel('sin(x)')10    plt.ylabel('sin(x)')
11    plt.savefig(filename)11    plt.savefig(filename)
12if __name__=='__main__':12if __name__=='__main__':
13    make_plot('my_plot.png')13    make_plot('my_plot.png')
tt14    plt.show()
14    if compare_plots('my_plot.png','instructors_plot.png'):15    if compare_plots('my_plot.png','instructors_plot.png'):
15        print('Success!')16        print('Success!')
16    else:17    else:
17        print('Keep trying.')18        print('Keep trying.')
18import matplotlib.pyplot as plt19import matplotlib.pyplot as plt
19from scipy.linalg import norm20from scipy.linalg import norm
20from scipy import sum,average21from scipy import sum,average
21def compare_plots(imagefile1,imagefile2):22def compare_plots(imagefile1,imagefile2):
22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
24    if img1.size!=img2.size:25    if img1.size!=img2.size:
25        return False26        return False
26    diff = img1 - img2  27    diff = img1 - img2  
27    nm = sum(abs(diff))  28    nm = sum(abs(diff))  
28    nz = norm(diff.ravel(), 0)  29    nz = norm(diff.ravel(), 0)  
29    return nm/img1.size < 1 and nz/img1.size < 130    return nm/img1.size < 1 and nz/img1.size < 1
30def to_grayscale(arr):31def to_grayscale(arr):
31    if len(arr.shape) == 3:32    if len(arr.shape) == 3:
32        return average(arr, -1)  33        return average(arr, -1)  
33    else:34    else:
34        return arr35        return arr
35def normalize(arr):36def normalize(arr):
36    rng = arr.max()-arr.min()37    rng = arr.max()-arr.min()
37    amin = arr.min()38    amin = arr.min()
38    return (arr-amin)*255/rngimport numpy as np39    return (arr-amin)*255/rngimport numpy as np
39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
40my_array = scores41my_array = scores
41quartile_boundaries = np.percentile(my_array,np.arange(0,100,25))42quartile_boundaries = np.percentile(my_array,np.arange(0,100,25))
42top_indices, = np.where(my_array>quartile_boundaries[-1])43top_indices, = np.where(my_array>quartile_boundaries[-1])
43best_cultivar_indices=list(top_indices)44best_cultivar_indices=list(top_indices)
44pctl = quartile_boundaries45pctl = quartile_boundaries
45print(f'Cultivars with the following IDs are in the top quartile with a score of46print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
46best=cultivarIDs[best_cultivar_indices]47best=cultivarIDs[best_cultivar_indices]
47best.sort()48best.sort()
48print(', '.join([str(int(x)) for x in best]))49print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 136, P-Value: 1.61e-01

Student (left) and Nearest Neighbor (right).


nn1from cmath import sin
1import matplotlib.pyplot as plt2import matplotlib.pyplot as plt
2import numpy as np3import numpy as np
3from compare_plots import compare_plots4from compare_plots import compare_plots
n4import math n
5def make_plot(filename):5def make_plot(filename):
n6    x= np.linspace(0,4*np.pi,80)n6    x=  np.linspace(0,4*np.pi,80)
7    y= np.sin(x)7    y = np.sin(x)
8    plt.plot(x, y, '-b')
9    plt.xlabel('x (radians)')
10    plt.ylabel('sin(x)')
8    plt.xlim(0,4*np.pi)11    plt.xlim(0,4*np.pi)
9    plt.ylim(-1,1)12    plt.ylim(-1,1)
t10    plt.plot(x,y,'-b')t
11    plt.xlabel('x (radians)')
12    plt.ylabel('sin(x)')
13    plt.savefig(filename)13    plt.savefig(filename)
14if __name__=='__main__':14if __name__=='__main__':
15    make_plot('my_plot.png')15    make_plot('my_plot.png')
16    if compare_plots('my_plot.png','instructors_plot.png'):16    if compare_plots('my_plot.png','instructors_plot.png'):
17        print('Success!')17        print('Success!')
18    else:18    else:
19        print('Keep trying.')19        print('Keep trying.')
20import matplotlib.pyplot as plt20import matplotlib.pyplot as plt
21from scipy.linalg import norm21from scipy.linalg import norm
22from scipy import sum,average22from scipy import sum,average
23def compare_plots(imagefile1,imagefile2):23def compare_plots(imagefile1,imagefile2):
24    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))24    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
25    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))25    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
26    if img1.size!=img2.size:26    if img1.size!=img2.size:
27        return False27        return False
28    diff = img1 - img2  28    diff = img1 - img2  
29    nm = sum(abs(diff))  29    nm = sum(abs(diff))  
30    nz = norm(diff.ravel(), 0)  30    nz = norm(diff.ravel(), 0)  
31    return nm/img1.size < 1 and nz/img1.size < 131    return nm/img1.size < 1 and nz/img1.size < 1
32def to_grayscale(arr):32def to_grayscale(arr):
33    if len(arr.shape) == 3:33    if len(arr.shape) == 3:
34        return average(arr, -1)  34        return average(arr, -1)  
35    else:35    else:
36        return arr36        return arr
37def normalize(arr):37def normalize(arr):
38    rng = arr.max()-arr.min()38    rng = arr.max()-arr.min()
39    amin = arr.min()39    amin = arr.min()
40    return (arr-amin)*255/rngimport numpy as np40    return (arr-amin)*255/rngimport numpy as np
41cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='41cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
42pctl = np.percentile(scores,np.arange(0,100,25))42pctl = np.percentile(scores,np.arange(0,100,25))
43best_cultivar_indices, = np.where(scores>pctl[-1])43best_cultivar_indices, = np.where(scores>pctl[-1])
44print(f'Cultivars with the following IDs are in the top quartile with a score of44print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
45best=cultivarIDs[best_cultivar_indices]45best=cultivarIDs[best_cultivar_indices]
46best.sort()46best.sort()
47print(', '.join([str(int(x)) for x in best]))47print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 320, P-Value: 1.61e-01

Student (left) and Nearest Neighbor (right).


n1from cmath import sinn
2import matplotlib.pyplot as plt1import matplotlib.pyplot as plt
3import numpy as np2import numpy as np
4from compare_plots import compare_plots3from compare_plots import compare_plots
nn4import math 
5def make_plot(filename):5def make_plot(filename):
n6    x=  np.linspace(0,4*np.pi,80)n6    x= np.linspace(0,4*np.pi,80)
7    y = np.sin(x)7    y= np.sin(x)
8    plt.xlim(0,4*np.pi)
9    plt.ylim(-1,1)
8    plt.plot(x, y, '-b')10    plt.plot(x,y,'-b')
9    plt.xlabel('x (radians)')11    plt.xlabel('x (radians)')
10    plt.ylabel('sin(x)')12    plt.ylabel('sin(x)')
t11    plt.xlim(0,4*np.pi)t
12    plt.ylim(-1,1)
13    plt.savefig(filename)13    plt.savefig(filename)
14if __name__=='__main__':14if __name__=='__main__':
15    make_plot('my_plot.png')15    make_plot('my_plot.png')
16    if compare_plots('my_plot.png','instructors_plot.png'):16    if compare_plots('my_plot.png','instructors_plot.png'):
17        print('Success!')17        print('Success!')
18    else:18    else:
19        print('Keep trying.')19        print('Keep trying.')
20import matplotlib.pyplot as plt20import matplotlib.pyplot as plt
21from scipy.linalg import norm21from scipy.linalg import norm
22from scipy import sum,average22from scipy import sum,average
23def compare_plots(imagefile1,imagefile2):23def compare_plots(imagefile1,imagefile2):
24    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))24    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
25    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))25    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
26    if img1.size!=img2.size:26    if img1.size!=img2.size:
27        return False27        return False
28    diff = img1 - img2  28    diff = img1 - img2  
29    nm = sum(abs(diff))  29    nm = sum(abs(diff))  
30    nz = norm(diff.ravel(), 0)  30    nz = norm(diff.ravel(), 0)  
31    return nm/img1.size < 1 and nz/img1.size < 131    return nm/img1.size < 1 and nz/img1.size < 1
32def to_grayscale(arr):32def to_grayscale(arr):
33    if len(arr.shape) == 3:33    if len(arr.shape) == 3:
34        return average(arr, -1)  34        return average(arr, -1)  
35    else:35    else:
36        return arr36        return arr
37def normalize(arr):37def normalize(arr):
38    rng = arr.max()-arr.min()38    rng = arr.max()-arr.min()
39    amin = arr.min()39    amin = arr.min()
40    return (arr-amin)*255/rngimport numpy as np40    return (arr-amin)*255/rngimport numpy as np
41cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='41cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
42pctl = np.percentile(scores,np.arange(0,100,25))42pctl = np.percentile(scores,np.arange(0,100,25))
43best_cultivar_indices, = np.where(scores>pctl[-1])43best_cultivar_indices, = np.where(scores>pctl[-1])
44print(f'Cultivars with the following IDs are in the top quartile with a score of44print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
45best=cultivarIDs[best_cultivar_indices]45best=cultivarIDs[best_cultivar_indices]
46best.sort()46best.sort()
47print(', '.join([str(int(x)) for x in best]))47print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 405, P-Value: 1.62e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3def make_plot(filename):3def make_plot(filename):
4        x = np.linspace(0,np.pi * 4,100)4        x = np.linspace(0,np.pi * 4,100)
5        y = np.sin(x)5        y = np.sin(x)
6        plt.plot(x,y,'b')6        plt.plot(x,y,'b')
7        plt.xlabel('x(radians)')7        plt.xlabel('x(radians)')
8        plt.ylabel('sin(x)')8        plt.ylabel('sin(x)')
9        plt.margins(0,0)9        plt.margins(0,0)
10        plt.savefig(filename) 10        plt.savefig(filename) 
11if __name__=='__main__':11if __name__=='__main__':
12        make_plot('my_plot.png')12        make_plot('my_plot.png')
13import matplotlib.pyplot as plt13import matplotlib.pyplot as plt
14from scipy.linalg import norm14from scipy.linalg import norm
15from scipy import sum,average15from scipy import sum,average
16def compare_plots(imagefile1,imagefile2):16def compare_plots(imagefile1,imagefile2):
17    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))17    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
18    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))18    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
19    if img1.size!=img2.size:19    if img1.size!=img2.size:
20        return False20        return False
21    diff = img1 - img2  21    diff = img1 - img2  
22    nm = sum(abs(diff))  22    nm = sum(abs(diff))  
23    nz = norm(diff.ravel(), 0)  23    nz = norm(diff.ravel(), 0)  
24    return nm/img1.size < 1 and nz/img1.size < 124    return nm/img1.size < 1 and nz/img1.size < 1
25def to_grayscale(arr):25def to_grayscale(arr):
26    if len(arr.shape) == 3:26    if len(arr.shape) == 3:
27        return average(arr, -1)  27        return average(arr, -1)  
28    else:28    else:
29        return arr29        return arr
30def normalize(arr):30def normalize(arr):
31    rng = arr.max()-arr.min()31    rng = arr.max()-arr.min()
32    amin = arr.min()32    amin = arr.min()
33    return (arr-amin)*255/rngimport numpy as np33    return (arr-amin)*255/rngimport numpy as np
t34cultivarIDs, scores = np.loadtxt('cultivar_test_scores.csv', dtype='int,int', det34cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>limiter=',', usecols=(0, 1),unpack =True)>,')
35pctl = np.percentile(scores,np.arange(0,100,25))  35pctl = np.percentile(scores,np.arange(0,100,25))
36best_cultivar_indices = np.where(scores>=pctl[-1])   36best_cultivar_indices = np.where(scores >= pctl[-1])
37print(f'Cultivars with the following IDs are in the top quartite with a score of37print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')   > {pctl[-1]} or better:')
38best = cultivarIDs[best_cultivar_indices]   38best=cultivarIDs[best_cultivar_indices]
39best.sort()   39best.sort()
40print(','.join([str(int(x)) for x in best]))  40print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 467, P-Value: 1.63e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
n5    x = np.linspace(0, (4*np.pi), 80)n5    x = np.linspace(0,4*np.pi,80)
6    y = np.sin(x)6    y = np.sin(x)
n7    plt.xlim([0, (4*np.pi)])n7    plt.plot(x,y,'-b', )
8    plt.ylim([-1.00, 1.00])
9    plt.xlabel('x (radians)')8    plt.xlabel('x (radians)')
10    plt.ylabel('sin(x)')9    plt.ylabel('sin(x)')
t11    plt.plot(x, y, '-b', )t10    plt.xlim([0,4*np.pi])
11    plt.ylim([-1,1])
12    plt.savefig(filename)12    plt.savefig(filename)
13if __name__=='__main__':13if __name__=='__main__':
14    make_plot('my_plot.png')14    make_plot('my_plot.png')
15    if compare_plots('my_plot.png','instructors_plot.png'):15    if compare_plots('my_plot.png','instructors_plot.png'):
16        print('Success!')16        print('Success!')
17    else:17    else:
18        print('Keep trying.')18        print('Keep trying.')
19import matplotlib.pyplot as plt19import matplotlib.pyplot as plt
20from scipy.linalg import norm20from scipy.linalg import norm
21from scipy import sum,average21from scipy import sum,average
22def compare_plots(imagefile1,imagefile2):22def compare_plots(imagefile1,imagefile2):
23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
25    if img1.size!=img2.size:25    if img1.size!=img2.size:
26        return False26        return False
27    diff = img1 - img2  27    diff = img1 - img2  
28    nm = sum(abs(diff))  28    nm = sum(abs(diff))  
29    nz = norm(diff.ravel(), 0)  29    nz = norm(diff.ravel(), 0)  
30    return nm/img1.size < 1 and nz/img1.size < 130    return nm/img1.size < 1 and nz/img1.size < 1
31def to_grayscale(arr):31def to_grayscale(arr):
32    if len(arr.shape) == 3:32    if len(arr.shape) == 3:
33        return average(arr, -1)  33        return average(arr, -1)  
34    else:34    else:
35        return arr35        return arr
36def normalize(arr):36def normalize(arr):
37    rng = arr.max()-arr.min()37    rng = arr.max()-arr.min()
38    amin = arr.min()38    amin = arr.min()
39    return (arr-amin)*255/rngimport numpy as np39    return (arr-amin)*255/rngimport numpy as np
40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
41pctl = np.percentile(scores, np.arange(0,100,25))41pctl = np.percentile(scores, np.arange(0,100,25))
42best_cultivar_indices = np.where(scores >= pctl[-1])42best_cultivar_indices = np.where(scores >= pctl[-1])
43print(f'Cultivars with the following IDs are in the top quartile with a score of43print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
44best=cultivarIDs[best_cultivar_indices]44best=cultivarIDs[best_cultivar_indices]
45best.sort()45best.sort()
46print(', '.join([str(int(x)) for x in best]))46print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 167, P-Value: 1.63e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
nn5    x = np.arange(0,4 *np.pi,0.01)
6    y = np.sin(x)
7    plt.plot(x,y)
8    plt.ylim([-1,1])
5    plt.xlabel('x(radians)')9    plt.xlabel('x (radians)')
6    plt.ylabel('sin(x)')10    plt.ylabel('sin(x)')
t7    x = np.arange(0,13,0.1)t
8    plt.xlim([0,12.57])11    plt.xlim([0,4*np.pi])
9    plt.ylim([-1.00,1.00])
10    y = np.sin(x) 
11    plt.plot(x,y,"-b")
12    plt.savefig(filename)12    plt.savefig(filename)
13if __name__=='__main__':13if __name__=='__main__':
14    make_plot('my_plot.png')14    make_plot('my_plot.png')
15    if compare_plots('my_plot.png','instructors_plot.png'):15    if compare_plots('my_plot.png','instructors_plot.png'):
16        print('Success!')16        print('Success!')
17    else:17    else:
18        print('Keep trying.')18        print('Keep trying.')
19import matplotlib.pyplot as plt19import matplotlib.pyplot as plt
20from scipy.linalg import norm20from scipy.linalg import norm
21from scipy import sum,average21from scipy import sum,average
22def compare_plots(imagefile1,imagefile2):22def compare_plots(imagefile1,imagefile2):
23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
25    if img1.size!=img2.size:25    if img1.size!=img2.size:
26        return False26        return False
27    diff = img1 - img2  27    diff = img1 - img2  
28    nm = sum(abs(diff))  28    nm = sum(abs(diff))  
29    nz = norm(diff.ravel(), 0)  29    nz = norm(diff.ravel(), 0)  
30    return nm/img1.size < 1 and nz/img1.size < 130    return nm/img1.size < 1 and nz/img1.size < 1
31def to_grayscale(arr):31def to_grayscale(arr):
32    if len(arr.shape) == 3:32    if len(arr.shape) == 3:
33        return average(arr, -1)  33        return average(arr, -1)  
34    else:34    else:
35        return arr35        return arr
36def normalize(arr):36def normalize(arr):
37    rng = arr.max()-arr.min()37    rng = arr.max()-arr.min()
38    amin = arr.min()38    amin = arr.min()
39    return (arr-amin)*255/rngimport numpy as np39    return (arr-amin)*255/rngimport numpy as np
40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
41pctl = np.percentile(scores,np.arange(0,100,25))41pctl = np.percentile(scores,np.arange(0,100,25))
42best_cultivar_indices, = np.where(scores>pctl[-1])42best_cultivar_indices, = np.where(scores>pctl[-1])
43print(f'Cultivars with the following IDs are in the top quartile with a score of43print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
44best=cultivarIDs[best_cultivar_indices]44best=cultivarIDs[best_cultivar_indices]
45best.sort()45best.sort()
46print(', '.join([str(int(x)) for x in best]))46print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 420, P-Value: 1.68e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
n5    x = np.linspace(0,np.pi*4,100)n5    x = np.linspace(0,np.pi * 4,100)
6    y= np.sin(x)6    y = np.sin(x)
7    plt.plot(x,y,'b')7    plt.plot(x,y,'b')
n8    plt.xlabel('x (radians)')n8    plt.xlabel('x(radians)')
9    plt.ylabel('sin(x)')9    plt.ylabel('sin(x)')
10    plt.margins(0,0)10    plt.margins(0,0)
11    plt.savefig(filename)11    plt.savefig(filename)
12if __name__=='__main__':12if __name__=='__main__':
13    make_plot('my_plot.png')13    make_plot('my_plot.png')
14    if compare_plots('my_plot.png','instructors_plot.png'):14    if compare_plots('my_plot.png','instructors_plot.png'):
15        print('Success!')15        print('Success!')
16    else:16    else:
17        print('Keep trying.')17        print('Keep trying.')
18import matplotlib.pyplot as plt18import matplotlib.pyplot as plt
19from scipy.linalg import norm19from scipy.linalg import norm
20from scipy import sum,average20from scipy import sum,average
21def compare_plots(imagefile1,imagefile2):21def compare_plots(imagefile1,imagefile2):
22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
24    if img1.size!=img2.size:24    if img1.size!=img2.size:
25        return False25        return False
26    diff = img1 - img2  26    diff = img1 - img2  
27    nm = sum(abs(diff))  27    nm = sum(abs(diff))  
28    nz = norm(diff.ravel(), 0)  28    nz = norm(diff.ravel(), 0)  
29    return nm/img1.size < 1 and nz/img1.size < 129    return nm/img1.size < 1 and nz/img1.size < 1
30def to_grayscale(arr):30def to_grayscale(arr):
31    if len(arr.shape) == 3:31    if len(arr.shape) == 3:
32        return average(arr, -1)  32        return average(arr, -1)  
33    else:33    else:
34        return arr34        return arr
35def normalize(arr):35def normalize(arr):
36    rng = arr.max()-arr.min()36    rng = arr.max()-arr.min()
37    amin = arr.min()37    amin = arr.min()
38    return (arr-amin)*255/rngimport numpy as np38    return (arr-amin)*255/rngimport numpy as np
39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
t40percentil= np.percentile(scores,np.arange(0,100,25))t40pctl=np.percentile(scores,np.arange(0,100,25))
41best_cultivar_indices = np.where(scores>percentile[-1])41best_cultivar_indices=np.where(scores>=pctl[-1])
42print(f'Cultivars with the following IDs are in the top quartile with a score of42print(f'Cultivars with the following IDs are in the top quartile with a score of
> {percentile[-1]} or better:')> {pctl[-1]} or better:')
43best=cultivarIDs[best_cultivar_indices]43best=cultivarIDs[best_cultivar_indices]
44best.sort()44best.sort()
45print(', '.join([str(int(x)) for x in best]))45print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 250, P-Value: 1.72e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
nn5    x = np.linspace(0, 4*np.pi, 80)
6    y = np.sin(x)
7    plt.xlabel('x (radians)')
8    plt.ylabel('sin(x)')
5    plt.xlim(0, 4*np.pi)9    plt.xlim(0, 4*np.pi)
6    plt.ylim(-1,1)10    plt.ylim(-1,1)
n7    x = np.linspace(0, 4*np.pi, num = 80)n
8    y = np.sin(x)
9    plt.plot(x, y, '-b')11    plt.plot(x, y, '-b')
n10    plt.xlabel('x (radians)')n
11    plt.ylabel('sin(x)')
12    plt.savefig(filename)12    plt.savefig(filename)
13if __name__=='__main__':13if __name__=='__main__':
14    make_plot('my_plot.png')14    make_plot('my_plot.png')
15    if compare_plots('my_plot.png','instructors_plot.png'):15    if compare_plots('my_plot.png','instructors_plot.png'):
16        print('Success!')16        print('Success!')
17    else:17    else:
18        print('Keep trying.')18        print('Keep trying.')
19import matplotlib.pyplot as plt19import matplotlib.pyplot as plt
20from scipy.linalg import norm20from scipy.linalg import norm
21from scipy import sum,average21from scipy import sum,average
22def compare_plots(imagefile1,imagefile2):22def compare_plots(imagefile1,imagefile2):
23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
25    if img1.size!=img2.size:25    if img1.size!=img2.size:
26        return False26        return False
27    diff = img1 - img2  27    diff = img1 - img2  
28    nm = sum(abs(diff))  28    nm = sum(abs(diff))  
29    nz = norm(diff.ravel(), 0)  29    nz = norm(diff.ravel(), 0)  
30    return nm/img1.size < 1 and nz/img1.size < 130    return nm/img1.size < 1 and nz/img1.size < 1
31def to_grayscale(arr):31def to_grayscale(arr):
32    if len(arr.shape) == 3:32    if len(arr.shape) == 3:
33        return average(arr, -1)  33        return average(arr, -1)  
34    else:34    else:
35        return arr35        return arr
36def normalize(arr):36def normalize(arr):
37    rng = arr.max()-arr.min()37    rng = arr.max()-arr.min()
38    amin = arr.min()38    amin = arr.min()
39    return (arr-amin)*255/rngimport numpy as np39    return (arr-amin)*255/rngimport numpy as np
40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
t41my_array = scorest
42quartile_boundaries = np.percentile(my_array,np.arange(0,100,25))41quartile_boundaries = np.percentile(scores,np.arange(0,100,25))
43top_indices, = np.where(my_array>quartile_boundaries[-1])42top_indices, = np.where(scores>quartile_boundaries[-1])
44print(f'Cultivars with the following IDs are in the top quartile with a score of43print(f'Cultivars with the following IDs are in the top quartile with a score of
> {quartile_boundaries[-1]} or better:')> {quartile_boundaries[-1]} or better:')
45best=cultivarIDs[top_indices]44best=cultivarIDs[top_indices]
46best.sort()45best.sort()
47print(', '.join([str(int(x)) for x in best]))46print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 228, P-Value: 1.79e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
n4x = np.linspace(0,4*np.pi,80)n
5def make_plot(filename): 4def make_plot(filename):
5    x = np.linspace(0, 4*np.pi, 80) 
6    plt.plot(x,np.sin(x),'-b')6    plt.plot(x,np.sin(x), 'b-')
7    plt.axis([0,4*np.pi,-1,1])7    plt.axis([0,4*np.pi,-1,1])
8    plt.xlabel('x (radians)')8    plt.xlabel('x (radians)')
9    plt.ylabel('sin(x)')9    plt.ylabel('sin(x)')
10    plt.savefig(filename)10    plt.savefig(filename)
11if __name__=='__main__':11if __name__=='__main__':
12    make_plot('my_plot.png')12    make_plot('my_plot.png')
13    if compare_plots('my_plot.png','instructors_plot.png'):13    if compare_plots('my_plot.png','instructors_plot.png'):
14        print('Success!')14        print('Success!')
15    else:15    else:
16        print('Keep trying.')16        print('Keep trying.')
17import matplotlib.pyplot as plt17import matplotlib.pyplot as plt
18from scipy.linalg import norm18from scipy.linalg import norm
19from scipy import sum,average19from scipy import sum,average
20def compare_plots(imagefile1,imagefile2):20def compare_plots(imagefile1,imagefile2):
21    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))21    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
22    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))22    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
23    if img1.size!=img2.size:23    if img1.size!=img2.size:
24        return False24        return False
25    diff = img1 - img2  25    diff = img1 - img2  
26    nm = sum(abs(diff))  26    nm = sum(abs(diff))  
27    nz = norm(diff.ravel(), 0)  27    nz = norm(diff.ravel(), 0)  
28    return nm/img1.size < 1 and nz/img1.size < 128    return nm/img1.size < 1 and nz/img1.size < 1
29def to_grayscale(arr):29def to_grayscale(arr):
30    if len(arr.shape) == 3:30    if len(arr.shape) == 3:
31        return average(arr, -1)  31        return average(arr, -1)  
32    else:32    else:
33        return arr33        return arr
34def normalize(arr):34def normalize(arr):
35    rng = arr.max()-arr.min()35    rng = arr.max()-arr.min()
36    amin = arr.min()36    amin = arr.min()
37    return (arr-amin)*255/rngimport numpy as np37    return (arr-amin)*255/rngimport numpy as np
38cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='38cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
t39quartile_boundaries = np.percentile(scores,np.arange(0,100,25))t39quartile_boundaries = np.percentile(scores,np.arange(0,100,75))
40best_cultivar_indices, = np.where(scores>quartile_boundaries[-1])40best_cultivar_indices, = np.where(scores>quartile_boundaries[-1])
41print(f'Cultivars with the following IDs are in the top quartile with a score of41print(f'Cultivars with the following IDs are in the top quartile with a score of
> {quartile_boundaries[-1]} or better:')> {quartile_boundaries[-1]} or better:')
42best=cultivarIDs[best_cultivar_indices]42best=cultivarIDs[best_cultivar_indices]
43best.sort()43best.sort()
44print(', '.join([str(int(x)) for x in best]))44print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 483, P-Value: 1.79e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
nn4x = np.linspace(0,4*np.pi,80)
4def make_plot(filename):5def make_plot(filename): 
5    x = np.linspace(0, 4*np.pi, 80) 
6    plt.plot(x,np.sin(x), 'b-')6    plt.plot(x,np.sin(x),'-b')
7    plt.axis([0,4*np.pi,-1,1])7    plt.axis([0,4*np.pi,-1,1])
8    plt.xlabel('x (radians)')8    plt.xlabel('x (radians)')
9    plt.ylabel('sin(x)')9    plt.ylabel('sin(x)')
10    plt.savefig(filename)10    plt.savefig(filename)
11if __name__=='__main__':11if __name__=='__main__':
12    make_plot('my_plot.png')12    make_plot('my_plot.png')
13    if compare_plots('my_plot.png','instructors_plot.png'):13    if compare_plots('my_plot.png','instructors_plot.png'):
14        print('Success!')14        print('Success!')
15    else:15    else:
16        print('Keep trying.')16        print('Keep trying.')
17import matplotlib.pyplot as plt17import matplotlib.pyplot as plt
18from scipy.linalg import norm18from scipy.linalg import norm
19from scipy import sum,average19from scipy import sum,average
20def compare_plots(imagefile1,imagefile2):20def compare_plots(imagefile1,imagefile2):
21    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))21    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
22    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))22    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
23    if img1.size!=img2.size:23    if img1.size!=img2.size:
24        return False24        return False
25    diff = img1 - img2  25    diff = img1 - img2  
26    nm = sum(abs(diff))  26    nm = sum(abs(diff))  
27    nz = norm(diff.ravel(), 0)  27    nz = norm(diff.ravel(), 0)  
28    return nm/img1.size < 1 and nz/img1.size < 128    return nm/img1.size < 1 and nz/img1.size < 1
29def to_grayscale(arr):29def to_grayscale(arr):
30    if len(arr.shape) == 3:30    if len(arr.shape) == 3:
31        return average(arr, -1)  31        return average(arr, -1)  
32    else:32    else:
33        return arr33        return arr
34def normalize(arr):34def normalize(arr):
35    rng = arr.max()-arr.min()35    rng = arr.max()-arr.min()
36    amin = arr.min()36    amin = arr.min()
37    return (arr-amin)*255/rngimport numpy as np37    return (arr-amin)*255/rngimport numpy as np
38cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='38cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
t39quartile_boundaries = np.percentile(scores,np.arange(0,100,75))t39quartile_boundaries = np.percentile(scores,np.arange(0,100,25))
40best_cultivar_indices, = np.where(scores>quartile_boundaries[-1])40best_cultivar_indices, = np.where(scores>quartile_boundaries[-1])
41print(f'Cultivars with the following IDs are in the top quartile with a score of41print(f'Cultivars with the following IDs are in the top quartile with a score of
> {quartile_boundaries[-1]} or better:')> {quartile_boundaries[-1]} or better:')
42best=cultivarIDs[best_cultivar_indices]42best=cultivarIDs[best_cultivar_indices]
43best.sort()43best.sort()
44print(', '.join([str(int(x)) for x in best]))44print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 101, P-Value: 1.85e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
5    x = np.linspace(0,4*np.pi,80)5    x = np.linspace(0,4*np.pi,80)
6    y = np.sin(x)6    y = np.sin(x)
n7    plt.plot(x,y,'-b')n
8    plt.xlim([0,4*np.pi])7    plt.xlim([0,4*np.pi])
9    plt.ylim([-1,1])8    plt.ylim([-1,1])
nn9    plt.plot(x, y)
10    plt.xlabel('x (radians)')10    plt.xlabel('x (radians)')
11    plt.ylabel('sin(x)')11    plt.ylabel('sin(x)')
nn12    plt.savefig(filename)
12    plt.show()13    plt.show()
n13    plt.savefig(filename)n
14if __name__=='__main__':14if __name__=='__main__':
15    make_plot('my_plot.png')15    make_plot('my_plot.png')
16    if compare_plots('my_plot.png','instructors_plot.png'):16    if compare_plots('my_plot.png','instructors_plot.png'):
17        print('Success!')17        print('Success!')
18    else:18    else:
19        print('Keep trying.')19        print('Keep trying.')
20import matplotlib.pyplot as plt20import matplotlib.pyplot as plt
21from scipy.linalg import norm21from scipy.linalg import norm
22from scipy import sum,average22from scipy import sum,average
23def compare_plots(imagefile1,imagefile2):23def compare_plots(imagefile1,imagefile2):
24    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))24    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
25    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))25    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
26    if img1.size!=img2.size:26    if img1.size!=img2.size:
27        return False27        return False
28    diff = img1 - img2  28    diff = img1 - img2  
29    nm = sum(abs(diff))  29    nm = sum(abs(diff))  
30    nz = norm(diff.ravel(), 0)  30    nz = norm(diff.ravel(), 0)  
31    return nm/img1.size < 1 and nz/img1.size < 131    return nm/img1.size < 1 and nz/img1.size < 1
32def to_grayscale(arr):32def to_grayscale(arr):
33    if len(arr.shape) == 3:33    if len(arr.shape) == 3:
34        return average(arr, -1)  34        return average(arr, -1)  
35    else:35    else:
36        return arr36        return arr
37def normalize(arr):37def normalize(arr):
38    rng = arr.max()-arr.min()38    rng = arr.max()-arr.min()
39    amin = arr.min()39    amin = arr.min()
40    return (arr-amin)*255/rngimport numpy as np40    return (arr-amin)*255/rngimport numpy as np
41cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='41cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
42quartile_boundaries = np.percentile(scores,np.arange(0,100,25))42quartile_boundaries = np.percentile(scores,np.arange(0,100,25))
43best_cultivar_indices, = np.where(scores>quartile_boundaries[-1])43best_cultivar_indices, = np.where(scores>quartile_boundaries[-1])
tt44pctl = quartile_boundaries
44print(f'Cultivars with the following IDs are in the top quartile with a score of45print(f'Cultivars with the following IDs are in the top quartile with a score of
> {quartile_boundaries[-1]} or better:')> {pctl[-1]} or better:')
45best=cultivarIDs[best_cultivar_indices]46best=cultivarIDs[best_cultivar_indices]
46best.sort()47best.sort()
47print(', '.join([str(int(x)) for x in best]))48print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 13, P-Value: 1.85e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
5    x = np.linspace(0,4*np.pi,80)5    x = np.linspace(0,4*np.pi,80)
6    y = np.sin(x)6    y = np.sin(x)
nn7    plt.plot(x,y,'-b')
7    plt.xlim([0,4*np.pi])8    plt.xlim([0,4*np.pi])
8    plt.ylim([-1,1])9    plt.ylim([-1,1])
n9    plt.plot(x, y)n
10    plt.xlabel('x (radians)')10    plt.xlabel('x (radians)')
11    plt.ylabel('sin(x)')11    plt.ylabel('sin(x)')
nn12    plt.show()
12    plt.savefig(filename)13    plt.savefig(filename)
n13    plt.show()n
14if __name__=='__main__':14if __name__=='__main__':
15    make_plot('my_plot.png')15    make_plot('my_plot.png')
16    if compare_plots('my_plot.png','instructors_plot.png'):16    if compare_plots('my_plot.png','instructors_plot.png'):
17        print('Success!')17        print('Success!')
18    else:18    else:
19        print('Keep trying.')19        print('Keep trying.')
20import matplotlib.pyplot as plt20import matplotlib.pyplot as plt
21from scipy.linalg import norm21from scipy.linalg import norm
22from scipy import sum,average22from scipy import sum,average
23def compare_plots(imagefile1,imagefile2):23def compare_plots(imagefile1,imagefile2):
24    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))24    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
25    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))25    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
26    if img1.size!=img2.size:26    if img1.size!=img2.size:
27        return False27        return False
28    diff = img1 - img2  28    diff = img1 - img2  
29    nm = sum(abs(diff))  29    nm = sum(abs(diff))  
30    nz = norm(diff.ravel(), 0)  30    nz = norm(diff.ravel(), 0)  
31    return nm/img1.size < 1 and nz/img1.size < 131    return nm/img1.size < 1 and nz/img1.size < 1
32def to_grayscale(arr):32def to_grayscale(arr):
33    if len(arr.shape) == 3:33    if len(arr.shape) == 3:
34        return average(arr, -1)  34        return average(arr, -1)  
35    else:35    else:
36        return arr36        return arr
37def normalize(arr):37def normalize(arr):
38    rng = arr.max()-arr.min()38    rng = arr.max()-arr.min()
39    amin = arr.min()39    amin = arr.min()
40    return (arr-amin)*255/rngimport numpy as np40    return (arr-amin)*255/rngimport numpy as np
41cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='41cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
42quartile_boundaries = np.percentile(scores,np.arange(0,100,25))42quartile_boundaries = np.percentile(scores,np.arange(0,100,25))
43best_cultivar_indices, = np.where(scores>quartile_boundaries[-1])43best_cultivar_indices, = np.where(scores>quartile_boundaries[-1])
t44pctl = quartile_boundariest
45print(f'Cultivars with the following IDs are in the top quartile with a score of44print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {quartile_boundaries[-1]} or better:')
46best=cultivarIDs[best_cultivar_indices]45best=cultivarIDs[best_cultivar_indices]
47best.sort()46best.sort()
48print(', '.join([str(int(x)) for x in best]))47print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 65, P-Value: 1.87e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
5    plt.xlim([0, 4*(3.14159265)])5    plt.xlim([0, 4*(3.14159265)])
n6    plt.ylim([-1.00,1.00])n6    plt.ylim([-1.00, 1.00])
7    plt.xticks(list(range(0, 13, 2)))7    plt.xticks(list(range(0, 13, 2)))
8    plt.xlabel("x (radians)")8    plt.xlabel("x (radians)")
9    plt.ylabel("sin(x)")9    plt.ylabel("sin(x)")
10    radians = np.linspace(0, 4*(3.14159265), 80)10    radians = np.linspace(0, 4*(3.14159265), 80)
11    sine = np.sin(radians)11    sine = np.sin(radians)
12    plt.plot(radians, sine, 'b-')12    plt.plot(radians, sine, 'b-')
13    plt.savefig(filename)13    plt.savefig(filename)
14if __name__=='__main__':14if __name__=='__main__':
15    make_plot('my_plot.png')15    make_plot('my_plot.png')
16    if compare_plots('my_plot.png','instructors_plot.png'):16    if compare_plots('my_plot.png','instructors_plot.png'):
17        print('Success!')17        print('Success!')
18    else:18    else:
19        print('Keep trying.')19        print('Keep trying.')
20import matplotlib.pyplot as plt20import matplotlib.pyplot as plt
21from scipy.linalg import norm21from scipy.linalg import norm
22from scipy import sum,average22from scipy import sum,average
23def compare_plots(imagefile1,imagefile2):23def compare_plots(imagefile1,imagefile2):
24    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))24    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
25    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))25    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
26    if img1.size!=img2.size:26    if img1.size!=img2.size:
27        return False27        return False
28    diff = img1 - img2  28    diff = img1 - img2  
29    nm = sum(abs(diff))  29    nm = sum(abs(diff))  
30    nz = norm(diff.ravel(), 0)  30    nz = norm(diff.ravel(), 0)  
31    return nm/img1.size < 1 and nz/img1.size < 131    return nm/img1.size < 1 and nz/img1.size < 1
32def to_grayscale(arr):32def to_grayscale(arr):
33    if len(arr.shape) == 3:33    if len(arr.shape) == 3:
34        return average(arr, -1)  34        return average(arr, -1)  
35    else:35    else:
36        return arr36        return arr
37def normalize(arr):37def normalize(arr):
38    rng = arr.max()-arr.min()38    rng = arr.max()-arr.min()
39    amin = arr.min()39    amin = arr.min()
40    return (arr-amin)*255/rngimport numpy as np40    return (arr-amin)*255/rngimport numpy as np
41cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='41cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
t42quartile_boundaries = np.percentile(scores,np.arange(0,100,25))t42pctl = np.percentile(scores,np.arange(0,100,25))
43best_cultivar_indices = np.where(scores>quartile_boundaries[-1])43best_cultivar_indices, = np.where(scores>pctl[-1])
44print(f'Cultivars with the following IDs are in the top quartile with a score of44print(f'Cultivars with the following IDs are in the top quartile with a score of
> {quartile_boundaries[-1]} or better:')> {pctl[-1]} or better:')
45best=cultivarIDs[best_cultivar_indices]45best=cultivarIDs[best_cultivar_indices]
46best.sort()46best.sort()
47print(', '.join([str(int(x)) for x in best]))47print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 193, P-Value: 1.95e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3def make_plot(filename):3def make_plot(filename):
n4    x=np.linspace(0,np.pi * 4,100)n4    x = np.linspace(0,np.pi * 4,100)
5    y=np.sin(x)5    y = np.sin(x)
6    plt.plot(x,y,'b')6    plt.plot(x,y,'b')
7    plt.xlabel('x(radians)')7    plt.xlabel('x(radians)')
8    plt.ylabel('sin(x)')8    plt.ylabel('sin(x)')
9    plt.margins(0,0)9    plt.margins(0,0)
10    plt.savefig(filename)10    plt.savefig(filename)
11if __name__=='__main__':11if __name__=='__main__':
12    make_plot('my_plot.png')12    make_plot('my_plot.png')
13    if compare_plots('my_plot.png','instructors_plot.png'):13    if compare_plots('my_plot.png','instructors_plot.png'):
t14       print('Success!')t14        print('Success!')
15    else:15    else:
16        print('Keep trying.')16        print('Keep trying.')
17import matplotlib.pyplot as plt17import matplotlib.pyplot as plt
18from scipy.linalg import norm18from scipy.linalg import norm
19from scipy import sum,average19from scipy import sum,average
20def compare_plots(imagefile1,imagefile2):20def compare_plots(imagefile1,imagefile2):
21    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))21    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
22    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))22    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
23    if img1.size!=img2.size:23    if img1.size!=img2.size:
24        return False24        return False
25    diff = img1 - img2  25    diff = img1 - img2  
26    nm = sum(abs(diff))  26    nm = sum(abs(diff))  
27    nz = norm(diff.ravel(), 0)  27    nz = norm(diff.ravel(), 0)  
28    return nm/img1.size < 1 and nz/img1.size < 128    return nm/img1.size < 1 and nz/img1.size < 1
29def to_grayscale(arr):29def to_grayscale(arr):
30    if len(arr.shape) == 3:30    if len(arr.shape) == 3:
31        return average(arr, -1)  31        return average(arr, -1)  
32    else:32    else:
33        return arr33        return arr
34def normalize(arr):34def normalize(arr):
35    rng = arr.max()-arr.min()35    rng = arr.max()-arr.min()
36    amin = arr.min()36    amin = arr.min()
37    return (arr-amin)*255/rngimport numpy as np37    return (arr-amin)*255/rngimport numpy as np
38cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='38cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
39pctl = np.percentile(scores,np.arange(0,100,25))39pctl = np.percentile(scores,np.arange(0,100,25))
40best_cultivar_indices = np.where(scores >= pctl[-1])40best_cultivar_indices = np.where(scores >= pctl[-1])
41print(f'Cultivars with the following IDs are in the top quartile with a score of41print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
42best=cultivarIDs[best_cultivar_indices]42best=cultivarIDs[best_cultivar_indices]
43best.sort()43best.sort()
44print(', '.join([str(int(x)) for x in best]))44print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 350, P-Value: 1.98e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
n5    x = np.linspace(0,4*np.pi,80)n5    x = np.linspace(0,4*np.pi) 
6    plt.plot(x,np.sin(x),'b-')6    plt.plot(x,np.sin(x),'-b')
7    plt.xlabel('x (radians)')7    plt.xlabel('x (radians)')
8    plt.ylabel('sin(x)')8    plt.ylabel('sin(x)')
n9    plt.margins(0)n9    plt.axis([0,4*np.pi,-1,1])
10    plt.show()
11    plt.savefig(filename)10    plt.savefig(filename)
12if __name__=='__main__':11if __name__=='__main__':
13    make_plot('my_plot.png')12    make_plot('my_plot.png')
14    if compare_plots('my_plot.png','instructors_plot.png'):13    if compare_plots('my_plot.png','instructors_plot.png'):
15        print('Success!')14        print('Success!')
16    else:15    else:
17        print('Keep trying.')16        print('Keep trying.')
18import matplotlib.pyplot as plt17import matplotlib.pyplot as plt
19from scipy.linalg import norm18from scipy.linalg import norm
20from scipy import sum,average19from scipy import sum,average
21def compare_plots(imagefile1,imagefile2):20def compare_plots(imagefile1,imagefile2):
22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))21    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))22    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
24    if img1.size!=img2.size:23    if img1.size!=img2.size:
25        return False24        return False
26    diff = img1 - img2  25    diff = img1 - img2  
27    nm = sum(abs(diff))  26    nm = sum(abs(diff))  
28    nz = norm(diff.ravel(), 0)  27    nz = norm(diff.ravel(), 0)  
29    return nm/img1.size < 1 and nz/img1.size < 128    return nm/img1.size < 1 and nz/img1.size < 1
30def to_grayscale(arr):29def to_grayscale(arr):
31    if len(arr.shape) == 3:30    if len(arr.shape) == 3:
32        return average(arr, -1)  31        return average(arr, -1)  
33    else:32    else:
34        return arr33        return arr
35def normalize(arr):34def normalize(arr):
36    rng = arr.max()-arr.min()35    rng = arr.max()-arr.min()
37    amin = arr.min()36    amin = arr.min()
38    return (arr-amin)*255/rngimport numpy as np37    return (arr-amin)*255/rngimport numpy as np
39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='38cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
40pctl = np.percentile(scores,np.arange(0,100,25))39pctl = np.percentile(scores,np.arange(0,100,25))
t41best_cultivar_indices, = np.where(scores>pctl[-1])t40best_cultivar_indices = np.where(scores>pctl[-1])
42print(f'Cultivars with the following IDs are in the top quartile with a score of41print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
43best=cultivarIDs[best_cultivar_indices]42best=cultivarIDs[best_cultivar_indices]
44best.sort()43best.sort()
45print(', '.join([str(int(x)) for x in best]))44print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 103, P-Value: 1.98e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
n5    x = np.linspace(0,4*np.pi) n5    x = np.linspace(0,4*np.pi,80)
6    plt.plot(x,np.sin(x),'-b')6    plt.plot(x,np.sin(x),'b-')
7    plt.xlabel('x (radians)')7    plt.xlabel('x (radians)')
8    plt.ylabel('sin(x)')8    plt.ylabel('sin(x)')
n9    plt.axis([0,4*np.pi,-1,1])n9    plt.margins(0)
10    plt.show()
10    plt.savefig(filename)11    plt.savefig(filename)
11if __name__=='__main__':12if __name__=='__main__':
12    make_plot('my_plot.png')13    make_plot('my_plot.png')
13    if compare_plots('my_plot.png','instructors_plot.png'):14    if compare_plots('my_plot.png','instructors_plot.png'):
14        print('Success!')15        print('Success!')
15    else:16    else:
16        print('Keep trying.')17        print('Keep trying.')
17import matplotlib.pyplot as plt18import matplotlib.pyplot as plt
18from scipy.linalg import norm19from scipy.linalg import norm
19from scipy import sum,average20from scipy import sum,average
20def compare_plots(imagefile1,imagefile2):21def compare_plots(imagefile1,imagefile2):
21    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
22    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
23    if img1.size!=img2.size:24    if img1.size!=img2.size:
24        return False25        return False
25    diff = img1 - img2  26    diff = img1 - img2  
26    nm = sum(abs(diff))  27    nm = sum(abs(diff))  
27    nz = norm(diff.ravel(), 0)  28    nz = norm(diff.ravel(), 0)  
28    return nm/img1.size < 1 and nz/img1.size < 129    return nm/img1.size < 1 and nz/img1.size < 1
29def to_grayscale(arr):30def to_grayscale(arr):
30    if len(arr.shape) == 3:31    if len(arr.shape) == 3:
31        return average(arr, -1)  32        return average(arr, -1)  
32    else:33    else:
33        return arr34        return arr
34def normalize(arr):35def normalize(arr):
35    rng = arr.max()-arr.min()36    rng = arr.max()-arr.min()
36    amin = arr.min()37    amin = arr.min()
37    return (arr-amin)*255/rngimport numpy as np38    return (arr-amin)*255/rngimport numpy as np
38cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
39pctl = np.percentile(scores,np.arange(0,100,25))40pctl = np.percentile(scores,np.arange(0,100,25))
t40best_cultivar_indices = np.where(scores>pctl[-1])t41best_cultivar_indices, = np.where(scores>pctl[-1])
41print(f'Cultivars with the following IDs are in the top quartile with a score of42print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
42best=cultivarIDs[best_cultivar_indices]43best=cultivarIDs[best_cultivar_indices]
43best.sort()44best.sort()
44print(', '.join([str(int(x)) for x in best]))45print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 277, P-Value: 2.02e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
5    x1=np.arange(0,4*(np.pi),.005)5    x1=np.arange(0,4*(np.pi),.005)
6    y1=np.sin(x1)6    y1=np.sin(x1)
7    plt.xlim([0,4*np.pi])7    plt.xlim([0,4*np.pi])
8    plt.ylim([-1,1])8    plt.ylim([-1,1])
9    plt.xticks(list(range(0,13,2)))9    plt.xticks(list(range(0,13,2)))
nn10    plt.xlabel('x (radians)')
10    plt.ylabel('sin(x)')11    plt.ylabel('sin(x)')
t11    plt.plot(x1,y1, '-b')t12    plt.plot(x1, y1, '-b')
12    plt.savefig(filename)13    plt.savefig(filename)
13if __name__=='__main__':14if __name__=='__main__':
14    make_plot('my_plot.png')15    make_plot('my_plot.png')
15    if compare_plots('my_plot.png','instructors_plot.png'):16    if compare_plots('my_plot.png','instructors_plot.png'):
16        print('Success!')17        print('Success!')
17    else:18    else:
18        print('Keep trying.')19        print('Keep trying.')
19import matplotlib.pyplot as plt20import matplotlib.pyplot as plt
20from scipy.linalg import norm21from scipy.linalg import norm
21from scipy import sum,average22from scipy import sum,average
22def compare_plots(imagefile1,imagefile2):23def compare_plots(imagefile1,imagefile2):
23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))24    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))25    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
25    if img1.size!=img2.size:26    if img1.size!=img2.size:
26        return False27        return False
27    diff = img1 - img2  28    diff = img1 - img2  
28    nm = sum(abs(diff))  29    nm = sum(abs(diff))  
29    nz = norm(diff.ravel(), 0)  30    nz = norm(diff.ravel(), 0)  
30    return nm/img1.size < 1 and nz/img1.size < 131    return nm/img1.size < 1 and nz/img1.size < 1
31def to_grayscale(arr):32def to_grayscale(arr):
32    if len(arr.shape) == 3:33    if len(arr.shape) == 3:
33        return average(arr, -1)  34        return average(arr, -1)  
34    else:35    else:
35        return arr36        return arr
36def normalize(arr):37def normalize(arr):
37    rng = arr.max()-arr.min()38    rng = arr.max()-arr.min()
38    amin = arr.min()39    amin = arr.min()
39    return (arr-amin)*255/rngimport numpy as np40    return (arr-amin)*255/rngimport numpy as np
40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='41cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
41quartile_boundaries = np.percentile(scores,np.arange(0,100,25))42quartile_boundaries = np.percentile(scores,np.arange(0,100,25))
42best_cultivar_indices, = np.where(scores>quartile_boundaries[-1])43best_cultivar_indices, = np.where(scores>quartile_boundaries[-1])
43print(f'Cultivars with the following IDs are in the top quartile with a score of44print(f'Cultivars with the following IDs are in the top quartile with a score of
> {quartile_boundaries[-1]} or better:')> {quartile_boundaries[-1]} or better:')
44best=cultivarIDs[best_cultivar_indices]45best=cultivarIDs[best_cultivar_indices]
45best.sort()46best.sort()
46print(', '.join([str(int(x)) for x in best]))47print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 363, P-Value: 2.02e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
5    x1=np.arange(0,4*(np.pi),.005)5    x1=np.arange(0,4*(np.pi),.005)
6    y1=np.sin(x1)6    y1=np.sin(x1)
7    plt.xlim([0,4*np.pi])7    plt.xlim([0,4*np.pi])
8    plt.ylim([-1,1])8    plt.ylim([-1,1])
9    plt.xticks(list(range(0,13,2)))9    plt.xticks(list(range(0,13,2)))
n10    plt.xlabel('x (radians)')n
11    plt.ylabel('sin(x)')10    plt.ylabel('sin(x)')
t12    plt.plot(x1, y1, '-b')t11    plt.plot(x1,y1, '-b')
13    plt.savefig(filename)12    plt.savefig(filename)
14if __name__=='__main__':13if __name__=='__main__':
15    make_plot('my_plot.png')14    make_plot('my_plot.png')
16    if compare_plots('my_plot.png','instructors_plot.png'):15    if compare_plots('my_plot.png','instructors_plot.png'):
17        print('Success!')16        print('Success!')
18    else:17    else:
19        print('Keep trying.')18        print('Keep trying.')
20import matplotlib.pyplot as plt19import matplotlib.pyplot as plt
21from scipy.linalg import norm20from scipy.linalg import norm
22from scipy import sum,average21from scipy import sum,average
23def compare_plots(imagefile1,imagefile2):22def compare_plots(imagefile1,imagefile2):
24    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
25    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
26    if img1.size!=img2.size:25    if img1.size!=img2.size:
27        return False26        return False
28    diff = img1 - img2  27    diff = img1 - img2  
29    nm = sum(abs(diff))  28    nm = sum(abs(diff))  
30    nz = norm(diff.ravel(), 0)  29    nz = norm(diff.ravel(), 0)  
31    return nm/img1.size < 1 and nz/img1.size < 130    return nm/img1.size < 1 and nz/img1.size < 1
32def to_grayscale(arr):31def to_grayscale(arr):
33    if len(arr.shape) == 3:32    if len(arr.shape) == 3:
34        return average(arr, -1)  33        return average(arr, -1)  
35    else:34    else:
36        return arr35        return arr
37def normalize(arr):36def normalize(arr):
38    rng = arr.max()-arr.min()37    rng = arr.max()-arr.min()
39    amin = arr.min()38    amin = arr.min()
40    return (arr-amin)*255/rngimport numpy as np39    return (arr-amin)*255/rngimport numpy as np
41cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
42quartile_boundaries = np.percentile(scores,np.arange(0,100,25))41quartile_boundaries = np.percentile(scores,np.arange(0,100,25))
43best_cultivar_indices, = np.where(scores>quartile_boundaries[-1])42best_cultivar_indices, = np.where(scores>quartile_boundaries[-1])
44print(f'Cultivars with the following IDs are in the top quartile with a score of43print(f'Cultivars with the following IDs are in the top quartile with a score of
> {quartile_boundaries[-1]} or better:')> {quartile_boundaries[-1]} or better:')
45best=cultivarIDs[best_cultivar_indices]44best=cultivarIDs[best_cultivar_indices]
46best.sort()45best.sort()
47print(', '.join([str(int(x)) for x in best]))46print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 142, P-Value: 2.03e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
tt3from compare_plots import compare_plots
3def make_plot(filename):4def make_plot(filename):
4        x = np.linspace(0,np.pi * 4,100)5        x = np.linspace(0,np.pi * 4,100)
5        y = np.sin(x)6        y = np.sin(x)
6        plt.plot(x,y,'b')7        plt.plot(x,y,'b')
7        plt.xlabel('x(radians)')8        plt.xlabel('x(radians)')
8        plt.ylabel('sin(x)')9        plt.ylabel('sin(x)')
9        plt.margins(0,0)10        plt.margins(0,0)
10        plt.savefig(filename) 11        plt.savefig(filename) 
11if __name__=='__main__':12if __name__=='__main__':
12    make_plot('my_plot.png')13    make_plot('my_plot.png')
13    if compare_plots('my_plot.png','instructors_plot.png'):14    if compare_plots('my_plot.png','instructors_plot.png'):
14        print('Success!')15        print('Success!')
15    else:16    else:
16        print('Keep trying.')17        print('Keep trying.')
17import matplotlib.pyplot as plt18import matplotlib.pyplot as plt
18from scipy.linalg import norm19from scipy.linalg import norm
19from scipy import sum,average20from scipy import sum,average
20def compare_plots(imagefile1,imagefile2):21def compare_plots(imagefile1,imagefile2):
21    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
22    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
23    if img1.size!=img2.size:24    if img1.size!=img2.size:
24        return False25        return False
25    diff = img1 - img2  26    diff = img1 - img2  
26    nm = sum(abs(diff))  27    nm = sum(abs(diff))  
27    nz = norm(diff.ravel(), 0)  28    nz = norm(diff.ravel(), 0)  
28    return nm/img1.size < 1 and nz/img1.size < 129    return nm/img1.size < 1 and nz/img1.size < 1
29def to_grayscale(arr):30def to_grayscale(arr):
30    if len(arr.shape) == 3:31    if len(arr.shape) == 3:
31        return average(arr, -1)  32        return average(arr, -1)  
32    else:33    else:
33        return arr34        return arr
34def normalize(arr):35def normalize(arr):
35    rng = arr.max()-arr.min()36    rng = arr.max()-arr.min()
36    amin = arr.min()37    amin = arr.min()
37    return (arr-amin)*255/rngimport numpy as np38    return (arr-amin)*255/rngimport numpy as np
38cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
39pctl = np.percentile(scores, np.arange(0,100,25))40pctl = np.percentile(scores, np.arange(0,100,25))
40best_cultivar_indices = np.where(scores >= pctl[-1])41best_cultivar_indices = np.where(scores >= pctl[-1])
41print(f'Cultivars with the following IDs are in the top quartile with a score of42print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
42best=cultivarIDs[best_cultivar_indices]43best=cultivarIDs[best_cultivar_indices]
43best.sort()44best.sort()
44print(', '.join([str(int(x)) for x in best]))45print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 322, P-Value: 2.06e-01

Student (left) and Nearest Neighbor (right).


n1from cmath import pin
2import matplotlib.pyplot as plt1import matplotlib.pyplot as plt
3import numpy as np2import numpy as np
nn3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
n5    x = np.linspace(0,4*np.pi,80)n5    x = np.linspace(0,4*np.pi,100)
6    y = np.sin(x)6    y= np.sin(x)
7    plt.plot(x,y,'-b')7    plt.plot(x,y, 'b')
8    plt.xlabel('x (radians)')
9    plt.ylabel('sin(x)')
8    plt.margins(0,0)10    plt.margins(0,0)
n9    plt.ylabel('sin(x)')n
10    plt.xlabel('x (radians)')
11    plt.savefig(filename)11    plt.savefig(filename)
12if __name__=='__main__':12if __name__=='__main__':
13    make_plot('my_plot.png')13    make_plot('my_plot.png')
14    if compare_plots('my_plot.png','instructors_plot.png'):14    if compare_plots('my_plot.png','instructors_plot.png'):
15        print('Success!')15        print('Success!')
16    else:16    else:
17        print('Keep trying.')17        print('Keep trying.')
18import matplotlib.pyplot as plt18import matplotlib.pyplot as plt
19from scipy.linalg import norm19from scipy.linalg import norm
20from scipy import sum,average20from scipy import sum,average
21def compare_plots(imagefile1,imagefile2):21def compare_plots(imagefile1,imagefile2):
22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
24    if img1.size!=img2.size:24    if img1.size!=img2.size:
25        return False25        return False
26    diff = img1 - img2  26    diff = img1 - img2  
27    nm = sum(abs(diff))  27    nm = sum(abs(diff))  
28    nz = norm(diff.ravel(), 0)  28    nz = norm(diff.ravel(), 0)  
29    return nm/img1.size < 1 and nz/img1.size < 129    return nm/img1.size < 1 and nz/img1.size < 1
30def to_grayscale(arr):30def to_grayscale(arr):
31    if len(arr.shape) == 3:31    if len(arr.shape) == 3:
32        return average(arr, -1)  32        return average(arr, -1)  
33    else:33    else:
34        return arr34        return arr
35def normalize(arr):35def normalize(arr):
36    rng = arr.max()-arr.min()36    rng = arr.max()-arr.min()
37    amin = arr.min()37    amin = arr.min()
38    return (arr-amin)*255/rngimport numpy as np38    return (arr-amin)*255/rngimport numpy as np
39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
t40pctl = np.percentile(scores, np.arange(0,100,25))t40pctl = np.percentile(scores,np.arange(0,100,25))
41best_cultivar_indices = np.where(scores >= pctl[-1])41best_cultivar_indices = np.where(scores >= pctl[-1])
42print(f'Cultivars with the following IDs are in the top quartile with a score of42print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
43best=cultivarIDs[best_cultivar_indices]43best=cultivarIDs[best_cultivar_indices]
44best.sort()44best.sort()
45print(', '.join([str(int(x)) for x in best]))45print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 114, P-Value: 2.07e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
n5    x = np.linspace(0,np.pi*4,100)n5    x=np.linspace(0,np.pi*4,100)
6    y = np.sin(x)6    y=np.sin(x)
7    plt.plot(x,y,"b")7    plt.plot(x,y,'b')
8    plt.xlabel("x(radians)")8    plt.xlabel('x(radians)')
9    plt.ylabel("sin(x)")9    plt.ylabel("'sin(x)")
10    plt.margins(0,0)10    plt.margins(0,0)
11    plt.savefig(filename)11    plt.savefig(filename)
12if __name__=='__main__':12if __name__=='__main__':
13    make_plot('my_plot.png')13    make_plot('my_plot.png')
14    if compare_plots('my_plot.png','instructors_plot.png'):14    if compare_plots('my_plot.png','instructors_plot.png'):
15        print('Success!')15        print('Success!')
16    else:16    else:
17        print('Keep trying.')17        print('Keep trying.')
18import matplotlib.pyplot as plt18import matplotlib.pyplot as plt
19from scipy.linalg import norm19from scipy.linalg import norm
20from scipy import sum,average20from scipy import sum,average
21def compare_plots(imagefile1,imagefile2):21def compare_plots(imagefile1,imagefile2):
22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
24    if img1.size!=img2.size:24    if img1.size!=img2.size:
25        return False25        return False
26    diff = img1 - img2  26    diff = img1 - img2  
27    nm = sum(abs(diff))  27    nm = sum(abs(diff))  
28    nz = norm(diff.ravel(), 0)  28    nz = norm(diff.ravel(), 0)  
29    return nm/img1.size < 1 and nz/img1.size < 129    return nm/img1.size < 1 and nz/img1.size < 1
30def to_grayscale(arr):30def to_grayscale(arr):
31    if len(arr.shape) == 3:31    if len(arr.shape) == 3:
32        return average(arr, -1)  32        return average(arr, -1)  
33    else:33    else:
34        return arr34        return arr
35def normalize(arr):35def normalize(arr):
36    rng = arr.max()-arr.min()36    rng = arr.max()-arr.min()
37    amin = arr.min()37    amin = arr.min()
38    return (arr-amin)*255/rngimport numpy as np38    return (arr-amin)*255/rngimport numpy as np
39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
n40quartile_boundaries=np.percentile(scores,np.arange(0,100,25))n40quartile_boundaries = np.percentile(scores,np.arange(0,100,25))
41best_cultivar_indices = np.where(scores >quartile_boundaries[-1])41top_indices, = np.where(scores>quartile_boundaries[-1])
42print(f'Cultivars with the following IDs are in the top quartile with a score of42print(f'Cultivars with the following IDs are in the top quartile with a score of
> {quartile_boundaries[-1]} or better:')> {quartile_boundaries[-1]} or better:')
t43best=cultivarIDs[best_cultivar_indices]t43best=cultivarIDs[top_indices]
44best.sort()44best.sort()
45print(', '.join([str(int(x)) for x in best]))45print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 241, P-Value: 2.11e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
n5    x = np.linspace(0, 4*np.pi, 80)n5    x = np.linspace(0,13, num= 80)
6    y= np.sin(x)6    y = np.sin(x)
7    plt.xlim([0, 4*np.pi])
8    plt.ylim([-1, 1])
9    plt.plot(x,y,'b-')
10    plt.xlabel('x (radians)')7    plt.xlabel('x (radians)')
11    plt.ylabel('sin(x)')8    plt.ylabel('sin(x)')
nn9    plt.xlim([0,12.5664])
10    plt.ylim([-1,1])
11    plt.plot(x,y,'b')
12    plt.savefig(filename)12    plt.savefig(filename)
13if __name__=='__main__':13if __name__=='__main__':
14    make_plot('my_plot.png')14    make_plot('my_plot.png')
15    if compare_plots('my_plot.png','instructors_plot.png'):15    if compare_plots('my_plot.png','instructors_plot.png'):
16        print('Success!')16        print('Success!')
17    else:17    else:
18        print('Keep trying.')18        print('Keep trying.')
19import matplotlib.pyplot as plt19import matplotlib.pyplot as plt
20from scipy.linalg import norm20from scipy.linalg import norm
21from scipy import sum,average21from scipy import sum,average
22def compare_plots(imagefile1,imagefile2):22def compare_plots(imagefile1,imagefile2):
23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
25    if img1.size!=img2.size:25    if img1.size!=img2.size:
26        return False26        return False
27    diff = img1 - img2  27    diff = img1 - img2  
28    nm = sum(abs(diff))  28    nm = sum(abs(diff))  
29    nz = norm(diff.ravel(), 0)  29    nz = norm(diff.ravel(), 0)  
30    return nm/img1.size < 1 and nz/img1.size < 130    return nm/img1.size < 1 and nz/img1.size < 1
31def to_grayscale(arr):31def to_grayscale(arr):
32    if len(arr.shape) == 3:32    if len(arr.shape) == 3:
33        return average(arr, -1)  33        return average(arr, -1)  
34    else:34    else:
35        return arr35        return arr
36def normalize(arr):36def normalize(arr):
37    rng = arr.max()-arr.min()37    rng = arr.max()-arr.min()
38    amin = arr.min()38    amin = arr.min()
39    return (arr-amin)*255/rngimport numpy as np39    return (arr-amin)*255/rngimport numpy as np
40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
t41quartile_boundaries = np.percentile((scores),np.arange(0,100,25))t41quartile_boundaries = np.percentile(scores,np.arange(0,100,25))
42best_cultivar_indices, = np.where(scores>quartile_boundaries[-1])42best_cultivar_indices, = np.where(scores>quartile_boundaries[-1])
43print(f'Cultivars with the following IDs are in the top quartile with a score of43print(f'Cultivars with the following IDs are in the top quartile with a score of
> {quartile_boundaries[-1]} or better:')> {quartile_boundaries[-1]} or better:')
44best=cultivarIDs[best_cultivar_indices]44best=cultivarIDs[best_cultivar_indices]
45best.sort()45best.sort()
46print(', '.join([str(int(x)) for x in best]))46print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 99, P-Value: 2.13e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
n5    A=np.linspace(0,4*np.pi,80)n5    A = np.linspace(0, 4*np.pi, 80)
6    B=np.sin(A)6    B = np.sin(A)
7    plt.plot(A,B, '-b')
7    plt.xlabel('x (radians)')8    plt.xlabel('x (radians)')
n8    plt.xlim(0,4*np.pi)n
9    plt.ylim(-1,1)
10    plt.ylabel('sin(x)')9    plt.ylabel('sin(x)')
n11    plt.plot(A,B, color='blue')n10    plt.xlim([0,4*np.pi])
11    plt.ylim([-1,1])
12    plt.savefig(filename)12    plt.savefig(filename)
13if __name__=='__main__':13if __name__=='__main__':
14    make_plot('my_plot.png')14    make_plot('my_plot.png')
15    if compare_plots('my_plot.png','instructors_plot.png'):15    if compare_plots('my_plot.png','instructors_plot.png'):
16        print('Success!')16        print('Success!')
17    else:17    else:
18        print('Keep trying.')18        print('Keep trying.')
19import matplotlib.pyplot as plt19import matplotlib.pyplot as plt
20from scipy.linalg import norm20from scipy.linalg import norm
21from scipy import sum,average21from scipy import sum,average
22def compare_plots(imagefile1,imagefile2):22def compare_plots(imagefile1,imagefile2):
23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
25    if img1.size!=img2.size:25    if img1.size!=img2.size:
26        return False26        return False
27    diff = img1 - img2  27    diff = img1 - img2  
28    nm = sum(abs(diff))  28    nm = sum(abs(diff))  
29    nz = norm(diff.ravel(), 0)  29    nz = norm(diff.ravel(), 0)  
30    return nm/img1.size < 1 and nz/img1.size < 130    return nm/img1.size < 1 and nz/img1.size < 1
31def to_grayscale(arr):31def to_grayscale(arr):
32    if len(arr.shape) == 3:32    if len(arr.shape) == 3:
33        return average(arr, -1)  33        return average(arr, -1)  
34    else:34    else:
35        return arr35        return arr
36def normalize(arr):36def normalize(arr):
37    rng = arr.max()-arr.min()37    rng = arr.max()-arr.min()
38    amin = arr.min()38    amin = arr.min()
39    return (arr-amin)*255/rngimport numpy as np39    return (arr-amin)*255/rngimport numpy as np
40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
t41pctl = np.percentile(scores, np.arange(0,100,25))t41pctl = np.percentile(scores,np.arange(0,100,25))
42best_cultivar_indices, = np.where(scores>pctl[-1])42best_cultivar_indices, = np.where(scores>pctl[-1]) 
43print(f'Cultivars with the following IDs are in the top quartile with a score of43print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
44best=cultivarIDs[best_cultivar_indices]44best=cultivarIDs[best_cultivar_indices]
45best.sort()45best.sort()
46print(', '.join([str(int(x)) for x in best]))46print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 157, P-Value: 2.13e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
n5    = np.arange(0,4*(np.pi),.005)n5    x1=np.arange(0,4*(np.pi),.005)
6    = np.sin(p)6    y1=np.sin(x1)
7    plt.xlim([0,4*np.pi])7    plt.xlim([0,4*np.pi])
8    plt.ylim([-1,1])8    plt.ylim([-1,1])
9    plt.xticks(list(range(0,13,2)))9    plt.xticks(list(range(0,13,2)))
10    plt.xlabel('x (radians)')10    plt.xlabel('x (radians)')
11    plt.ylabel('sin(x)')11    plt.ylabel('sin(x)')
t12    plt.plot(pr, '-b')t12    plt.plot(x1y1, '-b')
13    plt.savefig(filename)13    plt.savefig(filename)
14if __name__=='__main__':14if __name__=='__main__':
15    make_plot('my_plot.png')15    make_plot('my_plot.png')
16    if compare_plots('my_plot.png','instructors_plot.png'):16    if compare_plots('my_plot.png','instructors_plot.png'):
17        print('Success!')17        print('Success!')
18    else:18    else:
19        print('Keep trying.')19        print('Keep trying.')
20import matplotlib.pyplot as plt20import matplotlib.pyplot as plt
21from scipy.linalg import norm21from scipy.linalg import norm
22from scipy import sum,average22from scipy import sum,average
23def compare_plots(imagefile1,imagefile2):23def compare_plots(imagefile1,imagefile2):
24    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))24    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
25    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))25    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
26    if img1.size!=img2.size:26    if img1.size!=img2.size:
27        return False27        return False
28    diff = img1 - img2  28    diff = img1 - img2  
29    nm = sum(abs(diff))  29    nm = sum(abs(diff))  
30    nz = norm(diff.ravel(), 0)  30    nz = norm(diff.ravel(), 0)  
31    return nm/img1.size < 1 and nz/img1.size < 131    return nm/img1.size < 1 and nz/img1.size < 1
32def to_grayscale(arr):32def to_grayscale(arr):
33    if len(arr.shape) == 3:33    if len(arr.shape) == 3:
34        return average(arr, -1)  34        return average(arr, -1)  
35    else:35    else:
36        return arr36        return arr
37def normalize(arr):37def normalize(arr):
38    rng = arr.max()-arr.min()38    rng = arr.max()-arr.min()
39    amin = arr.min()39    amin = arr.min()
40    return (arr-amin)*255/rngimport numpy as np40    return (arr-amin)*255/rngimport numpy as np
41cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='41cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
42quartile_boundaries = np.percentile(scores,np.arange(0,100,25))42quartile_boundaries = np.percentile(scores,np.arange(0,100,25))
43best_cultivar_indices, = np.where(scores>quartile_boundaries[-1])43best_cultivar_indices, = np.where(scores>quartile_boundaries[-1])
44print(f'Cultivars with the following IDs are in the top quartile with a score of44print(f'Cultivars with the following IDs are in the top quartile with a score of
> {quartile_boundaries[-1]} or better:')> {quartile_boundaries[-1]} or better:')
45best=cultivarIDs[best_cultivar_indices]45best=cultivarIDs[best_cultivar_indices]
46best.sort()46best.sort()
47print(', '.join([str(int(x)) for x in best]))47print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 72, P-Value: 2.13e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
n5    A = np.linspace(0, 4*np.pi, 80)n5    A=np.linspace(0,4*np.pi,80)
6    B = np.sin(A)6    B=np.sin(A)
7    plt.plot(A,B, '-b')
8    plt.xlabel('x (radians)')7    plt.xlabel('x (radians)')
nn8    plt.xlim(0,4*np.pi)
9    plt.ylim(-1,1)
9    plt.ylabel('sin(x)')10    plt.ylabel('sin(x)')
n10    plt.xlim([0,4*np.pi])n11    plt.plot(A,B, color='blue')
11    plt.ylim([-1,1])
12    plt.savefig(filename)12    plt.savefig(filename)
13if __name__=='__main__':13if __name__=='__main__':
14    make_plot('my_plot.png')14    make_plot('my_plot.png')
15    if compare_plots('my_plot.png','instructors_plot.png'):15    if compare_plots('my_plot.png','instructors_plot.png'):
16        print('Success!')16        print('Success!')
17    else:17    else:
18        print('Keep trying.')18        print('Keep trying.')
19import matplotlib.pyplot as plt19import matplotlib.pyplot as plt
20from scipy.linalg import norm20from scipy.linalg import norm
21from scipy import sum,average21from scipy import sum,average
22def compare_plots(imagefile1,imagefile2):22def compare_plots(imagefile1,imagefile2):
23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
25    if img1.size!=img2.size:25    if img1.size!=img2.size:
26        return False26        return False
27    diff = img1 - img2  27    diff = img1 - img2  
28    nm = sum(abs(diff))  28    nm = sum(abs(diff))  
29    nz = norm(diff.ravel(), 0)  29    nz = norm(diff.ravel(), 0)  
30    return nm/img1.size < 1 and nz/img1.size < 130    return nm/img1.size < 1 and nz/img1.size < 1
31def to_grayscale(arr):31def to_grayscale(arr):
32    if len(arr.shape) == 3:32    if len(arr.shape) == 3:
33        return average(arr, -1)  33        return average(arr, -1)  
34    else:34    else:
35        return arr35        return arr
36def normalize(arr):36def normalize(arr):
37    rng = arr.max()-arr.min()37    rng = arr.max()-arr.min()
38    amin = arr.min()38    amin = arr.min()
39    return (arr-amin)*255/rngimport numpy as np39    return (arr-amin)*255/rngimport numpy as np
40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
t41pctl = np.percentile(scores,np.arange(0,100,25))t41pctl = np.percentile(scores, np.arange(0,100,25))
42best_cultivar_indices, = np.where(scores>pctl[-1]) 42best_cultivar_indices, = np.where(scores>pctl[-1])
43print(f'Cultivars with the following IDs are in the top quartile with a score of43print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
44best=cultivarIDs[best_cultivar_indices]44best=cultivarIDs[best_cultivar_indices]
45best.sort()45best.sort()
46print(', '.join([str(int(x)) for x in best]))46print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 500, P-Value: 2.15e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
5    x = np.linspace(0, 4 * np.pi, 80)5    x = np.linspace(0, 4 * np.pi, 80)
6    y = np.sin(x)6    y = np.sin(x)
7    filename = plt.figure()7    filename = plt.figure()
8    ax = plt.axes()8    ax = plt.axes()
9    ax.plot(x, y, '-b')9    ax.plot(x, y, '-b')
10    ax.set_xlim(0, 4 * np.pi)10    ax.set_xlim(0, 4 * np.pi)
11    ax.set_ylim([-1, 1])11    ax.set_ylim([-1, 1])
12    ax.set_xlabel('x (radians)')12    ax.set_xlabel('x (radians)')
13    ax.set_ylabel('sin(x)')13    ax.set_ylabel('sin(x)')
14    plt.tight_layout()14    plt.tight_layout()
15    plt.savefig('student_plot_tmp.png')15    plt.savefig('student_plot_tmp.png')
16    return 'student_plot_tmp.png'16    return 'student_plot_tmp.png'
17if __name__=='__main__':17if __name__=='__main__':
18    make_plot('my_plot.png')18    make_plot('my_plot.png')
19    if compare_plots('my_plot.png','instructors_plot.png'):19    if compare_plots('my_plot.png','instructors_plot.png'):
20        print('Success!')20        print('Success!')
21    else:21    else:
22        print('Keep trying.')22        print('Keep trying.')
23import matplotlib.pyplot as plt23import matplotlib.pyplot as plt
24from scipy.linalg import norm24from scipy.linalg import norm
25from scipy import sum,average25from scipy import sum,average
26def compare_plots(imagefile1,imagefile2):26def compare_plots(imagefile1,imagefile2):
27    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))27    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
28    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))28    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
29    if img1.size!=img2.size:29    if img1.size!=img2.size:
30        return False30        return False
31    diff = img1 - img2  31    diff = img1 - img2  
32    nm = sum(abs(diff))  32    nm = sum(abs(diff))  
33    nz = norm(diff.ravel(), 0)  33    nz = norm(diff.ravel(), 0)  
34    return nm/img1.size < 1 and nz/img1.size < 134    return nm/img1.size < 1 and nz/img1.size < 1
35def to_grayscale(arr):35def to_grayscale(arr):
36    if len(arr.shape) == 3:36    if len(arr.shape) == 3:
37        return average(arr, -1)  37        return average(arr, -1)  
38    else:38    else:
39        return arr39        return arr
40def normalize(arr):40def normalize(arr):
41    rng = arr.max()-arr.min()41    rng = arr.max()-arr.min()
42    amin = arr.min()42    amin = arr.min()
43    return (arr-amin)*255/rngimport numpy as np43    return (arr-amin)*255/rngimport numpy as np
44cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='44cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
45pctl = np.percentile(scores,np.arange(0,100,25))45pctl = np.percentile(scores,np.arange(0,100,25))
46best_cultivar_indices = np.where(scores>pctl[-1])46best_cultivar_indices = np.where(scores>pctl[-1])
tt47pctl = np.percentile(scores, np.arange(0,100,25))
48best_cultivar_indices = np.where(scores >= pctl[-1])
47print(f'Cultivars with the following IDs are in the top quartile with a score of49print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
48best=cultivarIDs[best_cultivar_indices]50best=cultivarIDs[best_cultivar_indices]
49best.sort()51best.sort()
50print(', '.join([str(int(x)) for x in best]))52print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 91, P-Value: 2.15e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
n5    x = np.linspace(0,(4*3.14),80)n5    x=np.linspace(0,4*np.pi,80)
6    plt.plot(x,np.sin(x),'-b')
6    plt.xlim([0,(4*3.14)])7    plt.xlim([0,4*np.pi])
7    plt.ylim([-1,1])8    plt.ylim([-1,1])
n8    plt.plot(x,np.sin(x),'-b')n
9    plt.xlabel('x (radians)')9    plt.xlabel('x (radians)')
10    plt.ylabel('sin(x)')10    plt.ylabel('sin(x)')
11    plt.savefig(filename)11    plt.savefig(filename)
12if __name__=='__main__':12if __name__=='__main__':
13    make_plot('my_plot.png')13    make_plot('my_plot.png')
14    if compare_plots('my_plot.png','instructors_plot.png'):14    if compare_plots('my_plot.png','instructors_plot.png'):
15        print('Success!')15        print('Success!')
16    else:16    else:
17        print('Keep trying.')17        print('Keep trying.')
18import matplotlib.pyplot as plt18import matplotlib.pyplot as plt
19from scipy.linalg import norm19from scipy.linalg import norm
20from scipy import sum,average20from scipy import sum,average
21def compare_plots(imagefile1,imagefile2):21def compare_plots(imagefile1,imagefile2):
22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
24    if img1.size!=img2.size:24    if img1.size!=img2.size:
25        return False25        return False
26    diff = img1 - img2  26    diff = img1 - img2  
27    nm = sum(abs(diff))  27    nm = sum(abs(diff))  
28    nz = norm(diff.ravel(), 0)  28    nz = norm(diff.ravel(), 0)  
29    return nm/img1.size < 1 and nz/img1.size < 129    return nm/img1.size < 1 and nz/img1.size < 1
30def to_grayscale(arr):30def to_grayscale(arr):
31    if len(arr.shape) == 3:31    if len(arr.shape) == 3:
32        return average(arr, -1)  32        return average(arr, -1)  
33    else:33    else:
34        return arr34        return arr
35def normalize(arr):35def normalize(arr):
36    rng = arr.max()-arr.min()36    rng = arr.max()-arr.min()
37    amin = arr.min()37    amin = arr.min()
38    return (arr-amin)*255/rngimport numpy as np38    return (arr-amin)*255/rngimport numpy as np
39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
t40pctl= np.percentile(scores,np.arange(0,100,25))t40pctl = np.percentile(scores, np.arange(0,100,25))
41best_cultivar_indices = np.where(scores >= pctl[-1])41best_cultivar_indices = np.where(scores >= pctl[-1])
42print(f'Cultivars with the following IDs are in the top quartile with a score of42print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
43best=cultivarIDs[best_cultivar_indices]43best=cultivarIDs[best_cultivar_indices]
44best.sort()44best.sort()
45print(', '.join([str(int(x)) for x in best]))45print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 181, P-Value: 2.15e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
t5    x = np.linspace(0,13,80)t5    x = np.linspace(0.0, np.pi *4,num=80)
6    plt.plot(x,np.sin(x),'b-')6    plt.plot(x, np.sin(x), 'b-')
7    plt.xlim([0,(4*np.pi)])
8    plt.xlabel('x (radians)')7    plt.xlabel('x(radians)')
8    plt.ylabel('sin(x)')
9    plt.xlim(0, np.pi*4)
9    plt.ylim([-1,1])10    plt.ylim(-1,1)
10    plt.ylabel("sin(x)")
11    plt.savefig(filename)11    plt.savefig(filename)
12if __name__=='__main__':12if __name__=='__main__':
13    make_plot('my_plot.png')13    make_plot('my_plot.png')
14    if compare_plots('my_plot.png','instructors_plot.png'):14    if compare_plots('my_plot.png','instructors_plot.png'):
15        print('Success!')15        print('Success!')
16    else:16    else:
17        print('Keep trying.')17        print('Keep trying.')
18import matplotlib.pyplot as plt18import matplotlib.pyplot as plt
19from scipy.linalg import norm19from scipy.linalg import norm
20from scipy import sum,average20from scipy import sum,average
21def compare_plots(imagefile1,imagefile2):21def compare_plots(imagefile1,imagefile2):
22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
24    if img1.size!=img2.size:24    if img1.size!=img2.size:
25        return False25        return False
26    diff = img1 - img2  26    diff = img1 - img2  
27    nm = sum(abs(diff))  27    nm = sum(abs(diff))  
28    nz = norm(diff.ravel(), 0)  28    nz = norm(diff.ravel(), 0)  
29    return nm/img1.size < 1 and nz/img1.size < 129    return nm/img1.size < 1 and nz/img1.size < 1
30def to_grayscale(arr):30def to_grayscale(arr):
31    if len(arr.shape) == 3:31    if len(arr.shape) == 3:
32        return average(arr, -1)  32        return average(arr, -1)  
33    else:33    else:
34        return arr34        return arr
35def normalize(arr):35def normalize(arr):
36    rng = arr.max()-arr.min()36    rng = arr.max()-arr.min()
37    amin = arr.min()37    amin = arr.min()
38    return (arr-amin)*255/rngimport numpy as np38    return (arr-amin)*255/rngimport numpy as np
39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
40pctl = np.percentile(scores,np.arange(0,100,25))40pctl = np.percentile(scores,np.arange(0,100,25))
41best_cultivar_indices, = np.where(scores>pctl[-1])41best_cultivar_indices, = np.where(scores>pctl[-1])
42print(f'Cultivars with the following IDs are in the top quartile with a score of42print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
43best=cultivarIDs[best_cultivar_indices]43best=cultivarIDs[best_cultivar_indices]
44best.sort()44best.sort()
45print(', '.join([str(int(x)) for x in best]))45print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 439, P-Value: 2.17e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
n5    x = np.linspace(0,(4*np.pi), num=80)n5    x = np.linspace(0,13, num=80)
6    plt.xlabel('x (radians)')
7    plt.xlim([0,12.5664])
6    y = np.sin(x)8    y = np.sin(x)
nn9    plt.ylabel('sin(x)')
10    plt.ylim([-1,1])
7    plt.plot(x,y,'b')11    plt.plot(x,y,'b')
n8    plt.xlabel('x (radians)')n
9    plt.ylabel('sin(x)')
10    plt.xlim(0,12.5664)
11    plt.ylim([-1.0,1.0])
12    plt.savefig(filename)12    plt.savefig(filename)
13if __name__=='__main__':13if __name__=='__main__':
14    make_plot('my_plot.png')14    make_plot('my_plot.png')
15    if compare_plots('my_plot.png','instructors_plot.png'):15    if compare_plots('my_plot.png','instructors_plot.png'):
16        print('Success!')16        print('Success!')
17    else:17    else:
18        print('Keep trying.')18        print('Keep trying.')
19import matplotlib.pyplot as plt19import matplotlib.pyplot as plt
20from scipy.linalg import norm20from scipy.linalg import norm
21from scipy import sum,average21from scipy import sum,average
22def compare_plots(imagefile1,imagefile2):22def compare_plots(imagefile1,imagefile2):
23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
25    if img1.size!=img2.size:25    if img1.size!=img2.size:
26        return False26        return False
27    diff = img1 - img2  27    diff = img1 - img2  
28    nm = sum(abs(diff))  28    nm = sum(abs(diff))  
29    nz = norm(diff.ravel(), 0)  29    nz = norm(diff.ravel(), 0)  
30    return nm/img1.size < 1 and nz/img1.size < 130    return nm/img1.size < 1 and nz/img1.size < 1
31def to_grayscale(arr):31def to_grayscale(arr):
32    if len(arr.shape) == 3:32    if len(arr.shape) == 3:
33        return average(arr, -1)  33        return average(arr, -1)  
34    else:34    else:
35        return arr35        return arr
36def normalize(arr):36def normalize(arr):
37    rng = arr.max()-arr.min()37    rng = arr.max()-arr.min()
38    amin = arr.min()38    amin = arr.min()
39    return (arr-amin)*255/rngimport numpy as np39    return (arr-amin)*255/rngimport numpy as np
40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
41quartile_boundary = np.percentile(scores,np.arange(0,100,25))41quartile_boundary = np.percentile(scores,np.arange(0,100,25))
t42best_cultivar_indices,= np.where(scores>quartile_boundary[-1])t42best_cultivar_indices, = np.where(scores>quartile_boundary[-1])
43print(f'Cultivars with the following IDs are in the top quartile with a score of43print(f'Cultivars with the following IDs are in the top quartile with a score of
> {quartile_boundary[-1]} or better:')> {quartile_boundary[-1]} or better:')
44best=cultivarIDs[best_cultivar_indices]44best=cultivarIDs[best_cultivar_indices]
45best.sort()45best.sort()
46print(', '.join([str(int(x)) for x in best]))46print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 168, P-Value: 2.21e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
nn5    x = np.linspace(0, 4*np.pi, 80)
6    y = np.sin(x)
5    plt.xlabel('x (radians)')7    plt.xlabel('x (radians)')
6    plt.ylabel('sin(x)')8    plt.ylabel('sin(x)')
t7    plt.xlim([0,12.58])t9    plt.xlim(0, 4*np.pi)
8    plt.ylim([-1,1])10    plt.ylim(-1,1)
9    xvalues = np.linspace(0, 12.58, 80)
10    yvalues = np.sin(xvalues)
11    plt.plot(xvalues, yvalues, '-b')11    plt.plot(x, y, '-b')
12    plt.savefig(filename)12    plt.savefig(filename)
13if __name__=='__main__':13if __name__=='__main__':
14    make_plot('my_plot.png')14    make_plot('my_plot.png')
15    if compare_plots('my_plot.png','instructors_plot.png'):15    if compare_plots('my_plot.png','instructors_plot.png'):
16        print('Success!')16        print('Success!')
17    else:17    else:
18        print('Keep trying.')18        print('Keep trying.')
19import matplotlib.pyplot as plt19import matplotlib.pyplot as plt
20from scipy.linalg import norm20from scipy.linalg import norm
21from scipy import sum,average21from scipy import sum,average
22def compare_plots(imagefile1,imagefile2):22def compare_plots(imagefile1,imagefile2):
23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
25    if img1.size!=img2.size:25    if img1.size!=img2.size:
26        return False26        return False
27    diff = img1 - img2  27    diff = img1 - img2  
28    nm = sum(abs(diff))  28    nm = sum(abs(diff))  
29    nz = norm(diff.ravel(), 0)  29    nz = norm(diff.ravel(), 0)  
30    return nm/img1.size < 1 and nz/img1.size < 130    return nm/img1.size < 1 and nz/img1.size < 1
31def to_grayscale(arr):31def to_grayscale(arr):
32    if len(arr.shape) == 3:32    if len(arr.shape) == 3:
33        return average(arr, -1)  33        return average(arr, -1)  
34    else:34    else:
35        return arr35        return arr
36def normalize(arr):36def normalize(arr):
37    rng = arr.max()-arr.min()37    rng = arr.max()-arr.min()
38    amin = arr.min()38    amin = arr.min()
39    return (arr-amin)*255/rngimport numpy as np39    return (arr-amin)*255/rngimport numpy as np
40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
41quartile_boundaries = np.percentile(scores,np.arange(0,100,25))41quartile_boundaries = np.percentile(scores,np.arange(0,100,25))
42top_indices, = np.where(scores>quartile_boundaries[-1])42top_indices, = np.where(scores>quartile_boundaries[-1])
43print(f'Cultivars with the following IDs are in the top quartile with a score of43print(f'Cultivars with the following IDs are in the top quartile with a score of
> {quartile_boundaries[-1]} or better:')> {quartile_boundaries[-1]} or better:')
44best=cultivarIDs[top_indices]44best=cultivarIDs[top_indices]
45best.sort()45best.sort()
46print(', '.join([str(int(x)) for x in best]))46print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 352, P-Value: 2.23e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
n4import mathn
5def make_plot(filename):4def make_plot(filename):
n6    x=np.linspace(0,13,80)n5    x = np.linspace(0,4*np.pi,80)
7    y= np.sin(x)6    y = np.sin(x)
8    plt.plot(x,y,'-b')7    plt.plot(x,y,'-b')
9    plt.xlim([0,12.58])
10    plt.ylim([-1.00,1.00])
11    plt.xlabel('x (radians)')8    plt.xlabel('x (radians)')
12    plt.ylabel('sin(x)')9    plt.ylabel('sin(x)')
tt10    plt.xlim([0,4*np.pi])
11    plt.ylim([-1,1])
13    plt.savefig(filename)12    plt.savefig(filename)
14if __name__=='__main__':13if __name__=='__main__':
15    make_plot('my_plot.png')14    make_plot('my_plot.png')
16    if compare_plots('my_plot.png','instructors_plot.png'):15    if compare_plots('my_plot.png','instructors_plot.png'):
17        print('Success!')16        print('Success!')
18    else:17    else:
19        print('Keep trying.')18        print('Keep trying.')
20import matplotlib.pyplot as plt19import matplotlib.pyplot as plt
21from scipy.linalg import norm20from scipy.linalg import norm
22from scipy import sum,average21from scipy import sum,average
23def compare_plots(imagefile1,imagefile2):22def compare_plots(imagefile1,imagefile2):
24    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
25    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
26    if img1.size!=img2.size:25    if img1.size!=img2.size:
27        return False26        return False
28    diff = img1 - img2  27    diff = img1 - img2  
29    nm = sum(abs(diff))  28    nm = sum(abs(diff))  
30    nz = norm(diff.ravel(), 0)  29    nz = norm(diff.ravel(), 0)  
31    return nm/img1.size < 1 and nz/img1.size < 130    return nm/img1.size < 1 and nz/img1.size < 1
32def to_grayscale(arr):31def to_grayscale(arr):
33    if len(arr.shape) == 3:32    if len(arr.shape) == 3:
34        return average(arr, -1)  33        return average(arr, -1)  
35    else:34    else:
36        return arr35        return arr
37def normalize(arr):36def normalize(arr):
38    rng = arr.max()-arr.min()37    rng = arr.max()-arr.min()
39    amin = arr.min()38    amin = arr.min()
40    return (arr-amin)*255/rngimport numpy as np39    return (arr-amin)*255/rngimport numpy as np
41cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
42pctl = np.percentile(scores, np.arange(0,100,25))41pctl = np.percentile(scores, np.arange(0,100,25))
43best_cultivar_indices = np.where(scores >= pctl[-1])42best_cultivar_indices = np.where(scores >= pctl[-1])
44print(f'Cultivars with the following IDs are in the top quartile with a score of43print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
45best=cultivarIDs[best_cultivar_indices]44best=cultivarIDs[best_cultivar_indices]
46best.sort()45best.sort()
47print(', '.join([str(int(x)) for x in best]))46print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 308, P-Value: 2.27e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
n5    x = np.linspace(0,12,80)n5    x=np.linspace(0,4*np.pi,80)
6    plt.plot(x,np.sin(x),'-b')6    plt.plot(x,np.sin(x),'-b')
n7    plt.xlim(0,4*np.pi)n7    plt.xlim([0,4*np.pi])
8    plt.ylim(-1,1)8    plt.ylim([-1,1])
9    plt.xlabel('x(radians)')9    plt.xlabel('x (radians)')
10    plt.ylabel('sin(x)')10    plt.ylabel('sin(x)')
11    plt.savefig(filename)11    plt.savefig(filename)
12if __name__=='__main__':12if __name__=='__main__':
13    make_plot('my_plot.png')13    make_plot('my_plot.png')
14    if compare_plots('my_plot.png','instructors_plot.png'):14    if compare_plots('my_plot.png','instructors_plot.png'):
15        print('Success!')15        print('Success!')
16    else:16    else:
17        print('Keep trying.')17        print('Keep trying.')
18import matplotlib.pyplot as plt18import matplotlib.pyplot as plt
19from scipy.linalg import norm19from scipy.linalg import norm
20from scipy import sum,average20from scipy import sum,average
21def compare_plots(imagefile1,imagefile2):21def compare_plots(imagefile1,imagefile2):
22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
24    if img1.size!=img2.size:24    if img1.size!=img2.size:
25        return False25        return False
26    diff = img1 - img2  26    diff = img1 - img2  
27    nm = sum(abs(diff))  27    nm = sum(abs(diff))  
28    nz = norm(diff.ravel(), 0)  28    nz = norm(diff.ravel(), 0)  
29    return nm/img1.size < 1 and nz/img1.size < 129    return nm/img1.size < 1 and nz/img1.size < 1
30def to_grayscale(arr):30def to_grayscale(arr):
31    if len(arr.shape) == 3:31    if len(arr.shape) == 3:
32        return average(arr, -1)  32        return average(arr, -1)  
33    else:33    else:
34        return arr34        return arr
35def normalize(arr):35def normalize(arr):
36    rng = arr.max()-arr.min()36    rng = arr.max()-arr.min()
37    amin = arr.min()37    amin = arr.min()
38    return (arr-amin)*255/rngimport numpy as np38    return (arr-amin)*255/rngimport numpy as np
39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
t40pctl= np.percentile(scores,np.arange(0,101,25))t40pctl = np.percentile(scores, np.arange(0,100,25))
41best_cultivar_indices, = np.where(scores >= pctl[3])41best_cultivar_indices = np.where(scores >= pctl[-1])
42print(f'Cultivars with the following IDs are in the top quartile with a score of42print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[3]} or better:')> {pctl[-1]} or better:')
43best=cultivarIDs[best_cultivar_indices]43best=cultivarIDs[best_cultivar_indices]
44best.sort()44best.sort()
45print(', '.join([str(int(x)) for x in best]))45print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 271, P-Value: 2.27e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
n5    x = np.linspace(0, 4*np.pi, 80)n5    x = np.linspace(0,4*np.pi,num=80)
6    y = np.sin(x)6    y = np.sin(x)
n7    plt.plot(x, y)n7    plt.plot(x, y,'-b')
8    plt.xlim([0,4*np.pi])
9    plt.ylim([-1,1])
8    plt.xlabel('x (radians)')10    plt.xlabel('x (radians)')
9    plt.ylabel('sin(x)')11    plt.ylabel('sin(x)')
n10    plt.axis([0, np.pi*4, -1, 1])n
11    plt.savefig(filename)12    plt.savefig(filename)
n12if __name__ == '__main__':n13if __name__=='__main__':
13    make_plot('my_plot.png')14    make_plot('my_plot.png')
n14    if compare_plots('my_plot.png', 'instructors_plot.png'):n15    if compare_plots('my_plot.png','instructors_plot.png'):
15        print('Success!')16        print('Success!')
16    else:17    else:
17        print('Keep trying.')18        print('Keep trying.')
18import matplotlib.pyplot as plt19import matplotlib.pyplot as plt
19from scipy.linalg import norm20from scipy.linalg import norm
20from scipy import sum,average21from scipy import sum,average
21def compare_plots(imagefile1,imagefile2):22def compare_plots(imagefile1,imagefile2):
22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
24    if img1.size!=img2.size:25    if img1.size!=img2.size:
25        return False26        return False
26    diff = img1 - img2  27    diff = img1 - img2  
27    nm = sum(abs(diff))  28    nm = sum(abs(diff))  
28    nz = norm(diff.ravel(), 0)  29    nz = norm(diff.ravel(), 0)  
29    return nm/img1.size < 1 and nz/img1.size < 130    return nm/img1.size < 1 and nz/img1.size < 1
30def to_grayscale(arr):31def to_grayscale(arr):
31    if len(arr.shape) == 3:32    if len(arr.shape) == 3:
32        return average(arr, -1)  33        return average(arr, -1)  
33    else:34    else:
34        return arr35        return arr
35def normalize(arr):36def normalize(arr):
36    rng = arr.max()-arr.min()37    rng = arr.max()-arr.min()
37    amin = arr.min()38    amin = arr.min()
38    return (arr-amin)*255/rngimport numpy as np39    return (arr-amin)*255/rngimport numpy as np
39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
40pctl = np.percentile(scores,np.arange(0,100,25))41pctl = np.percentile(scores,np.arange(0,100,25))
t41best_cultivar_indices, = np.where(scores>pctl[-1])t42best_cultivar_indices = np.where(scores> pctl[-1])
42print(f'Cultivars with the following IDs are in the top quartile with a score of43print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
43best=cultivarIDs[best_cultivar_indices]44best=cultivarIDs[best_cultivar_indices]
44best.sort()45best.sort()
45print(', '.join([str(int(x)) for x in best]))46print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 133, P-Value: 2.34e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
t5    a= np.linspace(0,4*np.pi,80)t5    l=np.linspace(0,4*np.pi,80)
6    b=np.sin(a)6    b=np.sin(l)
7    plt.plot(a,b,'-b')
8    plt.xlabel('x(radians)')7    plt.xlabel('x (radians)')
9    plt.ylabel('sin(x)')8    plt.ylabel("sin(x)")
10    plt.xlim(0, 4*np.pi,80)9    plt.xlim(0,4*np.pi)
11    plt.ylim(-1.00, 1.00)10    plt.ylim(-1,1)
11    plt.plot(l,b,"-b")
12    plt.savefig(filename)12    plt.savefig(filename)
13if __name__=='__main__':13if __name__=='__main__':
14    make_plot('my_plot.png')14    make_plot('my_plot.png')
15    if compare_plots('my_plot.png','instructors_plot.png'):15    if compare_plots('my_plot.png','instructors_plot.png'):
16        print('Success!')16        print('Success!')
17    else:17    else:
18        print('Keep trying.')18        print('Keep trying.')
19import matplotlib.pyplot as plt19import matplotlib.pyplot as plt
20from scipy.linalg import norm20from scipy.linalg import norm
21from scipy import sum,average21from scipy import sum,average
22def compare_plots(imagefile1,imagefile2):22def compare_plots(imagefile1,imagefile2):
23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
25    if img1.size!=img2.size:25    if img1.size!=img2.size:
26        return False26        return False
27    diff = img1 - img2  27    diff = img1 - img2  
28    nm = sum(abs(diff))  28    nm = sum(abs(diff))  
29    nz = norm(diff.ravel(), 0)  29    nz = norm(diff.ravel(), 0)  
30    return nm/img1.size < 1 and nz/img1.size < 130    return nm/img1.size < 1 and nz/img1.size < 1
31def to_grayscale(arr):31def to_grayscale(arr):
32    if len(arr.shape) == 3:32    if len(arr.shape) == 3:
33        return average(arr, -1)  33        return average(arr, -1)  
34    else:34    else:
35        return arr35        return arr
36def normalize(arr):36def normalize(arr):
37    rng = arr.max()-arr.min()37    rng = arr.max()-arr.min()
38    amin = arr.min()38    amin = arr.min()
39    return (arr-amin)*255/rngimport numpy as np39    return (arr-amin)*255/rngimport numpy as np
40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
41pctl = np.percentile(scores,np.arange(0,100,25))41pctl = np.percentile(scores,np.arange(0,100,25))
42best_cultivar_indices, = np.where(scores>pctl[-1])42best_cultivar_indices, = np.where(scores>pctl[-1])
43print(f'Cultivars with the following IDs are in the top quartile with a score of43print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
44best=cultivarIDs[best_cultivar_indices]44best=cultivarIDs[best_cultivar_indices]
45best.sort()45best.sort()
46print(', '.join([str(int(x)) for x in best]))46print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 266, P-Value: 2.34e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
n5    x_val = np.linspace(0,np.pi*4,80)n5    xVal = np.linspace(0,np.pi*4,80)
6    y_val = []6    yVal = []
7    for x in x_val:7    for x in xVal:
8        y_val.append(np.sin(x))8        yVal.append(np.sin(x))
9    plt.plot(xVal, yVal)
9    plt.xlabel('x (radians)')10    plt.xlabel('x (radians)')
nn11    plt.ylim(-1,1)
10    plt.ylabel('sin(x)')12    plt.ylabel('sin(x)')
11    plt.xlim(0,np.pi*4)13    plt.xlim(0,np.pi*4)
12    plt.ylim(-1,1)14    plt.ylim(-1,1)
n13    plt.plot(x_val, y_val)n
14    plt.savefig(filename)15    plt.savefig(filename)
t15if __name__=='main':t16if __name__=='__main__':
16    make_plot('my_plot.png')17    make_plot('my_plot.png')
17    if compare_plots('my_plot.png','instructors_plot.png'):18    if compare_plots('my_plot.png','instructors_plot.png'):
18        print('Success!')19        print('Success!')
19    else:20    else:
20        print('Keep trying.')21        print('Keep trying.')
21import matplotlib.pyplot as plt22import matplotlib.pyplot as plt
22from scipy.linalg import norm23from scipy.linalg import norm
23from scipy import sum,average24from scipy import sum,average
24def compare_plots(imagefile1,imagefile2):25def compare_plots(imagefile1,imagefile2):
25    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))26    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
26    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))27    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
27    if img1.size!=img2.size:28    if img1.size!=img2.size:
28        return False29        return False
29    diff = img1 - img2  30    diff = img1 - img2  
30    nm = sum(abs(diff))  31    nm = sum(abs(diff))  
31    nz = norm(diff.ravel(), 0)  32    nz = norm(diff.ravel(), 0)  
32    return nm/img1.size < 1 and nz/img1.size < 133    return nm/img1.size < 1 and nz/img1.size < 1
33def to_grayscale(arr):34def to_grayscale(arr):
34    if len(arr.shape) == 3:35    if len(arr.shape) == 3:
35        return average(arr, -1)  36        return average(arr, -1)  
36    else:37    else:
37        return arr38        return arr
38def normalize(arr):39def normalize(arr):
39    rng = arr.max()-arr.min()40    rng = arr.max()-arr.min()
40    amin = arr.min()41    amin = arr.min()
41    return (arr-amin)*255/rngimport numpy as np42    return (arr-amin)*255/rngimport numpy as np
42cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='43cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
43pctl = np.percentile(scores, np.arange(0,100,25))44pctl = np.percentile(scores, np.arange(0,100,25))
44best_cultivar_indices = np.where(scores >= pctl[-1])45best_cultivar_indices = np.where(scores >= pctl[-1])
45print(f'Cultivars with the following IDs are in the top quartile with a score of46print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
46best=cultivarIDs[best_cultivar_indices]47best=cultivarIDs[best_cultivar_indices]
47best.sort()48best.sort()
48print(', '.join([str(int(x)) for x in best]))49print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 497, P-Value: 2.40e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
n5    x=np.linspace(0,(4*np.pi),80)n5    x = np.arange(0,(4*np.pi),0.1)
6    y=np.sin(x)6    y = np.sin(x)
7    plt.plot(x,y,'-b')7    plt.plot(x,y,'-b')
nn8    plt.xlim([0,4*np.pi])
9    plt.ylim([-1.00, 1.00])
8    plt.xlabel('x(radians)')10    plt.xlabel('x (radians)')
9    plt.ylabel('sin(x)')11    plt.ylabel('sin(x)')
t10    plt.axis([0, (4*np.pi), -1.00, 1.00])t
11    plt.savefig(filename)12    plt.savefig(filename)
12if __name__=='__main__':13if __name__=='__main__':
13    make_plot('my_plot.png')14    make_plot('my_plot.png')
14    if compare_plots('my_plot.png','instructors_plot.png'):15    if compare_plots('my_plot.png','instructors_plot.png'):
15        print('Success!')16        print('Success!')
16    else:17    else:
17        print('Keep trying.')18        print('Keep trying.')
18import matplotlib.pyplot as plt19import matplotlib.pyplot as plt
19from scipy.linalg import norm20from scipy.linalg import norm
20from scipy import sum,average21from scipy import sum,average
21def compare_plots(imagefile1,imagefile2):22def compare_plots(imagefile1,imagefile2):
22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
24    if img1.size!=img2.size:25    if img1.size!=img2.size:
25        return False26        return False
26    diff = img1 - img2  27    diff = img1 - img2  
27    nm = sum(abs(diff))  28    nm = sum(abs(diff))  
28    nz = norm(diff.ravel(), 0)  29    nz = norm(diff.ravel(), 0)  
29    return nm/img1.size < 1 and nz/img1.size < 130    return nm/img1.size < 1 and nz/img1.size < 1
30def to_grayscale(arr):31def to_grayscale(arr):
31    if len(arr.shape) == 3:32    if len(arr.shape) == 3:
32        return average(arr, -1)  33        return average(arr, -1)  
33    else:34    else:
34        return arr35        return arr
35def normalize(arr):36def normalize(arr):
36    rng = arr.max()-arr.min()37    rng = arr.max()-arr.min()
37    amin = arr.min()38    amin = arr.min()
38    return (arr-amin)*255/rngimport numpy as np39    return (arr-amin)*255/rngimport numpy as np
39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
40pctl = np.percentile(scores,np.arange(0,100,25))41pctl = np.percentile(scores,np.arange(0,100,25))
41best_cultivar_indices = np.where(scores >= pctl[-1])42best_cultivar_indices = np.where(scores >= pctl[-1])
42print(f'Cultivars with the following IDs are in the top quartile with a score of43print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
43best=cultivarIDs[best_cultivar_indices]44best=cultivarIDs[best_cultivar_indices]
44best.sort()45best.sort()
45print(', '.join([str(int(x)) for x in best]))46print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 48, P-Value: 2.46e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
n5    arrayx = np.linspace(0, (4*np.pi), 80)n5    x = np.linspace(0.0, np.pi *4,num=80)
6    plt.plot(arrayx, np.sin(arrayx), '-b')6    plt.plot(x, np.sin(x), 'b-')
7    plt.xlabel('x(radians)')
7    plt.ylabel('sin(x)')8    plt.ylabel('sin(x)')
t8    plt.xlabel('x (radians)')t
9    plt.xlim(0, 4*np.pi)9    plt.xlim(0, np.pi*4)
10    plt.ylim(-1, 1)10    plt.ylim(-1,1)
11    plt.savefig(filename)11    plt.savefig(filename)
12if __name__=='__main__':12if __name__=='__main__':
13    make_plot('my_plot.png')13    make_plot('my_plot.png')
14    if compare_plots('my_plot.png','instructors_plot.png'):14    if compare_plots('my_plot.png','instructors_plot.png'):
15        print('Success!')15        print('Success!')
16    else:16    else:
17        print('Keep trying.')17        print('Keep trying.')
18import matplotlib.pyplot as plt18import matplotlib.pyplot as plt
19from scipy.linalg import norm19from scipy.linalg import norm
20from scipy import sum,average20from scipy import sum,average
21def compare_plots(imagefile1,imagefile2):21def compare_plots(imagefile1,imagefile2):
22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
24    if img1.size!=img2.size:24    if img1.size!=img2.size:
25        return False25        return False
26    diff = img1 - img2  26    diff = img1 - img2  
27    nm = sum(abs(diff))  27    nm = sum(abs(diff))  
28    nz = norm(diff.ravel(), 0)  28    nz = norm(diff.ravel(), 0)  
29    return nm/img1.size < 1 and nz/img1.size < 129    return nm/img1.size < 1 and nz/img1.size < 1
30def to_grayscale(arr):30def to_grayscale(arr):
31    if len(arr.shape) == 3:31    if len(arr.shape) == 3:
32        return average(arr, -1)  32        return average(arr, -1)  
33    else:33    else:
34        return arr34        return arr
35def normalize(arr):35def normalize(arr):
36    rng = arr.max()-arr.min()36    rng = arr.max()-arr.min()
37    amin = arr.min()37    amin = arr.min()
38    return (arr-amin)*255/rngimport numpy as np38    return (arr-amin)*255/rngimport numpy as np
39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
40pctl = np.percentile(scores,np.arange(0,100,25))40pctl = np.percentile(scores,np.arange(0,100,25))
41best_cultivar_indices, = np.where(scores>pctl[-1])41best_cultivar_indices, = np.where(scores>pctl[-1])
42print(f'Cultivars with the following IDs are in the top quartile with a score of42print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
43best=cultivarIDs[best_cultivar_indices]43best=cultivarIDs[best_cultivar_indices]
44best.sort()44best.sort()
45print(', '.join([str(int(x)) for x in best]))45print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 231, P-Value: 2.52e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
n5    x = np.linspace(0, 4 * np.pi, 80)n5    x = np.linspace(0, 4*np.pi, 80)
6    plt.plot(x, np.sin(x), '-b')6    y = np.sin(x)
7    plt.xlim([0, 4 * np.pi])
8    plt.ylim([-1,1])
9    plt.xlabel('x (radians)')7    plt.xlabel('x (radians)')
10    plt.ylabel('sin(x)')8    plt.ylabel('sin(x)')
tt9    plt.xlim(0, 4*np.pi)
10    plt.ylim(-1,1)
11    plt.plot(x, y, '-b')
11    plt.savefig(filename)12    plt.savefig(filename)
12if __name__=='__main__':13if __name__=='__main__':
13    make_plot('my_plot.png')14    make_plot('my_plot.png')
14    if compare_plots('my_plot.png','instructors_plot.png'):15    if compare_plots('my_plot.png','instructors_plot.png'):
15        print('Success!')16        print('Success!')
16    else:17    else:
17        print('Keep trying.')18        print('Keep trying.')
18import matplotlib.pyplot as plt19import matplotlib.pyplot as plt
19from scipy.linalg import norm20from scipy.linalg import norm
20from scipy import sum,average21from scipy import sum,average
21def compare_plots(imagefile1,imagefile2):22def compare_plots(imagefile1,imagefile2):
22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
24    if img1.size!=img2.size:25    if img1.size!=img2.size:
25        return False26        return False
26    diff = img1 - img2  27    diff = img1 - img2  
27    nm = sum(abs(diff))  28    nm = sum(abs(diff))  
28    nz = norm(diff.ravel(), 0)  29    nz = norm(diff.ravel(), 0)  
29    return nm/img1.size < 1 and nz/img1.size < 130    return nm/img1.size < 1 and nz/img1.size < 1
30def to_grayscale(arr):31def to_grayscale(arr):
31    if len(arr.shape) == 3:32    if len(arr.shape) == 3:
32        return average(arr, -1)  33        return average(arr, -1)  
33    else:34    else:
34        return arr35        return arr
35def normalize(arr):36def normalize(arr):
36    rng = arr.max()-arr.min()37    rng = arr.max()-arr.min()
37    amin = arr.min()38    amin = arr.min()
38    return (arr-amin)*255/rngimport numpy as np39    return (arr-amin)*255/rngimport numpy as np
39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
40quartile_boundaries = np.percentile(scores,np.arange(0,100,25))41quartile_boundaries = np.percentile(scores,np.arange(0,100,25))
41top_indices, = np.where(scores>quartile_boundaries[-1])42top_indices, = np.where(scores>quartile_boundaries[-1])
42print(f'Cultivars with the following IDs are in the top quartile with a score of43print(f'Cultivars with the following IDs are in the top quartile with a score of
> {quartile_boundaries[-1]} or better:')> {quartile_boundaries[-1]} or better:')
43best=cultivarIDs[top_indices]44best=cultivarIDs[top_indices]
44best.sort()45best.sort()
45print(', '.join([str(int(x)) for x in best]))46print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 220, P-Value: 2.55e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
n5    x = np.linspace(0,12.56,80)n5    x=np.linspace(0,4*np.pi,80)
6    ax=plt.plot(x,np.sin(x),'-b')6    plt.plot(x,np.sin(x),'-b')
7    plt.xlim([0,12.56])7    plt.xlim([0,4*np.pi])
8    plt.ylim([-1, 1])8    plt.ylim([-1,1])
9    plt.xlabel('x (radians)')9    plt.xlabel('x (radians)')
10    plt.ylabel('sin(x)')10    plt.ylabel('sin(x)')
11    plt.savefig(filename)11    plt.savefig(filename)
12if __name__=='__main__':12if __name__=='__main__':
13    make_plot('my_plot.png')13    make_plot('my_plot.png')
14    if compare_plots('my_plot.png','instructors_plot.png'):14    if compare_plots('my_plot.png','instructors_plot.png'):
15        print('Success!')15        print('Success!')
16    else:16    else:
17        print('Keep trying.')17        print('Keep trying.')
18import matplotlib.pyplot as plt18import matplotlib.pyplot as plt
19from scipy.linalg import norm19from scipy.linalg import norm
20from scipy import sum,average20from scipy import sum,average
21def compare_plots(imagefile1,imagefile2):21def compare_plots(imagefile1,imagefile2):
22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
24    if img1.size!=img2.size:24    if img1.size!=img2.size:
25        return False25        return False
26    diff = img1 - img2  26    diff = img1 - img2  
27    nm = sum(abs(diff))  27    nm = sum(abs(diff))  
28    nz = norm(diff.ravel(), 0)  28    nz = norm(diff.ravel(), 0)  
29    return nm/img1.size < 1 and nz/img1.size < 129    return nm/img1.size < 1 and nz/img1.size < 1
30def to_grayscale(arr):30def to_grayscale(arr):
31    if len(arr.shape) == 3:31    if len(arr.shape) == 3:
32        return average(arr, -1)  32        return average(arr, -1)  
33    else:33    else:
34        return arr34        return arr
35def normalize(arr):35def normalize(arr):
36    rng = arr.max()-arr.min()36    rng = arr.max()-arr.min()
37    amin = arr.min()37    amin = arr.min()
38    return (arr-amin)*255/rngimport numpy as np38    return (arr-amin)*255/rngimport numpy as np
39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
t40ptl = np.percentile(scores,range(0,100,25))t40pctl = np.percentile(scores, np.arange(0,100,25))
41best_cultivar_indices = np.where(scores >= ptl[-1])41best_cultivar_indices = np.where(scores >= pctl[-1])
42print(f'Cultivars with the following IDs are in the top quartile with a score of42print(f'Cultivars with the following IDs are in the top quartile with a score of
> {ptl[-1]} or better:')> {pctl[-1]} or better:')
43best=cultivarIDs[best_cultivar_indices]43best=cultivarIDs[best_cultivar_indices]
44best.sort()44best.sort()
45print(', '.join([str(int(x)) for x in best]))45print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 342, P-Value: 2.57e-01

Student (left) and Nearest Neighbor (right).


nn1from cmath import sin
1import matplotlib.pyplot as plt2import matplotlib.pyplot as plt
2import numpy as np3import numpy as np
3from compare_plots import compare_plots4from compare_plots import compare_plots
n4from math import pin
5def make_plot(filename):5def make_plot(filename):
n6    x = np.linspace(0,4*pi,80)n6    x=  np.linspace(0,4*np.pi,80)
7    x = np.linspace(0,4*pi,80)
8    y = np.sin(x)7    y = np.sin(x)
n9    plt.xlim(0,4*pi)n8    plt.plot(x, y, '-b')
10    plt.ylim(-1,1)
11    plt.xlabel('x (radians)')9    plt.xlabel('x (radians)')
12    plt.ylabel('sin(x)')10    plt.ylabel('sin(x)')
n13    plt.plot(x,y, 'b-')n11    plt.xlim(0,4*np.pi)
12    plt.ylim(-1,1)
14    plt.savefig(filename)13    plt.savefig(filename)
15if __name__=='__main__':14if __name__=='__main__':
16    make_plot('my_plot.png')15    make_plot('my_plot.png')
17    if compare_plots('my_plot.png','instructors_plot.png'):16    if compare_plots('my_plot.png','instructors_plot.png'):
18        print('Success!')17        print('Success!')
19    else:18    else:
20        print('Keep trying.')19        print('Keep trying.')
21import matplotlib.pyplot as plt20import matplotlib.pyplot as plt
22from scipy.linalg import norm21from scipy.linalg import norm
23from scipy import sum,average22from scipy import sum,average
24def compare_plots(imagefile1,imagefile2):23def compare_plots(imagefile1,imagefile2):
25    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))24    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
26    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))25    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
27    if img1.size!=img2.size:26    if img1.size!=img2.size:
28        return False27        return False
29    diff = img1 - img2  28    diff = img1 - img2  
30    nm = sum(abs(diff))  29    nm = sum(abs(diff))  
31    nz = norm(diff.ravel(), 0)  30    nz = norm(diff.ravel(), 0)  
32    return nm/img1.size < 1 and nz/img1.size < 131    return nm/img1.size < 1 and nz/img1.size < 1
33def to_grayscale(arr):32def to_grayscale(arr):
34    if len(arr.shape) == 3:33    if len(arr.shape) == 3:
35        return average(arr, -1)  34        return average(arr, -1)  
36    else:35    else:
37        return arr36        return arr
38def normalize(arr):37def normalize(arr):
39    rng = arr.max()-arr.min()38    rng = arr.max()-arr.min()
40    amin = arr.min()39    amin = arr.min()
41    return (arr-amin)*255/rngimport numpy as np40    return (arr-amin)*255/rngimport numpy as np
42cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='41cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
43pctl = np.percentile(scores,np.arange(0,100,25))42pctl = np.percentile(scores,np.arange(0,100,25))
t44best_cultivar_indices = np.where(scores>pctl[-1])t43best_cultivar_indices, = np.where(scores>pctl[-1])
45print(f'Cultivars with the following IDs are in the top quartile with a score of44print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
46best=cultivarIDs[best_cultivar_indices]45best=cultivarIDs[best_cultivar_indices]
47best.sort()46best.sort()
48print(', '.join([str(int(x)) for x in best]))47print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 313, P-Value: 2.59e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
n4import math n
5def make_plot(filename):     4def make_plot(filename):
6    x = np.linspace(0.0,13.0, num=80)5    x = np.linspace(0,13, num= 80)
7    y = np.sin(x)6    y = np.sin(x)
nn7    plt.xlabel('x (radians)')
8    plt.ylabel('sin(x)')
8    plt.xlim([0,12.5664])9    plt.xlim([0,12.5664])
9    plt.ylim([-1,1])10    plt.ylim([-1,1])
n10    plt.xlabel('x (radians)')n
11    plt.ylabel('sin(x)')
12    plt.plot(x,y, '-b')11    plt.plot(x,y,'b')
13    plt.savefig(filename)12    plt.savefig(filename)
14if __name__=='__main__':13if __name__=='__main__':
15    make_plot('my_plot.png')14    make_plot('my_plot.png')
16    if compare_plots('my_plot.png','instructors_plot.png'):15    if compare_plots('my_plot.png','instructors_plot.png'):
17        print('Success!')16        print('Success!')
18    else:17    else:
19        print('Keep trying.')18        print('Keep trying.')
20import matplotlib.pyplot as plt19import matplotlib.pyplot as plt
21from scipy.linalg import norm20from scipy.linalg import norm
22from scipy import sum,average21from scipy import sum,average
23def compare_plots(imagefile1,imagefile2):22def compare_plots(imagefile1,imagefile2):
24    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
25    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
26    if img1.size!=img2.size:25    if img1.size!=img2.size:
27        return False26        return False
28    diff = img1 - img2  27    diff = img1 - img2  
29    nm = sum(abs(diff))  28    nm = sum(abs(diff))  
30    nz = norm(diff.ravel(), 0)  29    nz = norm(diff.ravel(), 0)  
31    return nm/img1.size < 1 and nz/img1.size < 130    return nm/img1.size < 1 and nz/img1.size < 1
32def to_grayscale(arr):31def to_grayscale(arr):
33    if len(arr.shape) == 3:32    if len(arr.shape) == 3:
34        return average(arr, -1)  33        return average(arr, -1)  
35    else:34    else:
36        return arr35        return arr
37def normalize(arr):36def normalize(arr):
38    rng = arr.max()-arr.min()37    rng = arr.max()-arr.min()
39    amin = arr.min()38    amin = arr.min()
40    return (arr-amin)*255/rngimport numpy as np39    return (arr-amin)*255/rngimport numpy as np
41cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
42quartile_boundaries = np.percentile(scores,np.arange(0,100,25))41quartile_boundaries = np.percentile(scores,np.arange(0,100,25))
t43best_cultivar_indices = np.where(scores>quartile_boundaries[-1])t42best_cultivar_indices, = np.where(scores>quartile_boundaries[-1])
44print(f'Cultivars with the following IDs are in the top quartile with a score of43print(f'Cultivars with the following IDs are in the top quartile with a score of
> {quartile_boundaries[-1]} or better:')> {quartile_boundaries[-1]} or better:')
45best=cultivarIDs[best_cultivar_indices]44best=cultivarIDs[best_cultivar_indices]
46best.sort()45best.sort()
47print(', '.join([str(int(x)) for x in best]))46print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 189, P-Value: 2.61e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
n5    x= np.linspace(0,4*np.pi,81)n5    x = np.linspace(0,4*np.pi) 
6    y=np.sin(x)6    plt.plot(x,np.sin(x),'-b')
7    plt.xlabel('x (radians)')
8    plt.ylabel('sin(x)')
7    plt.axis([0,4*np.pi,-1,1])9    plt.axis([0,4*np.pi,-1,1])
n8    plt.ylabel('sin(x)')n
9    plt.xlabel('x (radians)')
10    plt.plot(x,y)
11    plt.savefig(filename)10    plt.savefig(filename)
12if __name__=='__main__':11if __name__=='__main__':
13    make_plot('my_plot.png')12    make_plot('my_plot.png')
14    if compare_plots('my_plot.png','instructors_plot.png'):13    if compare_plots('my_plot.png','instructors_plot.png'):
15        print('Success!')14        print('Success!')
16    else:15    else:
17        print('Keep trying.')16        print('Keep trying.')
18import matplotlib.pyplot as plt17import matplotlib.pyplot as plt
19from scipy.linalg import norm18from scipy.linalg import norm
20from scipy import sum,average19from scipy import sum,average
21def compare_plots(imagefile1,imagefile2):20def compare_plots(imagefile1,imagefile2):
22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))21    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))22    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
24    if img1.size!=img2.size:23    if img1.size!=img2.size:
25        return False24        return False
26    diff = img1 - img2  25    diff = img1 - img2  
27    nm = sum(abs(diff))  26    nm = sum(abs(diff))  
28    nz = norm(diff.ravel(), 0)  27    nz = norm(diff.ravel(), 0)  
29    return nm/img1.size < 1 and nz/img1.size < 128    return nm/img1.size < 1 and nz/img1.size < 1
30def to_grayscale(arr):29def to_grayscale(arr):
31    if len(arr.shape) == 3:30    if len(arr.shape) == 3:
32        return average(arr, -1)  31        return average(arr, -1)  
33    else:32    else:
34        return arr33        return arr
35def normalize(arr):34def normalize(arr):
36    rng = arr.max()-arr.min()35    rng = arr.max()-arr.min()
37    amin = arr.min()36    amin = arr.min()
38    return (arr-amin)*255/rngimport numpy as np37    return (arr-amin)*255/rngimport numpy as np
39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='38cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
40pctl = np.percentile(scores,np.arange(0,100,25))39pctl = np.percentile(scores,np.arange(0,100,25))
n41top_indices, = np.where(scores>pctl[-1])n40best_cultivar_indices = np.where(scores>pctl[-1])
42print(f'Cultivars with the following IDs are in the top quartile with a score of41print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
t43best=cultivarIDs[top_indices,]t42best=cultivarIDs[best_cultivar_indices]
44best.sort()43best.sort()
45print(', '.join([str(int(x)) for x in best]))44print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 258, P-Value: 2.68e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
t5x=np.linspace(0,4*np.pi,80)t5    x=np.linspace(0,4*np.pi,80)
6plt.plot(x,np.sin(x),'-b')6    plt.plot(x,np.sin(x),'-b')
7plt.xlim([0,4*np.pi])7    plt.xlim([0,4*np.pi])
8plt.ylim([-1,1])8    plt.ylim([-1,1])
9plt.xlabel('x (radians)')9    plt.xlabel('x (radians)')
10plt.ylabel('sin(x)')10    plt.ylabel('sin(x)')
11plt.savefig('student_plot_tmp.png')11    plt.savefig(filename)
12if __name__=='__main__':12if __name__=='__main__':
13    make_plot('my_plot.png')13    make_plot('my_plot.png')
14    if compare_plots('my_plot.png','instructors_plot.png'):14    if compare_plots('my_plot.png','instructors_plot.png'):
15        print('Success!')15        print('Success!')
16    else:16    else:
17        print('Keep trying.')17        print('Keep trying.')
18import matplotlib.pyplot as plt18import matplotlib.pyplot as plt
19from scipy.linalg import norm19from scipy.linalg import norm
20from scipy import sum,average20from scipy import sum,average
21def compare_plots(imagefile1,imagefile2):21def compare_plots(imagefile1,imagefile2):
22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
24    if img1.size!=img2.size:24    if img1.size!=img2.size:
25        return False25        return False
26    diff = img1 - img2  26    diff = img1 - img2  
27    nm = sum(abs(diff))  27    nm = sum(abs(diff))  
28    nz = norm(diff.ravel(), 0)  28    nz = norm(diff.ravel(), 0)  
29    return nm/img1.size < 1 and nz/img1.size < 129    return nm/img1.size < 1 and nz/img1.size < 1
30def to_grayscale(arr):30def to_grayscale(arr):
31    if len(arr.shape) == 3:31    if len(arr.shape) == 3:
32        return average(arr, -1)  32        return average(arr, -1)  
33    else:33    else:
34        return arr34        return arr
35def normalize(arr):35def normalize(arr):
36    rng = arr.max()-arr.min()36    rng = arr.max()-arr.min()
37    amin = arr.min()37    amin = arr.min()
38    return (arr-amin)*255/rngimport numpy as np38    return (arr-amin)*255/rngimport numpy as np
39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
40pctl = np.percentile(scores, np.arange(0,100,25))40pctl = np.percentile(scores, np.arange(0,100,25))
41best_cultivar_indices = np.where(scores >= pctl[-1])41best_cultivar_indices = np.where(scores >= pctl[-1])
42print(f'Cultivars with the following IDs are in the top quartile with a score of42print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
43best=cultivarIDs[best_cultivar_indices]43best=cultivarIDs[best_cultivar_indices]
44best.sort()44best.sort()
45print(', '.join([str(int(x)) for x in best]))45print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 396, P-Value: 2.74e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
n5    x = np.linspace(0, np.pi*4, 100)n5    x = np.linspace(0, np.pi *4, 100)
6    y = np.sin(x)6    y = np.sin(x)
n7    plt.plot(x, y, 'b')n7    plt.plot(x, y, '-b')
8    plt.margins (0,0)
8    plt.xlabel('x(radians)')9    plt.xlabel('x (radians)')
9    plt.ylabel('sin(x)')10    plt.ylabel('sin(x)')
n10    plt.margins(0,0)n
11    plt.savefig(filename)
12    plt.savefig(filename)11    plt.savefig(filename)
13if __name__=='__main__':12if __name__=='__main__':
14    make_plot('my_plot.png')13    make_plot('my_plot.png')
15    if compare_plots('my_plot.png','instructors_plot.png'):14    if compare_plots('my_plot.png','instructors_plot.png'):
16        print('Success!')15        print('Success!')
17    else:16    else:
18        print('Keep trying.')17        print('Keep trying.')
19import matplotlib.pyplot as plt18import matplotlib.pyplot as plt
20from scipy.linalg import norm19from scipy.linalg import norm
21from scipy import sum,average20from scipy import sum,average
22def compare_plots(imagefile1,imagefile2):21def compare_plots(imagefile1,imagefile2):
23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
25    if img1.size!=img2.size:24    if img1.size!=img2.size:
26        return False25        return False
27    diff = img1 - img2  26    diff = img1 - img2  
28    nm = sum(abs(diff))  27    nm = sum(abs(diff))  
29    nz = norm(diff.ravel(), 0)  28    nz = norm(diff.ravel(), 0)  
30    return nm/img1.size < 1 and nz/img1.size < 129    return nm/img1.size < 1 and nz/img1.size < 1
31def to_grayscale(arr):30def to_grayscale(arr):
32    if len(arr.shape) == 3:31    if len(arr.shape) == 3:
33        return average(arr, -1)  32        return average(arr, -1)  
34    else:33    else:
35        return arr34        return arr
36def normalize(arr):35def normalize(arr):
37    rng = arr.max()-arr.min()36    rng = arr.max()-arr.min()
38    amin = arr.min()37    amin = arr.min()
39    return (arr-amin)*255/rngimport numpy as np38    return (arr-amin)*255/rngimport numpy as np
t40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='t39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,', usecols=(0, 1))>,')
41pctl = np.percentile(scores, np.arange(0,100,25))40pctl = np.percentile(scores, np.arange(0,100,25))
42best_cultivar_indices = np.where(scores >= pctl[-1])41best_cultivar_indices = np.where(scores >= pctl[-1])
43print(f'Cultivars with the following IDs are in the top quartile with a score of42print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
44best=cultivarIDs[best_cultivar_indices]43best=cultivarIDs[best_cultivar_indices]
45best.sort()44best.sort()
46print(', '.join([str(int(x)) for x in best]))45print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 125, P-Value: 2.76e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
n4def make_plot(fileName):n4def make_plot(filename):
5    x = np.linspace(0,4*np.pi,80)5    x = np.linspace(0,13,80)
6    plt.plot(x,np.sin(x),'-b')6    plt.plot(x,np.sin(x),'b-')
7    plt.xlim(0,4*np.pi)7    plt.xlim([0,(4*np.pi)])
8    plt.xlabel('x (radians)')
8    plt.ylim(-1,1)9    plt.ylim([-1,1])
9    plt.xlabel("x (radians)")
10    plt.ylabel("sin(x)")10    plt.ylabel("sin(x)")
n11    plt.savefig(fileName)n11    plt.savefig(filename)
12if __name__=='__main__':12if __name__=='__main__':
t13    make_plot('students_plot.png')t13    make_plot('my_plot.png')
14    if compare_plots('students_plot.png','instructors_plot.png'):14    if compare_plots('my_plot.png','instructors_plot.png'):
15        print('Success!')15        print('Success!')
16    else:16    else:
17        print('Keep trying.')17        print('Keep trying.')
18import matplotlib.pyplot as plt18import matplotlib.pyplot as plt
19from scipy.linalg import norm19from scipy.linalg import norm
20from scipy import sum,average20from scipy import sum,average
21def compare_plots(imagefile1,imagefile2):21def compare_plots(imagefile1,imagefile2):
22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
24    if img1.size!=img2.size:24    if img1.size!=img2.size:
25        return False25        return False
26    diff = img1 - img2  26    diff = img1 - img2  
27    nm = sum(abs(diff))  27    nm = sum(abs(diff))  
28    nz = norm(diff.ravel(), 0)  28    nz = norm(diff.ravel(), 0)  
29    return nm/img1.size < 1 and nz/img1.size < 129    return nm/img1.size < 1 and nz/img1.size < 1
30def to_grayscale(arr):30def to_grayscale(arr):
31    if len(arr.shape) == 3:31    if len(arr.shape) == 3:
32        return average(arr, -1)  32        return average(arr, -1)  
33    else:33    else:
34        return arr34        return arr
35def normalize(arr):35def normalize(arr):
36    rng = arr.max()-arr.min()36    rng = arr.max()-arr.min()
37    amin = arr.min()37    amin = arr.min()
38    return (arr-amin)*255/rngimport numpy as np38    return (arr-amin)*255/rngimport numpy as np
39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
40pctl = np.percentile(scores,np.arange(0,100,25))40pctl = np.percentile(scores,np.arange(0,100,25))
41best_cultivar_indices, = np.where(scores>pctl[-1])41best_cultivar_indices, = np.where(scores>pctl[-1])
42print(f'Cultivars with the following IDs are in the top quartile with a score of42print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
43best=cultivarIDs[best_cultivar_indices]43best=cultivarIDs[best_cultivar_indices]
44best.sort()44best.sort()
45print(', '.join([str(int(x)) for x in best]))45print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 201, P-Value: 2.81e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
n5    domain = np.linspace(0, 4*np.pi, 80)n5    x = np.linspace(0,4*np.pi) 
6    plt.plot(domain, np.sin(domain), '-b')6    plt.plot(x,np.sin(x),'-b')
7    plt.xlabel('x (radians)')7    plt.xlabel('x (radians)')
8    plt.ylabel('sin(x)')8    plt.ylabel('sin(x)')
n9    plt.axis([0,4*np.pi, -1 ,1])n9    plt.axis([0,4*np.pi,-1,1])
10    plt.savefig(filename)10    plt.savefig(filename)
n11    plt.show()n
12if __name__=='__main__':11if __name__=='__main__':
13    make_plot('my_plot.png')12    make_plot('my_plot.png')
14    if compare_plots('my_plot.png','instructors_plot.png'):13    if compare_plots('my_plot.png','instructors_plot.png'):
15        print('Success!')14        print('Success!')
16    else:15    else:
17        print('Keep trying.')16        print('Keep trying.')
18import matplotlib.pyplot as plt17import matplotlib.pyplot as plt
19from scipy.linalg import norm18from scipy.linalg import norm
20from scipy import sum,average19from scipy import sum,average
21def compare_plots(imagefile1,imagefile2):20def compare_plots(imagefile1,imagefile2):
22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))21    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))22    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
24    if img1.size!=img2.size:23    if img1.size!=img2.size:
25        return False24        return False
26    diff = img1 - img2  25    diff = img1 - img2  
27    nm = sum(abs(diff))  26    nm = sum(abs(diff))  
28    nz = norm(diff.ravel(), 0)  27    nz = norm(diff.ravel(), 0)  
29    return nm/img1.size < 1 and nz/img1.size < 128    return nm/img1.size < 1 and nz/img1.size < 1
30def to_grayscale(arr):29def to_grayscale(arr):
31    if len(arr.shape) == 3:30    if len(arr.shape) == 3:
32        return average(arr, -1)  31        return average(arr, -1)  
33    else:32    else:
34        return arr33        return arr
35def normalize(arr):34def normalize(arr):
36    rng = arr.max()-arr.min()35    rng = arr.max()-arr.min()
37    amin = arr.min()36    amin = arr.min()
38    return (arr-amin)*255/rngimport numpy as np37    return (arr-amin)*255/rngimport numpy as np
39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='38cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
t40pctl = np.percentile(scores,np.arange(0,100,75))t39pctl = np.percentile(scores,np.arange(0,100,25))
41best_cultivar_indices = np.where(scores>pctl[-1])40best_cultivar_indices = np.where(scores>pctl[-1])
42print(f'Cultivars with the following IDs are in the top quartile with a score of41print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
43best=cultivarIDs[best_cultivar_indices]42best=cultivarIDs[best_cultivar_indices]
44best.sort()43best.sort()
45print(', '.join([str(int(x)) for x in best]))44print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 39, P-Value: 2.83e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
n5    xval = np.linspace(0, 4 * np.pi, 80)n5    x=np.linspace(0,4*np.pi,80)
6    plt.plot(xval, np.sin(xval), '-b')6    plt.plot(x,np.sin(x),'-b')
7    plt.xlim([0, 4 * np.pi])7    plt.xlim([0,4*np.pi])
8    plt.ylim([-1, 1])8    plt.ylim([-1,1])
9    plt.xlabel('x (radians)')9    plt.xlabel('x (radians)')
10    plt.ylabel('sin(x)')10    plt.ylabel('sin(x)')
11    plt.savefig(filename)11    plt.savefig(filename)
12if __name__=='__main__':12if __name__=='__main__':
13    make_plot('my_plot.png')13    make_plot('my_plot.png')
14    if compare_plots('my_plot.png','instructors_plot.png'):14    if compare_plots('my_plot.png','instructors_plot.png'):
15        print('Success!')15        print('Success!')
16    else:16    else:
17        print('Keep trying.')17        print('Keep trying.')
18import matplotlib.pyplot as plt18import matplotlib.pyplot as plt
19from scipy.linalg import norm19from scipy.linalg import norm
20from scipy import sum,average20from scipy import sum,average
21def compare_plots(imagefile1,imagefile2):21def compare_plots(imagefile1,imagefile2):
22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
24    if img1.size!=img2.size:24    if img1.size!=img2.size:
25        return False25        return False
26    diff = img1 - img2  26    diff = img1 - img2  
27    nm = sum(abs(diff))  27    nm = sum(abs(diff))  
28    nz = norm(diff.ravel(), 0)  28    nz = norm(diff.ravel(), 0)  
29    return nm/img1.size < 1 and nz/img1.size < 129    return nm/img1.size < 1 and nz/img1.size < 1
30def to_grayscale(arr):30def to_grayscale(arr):
31    if len(arr.shape) == 3:31    if len(arr.shape) == 3:
32        return average(arr, -1)  32        return average(arr, -1)  
33    else:33    else:
34        return arr34        return arr
35def normalize(arr):35def normalize(arr):
36    rng = arr.max()-arr.min()36    rng = arr.max()-arr.min()
37    amin = arr.min()37    amin = arr.min()
38    return (arr-amin)*255/rngimport numpy as np38    return (arr-amin)*255/rngimport numpy as np
39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
t40pctl = np.percentile(scores, np.arange(0, 100, 25))t40pctl = np.percentile(scores, np.arange(0,100,25))
41best_cultivar_indices, = np.where(scores > pctl[-1])41best_cultivar_indices = np.where(scores >= pctl[-1])
42print(f'Cultivars with the following IDs are in the top quartile with a score of42print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
43best=cultivarIDs[best_cultivar_indices]43best=cultivarIDs[best_cultivar_indices]
44best.sort()44best.sort()
45print(', '.join([str(int(x)) for x in best]))45print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 418, P-Value: 2.85e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
n5    plt.xlabel("x (radians)")n
6    plt.ylabel("sin(x)")
7    plt.xticks(list(range(0,13,2)))5    plt.xticks(list(range(0,13,2)))
8    plt.axis([0,4*np.pi,-1,1])6    plt.axis([0,4*np.pi,-1,1])
t9    t_period = np.linspace(0.0, 4*np.pi,80)t7    x = np.linspace(0, 4*np.pi, 80)
10    wave = np.sin(t_period)8    wave_f = np.sin(x)
9    plt.xlabel('sin(x)')
10    plt.ylabel('x (radians)')
11    plt.plot(t_period,wave)11    plt.plot(x,wave_f)
12    plt.savefig(filename)12    plt.savefig(filename)
13if __name__=='__main__':13if __name__=='__main__':
14    make_plot('my_plot.png')14    make_plot('my_plot.png')
15    if compare_plots('my_plot.png','instructors_plot.png'):15    if compare_plots('my_plot.png','instructors_plot.png'):
16        print('Success!')16        print('Success!')
17    else:17    else:
18        print('Keep trying.')18        print('Keep trying.')
19import matplotlib.pyplot as plt19import matplotlib.pyplot as plt
20from scipy.linalg import norm20from scipy.linalg import norm
21from scipy import sum,average21from scipy import sum,average
22def compare_plots(imagefile1,imagefile2):22def compare_plots(imagefile1,imagefile2):
23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
25    if img1.size!=img2.size:25    if img1.size!=img2.size:
26        return False26        return False
27    diff = img1 - img2  27    diff = img1 - img2  
28    nm = sum(abs(diff))  28    nm = sum(abs(diff))  
29    nz = norm(diff.ravel(), 0)  29    nz = norm(diff.ravel(), 0)  
30    return nm/img1.size < 1 and nz/img1.size < 130    return nm/img1.size < 1 and nz/img1.size < 1
31def to_grayscale(arr):31def to_grayscale(arr):
32    if len(arr.shape) == 3:32    if len(arr.shape) == 3:
33        return average(arr, -1)  33        return average(arr, -1)  
34    else:34    else:
35        return arr35        return arr
36def normalize(arr):36def normalize(arr):
37    rng = arr.max()-arr.min()37    rng = arr.max()-arr.min()
38    amin = arr.min()38    amin = arr.min()
39    return (arr-amin)*255/rngimport numpy as np39    return (arr-amin)*255/rngimport numpy as np
40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
41pctl = np.percentile(scores,np.arange(0,100,25))41pctl = np.percentile(scores,np.arange(0,100,25))
42best_cultivar_indices, = np.where(scores>pctl[-1])42best_cultivar_indices, = np.where(scores>pctl[-1])
43print(f'Cultivars with the following IDs are in the top quartile with a score of43print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
44best=cultivarIDs[best_cultivar_indices]44best=cultivarIDs[best_cultivar_indices]
45best.sort()45best.sort()
46print(', '.join([str(int(x)) for x in best]))46print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 333, P-Value: 2.87e-01

Student (left) and Nearest Neighbor (right).


n1main.pyn
2main.py
3import matplotlib.pyplot as plt1import matplotlib.pyplot as plt
4import numpy as np2import numpy as np
nn3from compare_plots import compare_plots
5def make_plot(filename):4def make_plot(filename):
n6    x = np.linspace(0, np.pi * 4, 100)n5    x = np.linspace(0, np.pi *4, 100)
7    y = np.sin(x)6    y = np.sin(x)
8    plt.plot(x, y, '-b')7    plt.plot(x, y, '-b')
nn8    plt.margins (0,0)
9    plt.xlabel('x(radians)')9    plt.xlabel('x (radians)')
10    plt.ylabel('sin(x)')10    plt.ylabel('sin(x)')
n11    plt.margins(0, 0)n
12    plt.savefig(filename)11    plt.savefig(filename)
n13if __name__ == '__main__':n12if __name__=='__main__':
14    make_plot('my_plot.png')13    make_plot('my_plot.png')
15    if compare_plots('my_plot.png','instructors_plot.png'):14    if compare_plots('my_plot.png','instructors_plot.png'):
n16        print("Success!")n15        print('Success!')
17    else:16    else:
t18        print("Keep trying.")t17        print('Keep trying.')
19import matplotlib.pyplot as plt18import matplotlib.pyplot as plt
20from scipy.linalg import norm19from scipy.linalg import norm
21from scipy import sum,average20from scipy import sum,average
22def compare_plots(imagefile1,imagefile2):21def compare_plots(imagefile1,imagefile2):
23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
25    if img1.size!=img2.size:24    if img1.size!=img2.size:
26        return False25        return False
27    diff = img1 - img2  26    diff = img1 - img2  
28    nm = sum(abs(diff))  27    nm = sum(abs(diff))  
29    nz = norm(diff.ravel(), 0)  28    nz = norm(diff.ravel(), 0)  
30    return nm/img1.size < 1 and nz/img1.size < 129    return nm/img1.size < 1 and nz/img1.size < 1
31def to_grayscale(arr):30def to_grayscale(arr):
32    if len(arr.shape) == 3:31    if len(arr.shape) == 3:
33        return average(arr, -1)  32        return average(arr, -1)  
34    else:33    else:
35        return arr34        return arr
36def normalize(arr):35def normalize(arr):
37    rng = arr.max()-arr.min()36    rng = arr.max()-arr.min()
38    amin = arr.min()37    amin = arr.min()
39    return (arr-amin)*255/rngimport numpy as np38    return (arr-amin)*255/rngimport numpy as np
40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
41pctl = np.percentile(scores, np.arange(0,100,25))40pctl = np.percentile(scores, np.arange(0,100,25))
42best_cultivar_indices = np.where(scores >= pctl[-1])41best_cultivar_indices = np.where(scores >= pctl[-1])
43print(f'Cultivars with the following IDs are in the top quartile with a score of42print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
44best=cultivarIDs[best_cultivar_indices]43best=cultivarIDs[best_cultivar_indices]
45best.sort()44best.sort()
46print(', '.join([str(int(x)) for x in best]))45print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 45, P-Value: 2.90e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
n5    x = np.linspace(0, (4*np.pi), 80)n5    x = np.arange(0,4 *np.pi,0.01)
6    y = np.sin(x)6    y = np.sin(x)
7    plt.plot(x,y)7    plt.plot(x,y)
n8    plt.xlim(0,(4*np.pi))n
9    plt.ylim(-1.00,1.00)8    plt.ylim([-1,1])
10    plt.xlabel('x (radians)')9    plt.xlabel('x (radians)')
11    plt.ylabel('sin(x)')10    plt.ylabel('sin(x)')
nn11    plt.xlim([0,4*np.pi])
12    plt.savefig(filename)12    plt.savefig(filename)
n13    plt.show()n
14if __name__=='__main__':13if __name__=='__main__':
15    make_plot('my_plot.png')14    make_plot('my_plot.png')
16    if compare_plots('my_plot.png','instructors_plot.png'):15    if compare_plots('my_plot.png','instructors_plot.png'):
17        print('Success!')16        print('Success!')
18    else:17    else:
19        print('Keep trying.')18        print('Keep trying.')
20import matplotlib.pyplot as plt19import matplotlib.pyplot as plt
21from scipy.linalg import norm20from scipy.linalg import norm
22from scipy import sum,average21from scipy import sum,average
23def compare_plots(imagefile1,imagefile2):22def compare_plots(imagefile1,imagefile2):
24    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
25    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
26    if img1.size!=img2.size:25    if img1.size!=img2.size:
27        return False26        return False
28    diff = img1 - img2  27    diff = img1 - img2  
29    nm = sum(abs(diff))  28    nm = sum(abs(diff))  
30    nz = norm(diff.ravel(), 0)  29    nz = norm(diff.ravel(), 0)  
31    return nm/img1.size < 1 and nz/img1.size < 130    return nm/img1.size < 1 and nz/img1.size < 1
32def to_grayscale(arr):31def to_grayscale(arr):
33    if len(arr.shape) == 3:32    if len(arr.shape) == 3:
34        return average(arr, -1)  33        return average(arr, -1)  
35    else:34    else:
36        return arr35        return arr
37def normalize(arr):36def normalize(arr):
38    rng = arr.max()-arr.min()37    rng = arr.max()-arr.min()
39    amin = arr.min()38    amin = arr.min()
40    return (arr-amin)*255/rngimport numpy as np39    return (arr-amin)*255/rngimport numpy as np
41cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
t42pctl=np.percentile(scores,np.arange(0,100,25))t41pctl = np.percentile(scores,np.arange(0,100,25))
43best_cultivar_indices=np.where(scores>=pctl[-1])42best_cultivar_indices= np.where(scores>pctl[-1])
44print(f'Cultivars with the following IDs are in the top quartile with a score of43print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
45best=cultivarIDs[best_cultivar_indices]44best=cultivarIDs[best_cultivar_indices]
46best.sort()45best.sort()
47print(', '.join([str(int(x)) for x in best]))46print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 221, P-Value: 2.92e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
n4import mathn
5def make_plot(filename):4def make_plot(filename):
n6    x = np.linspace(0, (np.pi)*4, 80)n5    x = np.linspace(0, 4*np.pi, 80) 
7    y = np.sin(x)
8    plt.plot(x, y, '-b',)6    plt.plot(x,np.sin(x), 'b-')
7    plt.axis([0,4*np.pi,-1,1])
8    plt.xlabel('x (radians)')
9    plt.ylabel('sin(x)')9    plt.ylabel('sin(x)')
n10    plt.xlabel('x (radians)')n
11    plt.axis([0, (np.pi)*4, -1, 1])
12    plt.savefig(filename)10    plt.savefig(filename)
13if __name__=='__main__':11if __name__=='__main__':
14    make_plot('my_plot.png')12    make_plot('my_plot.png')
15    if compare_plots('my_plot.png','instructors_plot.png'):13    if compare_plots('my_plot.png','instructors_plot.png'):
16        print('Success!')14        print('Success!')
17    else:15    else:
18        print('Keep trying.')16        print('Keep trying.')
19import matplotlib.pyplot as plt17import matplotlib.pyplot as plt
20from scipy.linalg import norm18from scipy.linalg import norm
21from scipy import sum,average19from scipy import sum,average
22def compare_plots(imagefile1,imagefile2):20def compare_plots(imagefile1,imagefile2):
23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))21    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))22    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
25    if img1.size!=img2.size:23    if img1.size!=img2.size:
26        return False24        return False
27    diff = img1 - img2  25    diff = img1 - img2  
28    nm = sum(abs(diff))  26    nm = sum(abs(diff))  
29    nz = norm(diff.ravel(), 0)  27    nz = norm(diff.ravel(), 0)  
30    return nm/img1.size < 1 and nz/img1.size < 128    return nm/img1.size < 1 and nz/img1.size < 1
31def to_grayscale(arr):29def to_grayscale(arr):
32    if len(arr.shape) == 3:30    if len(arr.shape) == 3:
33        return average(arr, -1)  31        return average(arr, -1)  
34    else:32    else:
35        return arr33        return arr
36def normalize(arr):34def normalize(arr):
37    rng = arr.max()-arr.min()35    rng = arr.max()-arr.min()
38    amin = arr.min()36    amin = arr.min()
39    return (arr-amin)*255/rngimport numpy as np37    return (arr-amin)*255/rngimport numpy as np
40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='38cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
t41quartile_boundaries = np.percentile(scores,np.arange(0,100,25))t39quartile_boundaries = np.percentile(scores,np.arange(0,100,75))
42best_cultivar_indices, = np.where(scores>quartile_boundaries[-1])40best_cultivar_indices, = np.where(scores>quartile_boundaries[-1])
43print(f'Cultivars with the following IDs are in the top quartile with a score of41print(f'Cultivars with the following IDs are in the top quartile with a score of
> {quartile_boundaries[-1]} or better:')> {quartile_boundaries[-1]} or better:')
44best=cultivarIDs[best_cultivar_indices]42best=cultivarIDs[best_cultivar_indices]
45best.sort()43best.sort()
46print(', '.join([str(int(x)) for x in best]))44print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 340, P-Value: 2.94e-01

Student (left) and Nearest Neighbor (right).


n1from cmath import pin
2import matplotlib.pyplot as plt1import matplotlib.pyplot as plt
3import numpy as np2import numpy as np
4from compare_plots import compare_plots3from compare_plots import compare_plots
5def make_plot(filename):4def make_plot(filename):
n6    x = np.linspace(0,13,num = 80)n5    x = np.linspace(0.0, np.pi *4,num=80)
7    plt.plot(x, np.sin(x), 'b-')6    plt.plot(x, np.sin(x), 'b-')
n8    plt.xlabel('x (radians)')n7    plt.xlabel('x(radians)')
9    plt.ylabel('sin(x)')8    plt.ylabel('sin(x)')
n10    plt.xlim([0,pi*4])n9    plt.xlim(0, np.pi*4)
11    plt.ylim([-1,1])10    plt.ylim(-1,1)
12    plt.savefig(filename)11    plt.savefig(filename)
13if __name__=='__main__':12if __name__=='__main__':
14    make_plot('my_plot.png')13    make_plot('my_plot.png')
15    if compare_plots('my_plot.png','instructors_plot.png'):14    if compare_plots('my_plot.png','instructors_plot.png'):
16        print('Success!')15        print('Success!')
17    else:16    else:
18        print('Keep trying.')17        print('Keep trying.')
19import matplotlib.pyplot as plt18import matplotlib.pyplot as plt
20from scipy.linalg import norm19from scipy.linalg import norm
21from scipy import sum,average20from scipy import sum,average
22def compare_plots(imagefile1,imagefile2):21def compare_plots(imagefile1,imagefile2):
23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
25    if img1.size!=img2.size:24    if img1.size!=img2.size:
26        return False25        return False
27    diff = img1 - img2  26    diff = img1 - img2  
28    nm = sum(abs(diff))  27    nm = sum(abs(diff))  
29    nz = norm(diff.ravel(), 0)  28    nz = norm(diff.ravel(), 0)  
30    return nm/img1.size < 1 and nz/img1.size < 129    return nm/img1.size < 1 and nz/img1.size < 1
31def to_grayscale(arr):30def to_grayscale(arr):
32    if len(arr.shape) == 3:31    if len(arr.shape) == 3:
33        return average(arr, -1)  32        return average(arr, -1)  
34    else:33    else:
35        return arr34        return arr
36def normalize(arr):35def normalize(arr):
37    rng = arr.max()-arr.min()36    rng = arr.max()-arr.min()
38    amin = arr.min()37    amin = arr.min()
39    return (arr-amin)*255/rngimport numpy as np38    return (arr-amin)*255/rngimport numpy as np
n40cultivarIDs,scores = np.loadtxt('cultivar_test_scores.csv',unpack=True,delimitern39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>=',')>,')
41pctl = np.percentile(scores,np.arange(0,100,25))40pctl = np.percentile(scores,np.arange(0,100,25))
t42best_cultivar_indices = np.where(scores >pctl[-1])t41best_cultivar_indices, = np.where(scores>pctl[-1])
43print(f'Cultivars with the following IDs are in the top quartile with a score of42print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
44best=cultivarIDs[best_cultivar_indices]43best=cultivarIDs[best_cultivar_indices]
45best.sort()44best.sort()
46print(', '.join([str(int(x)) for x in best]))45print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 365, P-Value: 2.94e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
n5    x_axis=np.linspace(0,(4* np.pi),80)n5    x = np.linspace(0,(np.pi* 4))
6    y_axis=np.sin(x_axis)6    y = np.sin(x)
7    plt.plot(x_axis,y_axis,'-b')
8    plt.xlim(0,(4*np.pi))7    plt.xlim(0,(np.pi* 4))
9    plt.ylim(-1,1)8    plt.ylim(-1,1)
tt9    plt.plot(x,y,'-b')
10    plt.savefig(filename)10    plt.savefig(filename)
11if __name__=='__main__':11if __name__=='__main__':
12    make_plot('my_plot.png')12    make_plot('my_plot.png')
13    if compare_plots('my_plot.png','instructors_plot.png'):13    if compare_plots('my_plot.png','instructors_plot.png'):
14        print('Success!')14        print('Success!')
15    else:15    else:
16        print('Keep trying.')16        print('Keep trying.')
17import matplotlib.pyplot as plt17import matplotlib.pyplot as plt
18from scipy.linalg import norm18from scipy.linalg import norm
19from scipy import sum,average19from scipy import sum,average
20def compare_plots(imagefile1,imagefile2):20def compare_plots(imagefile1,imagefile2):
21    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))21    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
22    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))22    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
23    if img1.size!=img2.size:23    if img1.size!=img2.size:
24        return False24        return False
25    diff = img1 - img2  25    diff = img1 - img2  
26    nm = sum(abs(diff))  26    nm = sum(abs(diff))  
27    nz = norm(diff.ravel(), 0)  27    nz = norm(diff.ravel(), 0)  
28    return nm/img1.size < 1 and nz/img1.size < 128    return nm/img1.size < 1 and nz/img1.size < 1
29def to_grayscale(arr):29def to_grayscale(arr):
30    if len(arr.shape) == 3:30    if len(arr.shape) == 3:
31        return average(arr, -1)  31        return average(arr, -1)  
32    else:32    else:
33        return arr33        return arr
34def normalize(arr):34def normalize(arr):
35    rng = arr.max()-arr.min()35    rng = arr.max()-arr.min()
36    amin = arr.min()36    amin = arr.min()
37    return (arr-amin)*255/rngimport numpy as np37    return (arr-amin)*255/rngimport numpy as np
38cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='38cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
39quartile_boundaries = np.percentile(scores,np.arange(0,100,25))39quartile_boundaries = np.percentile(scores,np.arange(0,100,25))
40top_indices, = np.where(scores>quartile_boundaries[-1])40top_indices, = np.where(scores>quartile_boundaries[-1])
41best_cultivar_indices=top_indices,41best_cultivar_indices=top_indices,
42print(f'Cultivars with the following IDs are in the top quartile with a score of42print(f'Cultivars with the following IDs are in the top quartile with a score of
> {quartile_boundaries[-1]} or better:')> {quartile_boundaries[-1]} or better:')
43best=cultivarIDs[best_cultivar_indices]43best=cultivarIDs[best_cultivar_indices]
44best.sort()44best.sort()
45print(', '.join([str(int(x)) for x in best]))45print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 414, P-Value: 2.94e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
n5    x= np.arange(0, np.pi*4,0.1)n5    x = np.arange(0,(4*np.pi),0.1)
6    y= np.sin(x)6    y = np.sin(x)
7    plt.xlim(0,np.pi*4)
8    plt.ylim(-1.00,1.00)
9    plt.xlabel("x (radians)")
10    plt.ylabel("sin(x)")
11    plt.plot(x,y,'-b')7    plt.plot(x,y,'-b')
nn8    plt.xlim([0,4*np.pi])
9    plt.ylim([-1.00, 1.00])
10    plt.xlabel('x (radians)')
11    plt.ylabel('sin(x)')
12    plt.savefig(filename)12    plt.savefig(filename)
13if __name__=='__main__':13if __name__=='__main__':
14    make_plot('my_plot.png')14    make_plot('my_plot.png')
15    if compare_plots('my_plot.png','instructors_plot.png'):15    if compare_plots('my_plot.png','instructors_plot.png'):
16        print('Success!')16        print('Success!')
17    else:17    else:
18        print('Keep trying.')18        print('Keep trying.')
19import matplotlib.pyplot as plt19import matplotlib.pyplot as plt
20from scipy.linalg import norm20from scipy.linalg import norm
21from scipy import sum,average21from scipy import sum,average
22def compare_plots(imagefile1,imagefile2):22def compare_plots(imagefile1,imagefile2):
23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
25    if img1.size!=img2.size:25    if img1.size!=img2.size:
26        return False26        return False
27    diff = img1 - img2  27    diff = img1 - img2  
28    nm = sum(abs(diff))  28    nm = sum(abs(diff))  
29    nz = norm(diff.ravel(), 0)  29    nz = norm(diff.ravel(), 0)  
30    return nm/img1.size < 1 and nz/img1.size < 130    return nm/img1.size < 1 and nz/img1.size < 1
31def to_grayscale(arr):31def to_grayscale(arr):
32    if len(arr.shape) == 3:32    if len(arr.shape) == 3:
33        return average(arr, -1)  33        return average(arr, -1)  
34    else:34    else:
35        return arr35        return arr
36def normalize(arr):36def normalize(arr):
37    rng = arr.max()-arr.min()37    rng = arr.max()-arr.min()
38    amin = arr.min()38    amin = arr.min()
39    return (arr-amin)*255/rngimport numpy as np39    return (arr-amin)*255/rngimport numpy as np
40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
t41pctl = np.percentile(scores, np.arange(0,100,25))t41pctl = np.percentile(scores,np.arange(0,100,25))
42best_cultivar_indices = np.where(scores >= pctl[-1])42best_cultivar_indices = np.where(scores >= pctl[-1])
43print(f'Cultivars with the following IDs are in the top quartile with a score of43print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
44best=cultivarIDs[best_cultivar_indices]44best=cultivarIDs[best_cultivar_indices]
45best.sort()45best.sort()
46print(', '.join([str(int(x)) for x in best]))46print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 108, P-Value: 2.94e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
n5    x = np.linspace(0,(np.pi* 4))n5    x_axis=np.linspace(0,(4* np.pi),80)
6    y = np.sin(x)6    y_axis=np.sin(x_axis)
7    plt.plot(x_axis,y_axis,'-b')
7    plt.xlim(0,(np.pi* 4))8    plt.xlim(0,(4*np.pi))
8    plt.ylim(-1,1)9    plt.ylim(-1,1)
t9    plt.plot(x,y,'-b')t
10    plt.savefig(filename)10    plt.savefig(filename)
11if __name__=='__main__':11if __name__=='__main__':
12    make_plot('my_plot.png')12    make_plot('my_plot.png')
13    if compare_plots('my_plot.png','instructors_plot.png'):13    if compare_plots('my_plot.png','instructors_plot.png'):
14        print('Success!')14        print('Success!')
15    else:15    else:
16        print('Keep trying.')16        print('Keep trying.')
17import matplotlib.pyplot as plt17import matplotlib.pyplot as plt
18from scipy.linalg import norm18from scipy.linalg import norm
19from scipy import sum,average19from scipy import sum,average
20def compare_plots(imagefile1,imagefile2):20def compare_plots(imagefile1,imagefile2):
21    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))21    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
22    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))22    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
23    if img1.size!=img2.size:23    if img1.size!=img2.size:
24        return False24        return False
25    diff = img1 - img2  25    diff = img1 - img2  
26    nm = sum(abs(diff))  26    nm = sum(abs(diff))  
27    nz = norm(diff.ravel(), 0)  27    nz = norm(diff.ravel(), 0)  
28    return nm/img1.size < 1 and nz/img1.size < 128    return nm/img1.size < 1 and nz/img1.size < 1
29def to_grayscale(arr):29def to_grayscale(arr):
30    if len(arr.shape) == 3:30    if len(arr.shape) == 3:
31        return average(arr, -1)  31        return average(arr, -1)  
32    else:32    else:
33        return arr33        return arr
34def normalize(arr):34def normalize(arr):
35    rng = arr.max()-arr.min()35    rng = arr.max()-arr.min()
36    amin = arr.min()36    amin = arr.min()
37    return (arr-amin)*255/rngimport numpy as np37    return (arr-amin)*255/rngimport numpy as np
38cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='38cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
39quartile_boundaries = np.percentile(scores,np.arange(0,100,25))39quartile_boundaries = np.percentile(scores,np.arange(0,100,25))
40top_indices, = np.where(scores>quartile_boundaries[-1])40top_indices, = np.where(scores>quartile_boundaries[-1])
41best_cultivar_indices=top_indices,41best_cultivar_indices=top_indices,
42print(f'Cultivars with the following IDs are in the top quartile with a score of42print(f'Cultivars with the following IDs are in the top quartile with a score of
> {quartile_boundaries[-1]} or better:')> {quartile_boundaries[-1]} or better:')
43best=cultivarIDs[best_cultivar_indices]43best=cultivarIDs[best_cultivar_indices]
44best.sort()44best.sort()
45print(', '.join([str(int(x)) for x in best]))45print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 386, P-Value: 2.94e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3def make_plot(filename):3def make_plot(filename):
n4    x = np.linspace(0,np.pi * 4,100)n4    x=np.linspace(0,np.pi * 4,100)
5    y = np.sin(x)5    y=np.sin(x)
6    plt.plot(x,y,'b')6    plt.plot(x,y,'b')
7    plt.xlabel('x(radians)')7    plt.xlabel('x(radians)')
8    plt.ylabel('sin(x)')8    plt.ylabel('sin(x)')
9    plt.margins(0,0)9    plt.margins(0,0)
10    plt.savefig(filename)10    plt.savefig(filename)
11if __name__=='__main__':11if __name__=='__main__':
12    make_plot('my_plot.png')12    make_plot('my_plot.png')
13    if compare_plots('my_plot.png','instructors_plot.png'):13    if compare_plots('my_plot.png','instructors_plot.png'):
t14        print('Success!')t14       print('Success!')
15    else:15    else:
16        print('Keep trying.')16        print('Keep trying.')
17import matplotlib.pyplot as plt17import matplotlib.pyplot as plt
18from scipy.linalg import norm18from scipy.linalg import norm
19from scipy import sum,average19from scipy import sum,average
20def compare_plots(imagefile1,imagefile2):20def compare_plots(imagefile1,imagefile2):
21    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))21    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
22    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))22    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
23    if img1.size!=img2.size:23    if img1.size!=img2.size:
24        return False24        return False
25    diff = img1 - img2  25    diff = img1 - img2  
26    nm = sum(abs(diff))  26    nm = sum(abs(diff))  
27    nz = norm(diff.ravel(), 0)  27    nz = norm(diff.ravel(), 0)  
28    return nm/img1.size < 1 and nz/img1.size < 128    return nm/img1.size < 1 and nz/img1.size < 1
29def to_grayscale(arr):29def to_grayscale(arr):
30    if len(arr.shape) == 3:30    if len(arr.shape) == 3:
31        return average(arr, -1)  31        return average(arr, -1)  
32    else:32    else:
33        return arr33        return arr
34def normalize(arr):34def normalize(arr):
35    rng = arr.max()-arr.min()35    rng = arr.max()-arr.min()
36    amin = arr.min()36    amin = arr.min()
37    return (arr-amin)*255/rngimport numpy as np37    return (arr-amin)*255/rngimport numpy as np
38cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='38cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
39pctl = np.percentile(scores,np.arange(0,100,25))39pctl = np.percentile(scores,np.arange(0,100,25))
40best_cultivar_indices = np.where(scores >= pctl[-1])40best_cultivar_indices = np.where(scores >= pctl[-1])
41print(f'Cultivars with the following IDs are in the top quartile with a score of41print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
42best=cultivarIDs[best_cultivar_indices]42best=cultivarIDs[best_cultivar_indices]
43best.sort()43best.sort()
44print(', '.join([str(int(x)) for x in best]))44print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 200, P-Value: 2.96e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
n5    x_val = np.linspace(0, 4 * np.pi, 100)n5    x = np.linspace(0,4*np.pi,100)
6    y_val = np.sin(x_val)6    y= np.sin(x)
7    plt.plot(x_val, y_val, 'b')7    plt.plot(x,y, 'b')
8    plt.xlabel('x(radians)')8    plt.xlabel('x (radians)')
9    plt.ylabel('sin(x)')9    plt.ylabel('sin(x)')
10    plt.margins(0,0)10    plt.margins(0,0)
11    plt.savefig(filename)11    plt.savefig(filename)
12if __name__=='__main__':12if __name__=='__main__':
13    make_plot('my_plot.png')13    make_plot('my_plot.png')
14    if compare_plots('my_plot.png','instructors_plot.png'):14    if compare_plots('my_plot.png','instructors_plot.png'):
15        print('Success!')15        print('Success!')
16    else:16    else:
17        print('Keep trying.')17        print('Keep trying.')
18import matplotlib.pyplot as plt18import matplotlib.pyplot as plt
19from scipy.linalg import norm19from scipy.linalg import norm
20from scipy import sum,average20from scipy import sum,average
21def compare_plots(imagefile1,imagefile2):21def compare_plots(imagefile1,imagefile2):
22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
24    if img1.size!=img2.size:24    if img1.size!=img2.size:
25        return False25        return False
26    diff = img1 - img2  26    diff = img1 - img2  
27    nm = sum(abs(diff))  27    nm = sum(abs(diff))  
28    nz = norm(diff.ravel(), 0)  28    nz = norm(diff.ravel(), 0)  
29    return nm/img1.size < 1 and nz/img1.size < 129    return nm/img1.size < 1 and nz/img1.size < 1
30def to_grayscale(arr):30def to_grayscale(arr):
31    if len(arr.shape) == 3:31    if len(arr.shape) == 3:
32        return average(arr, -1)  32        return average(arr, -1)  
33    else:33    else:
34        return arr34        return arr
35def normalize(arr):35def normalize(arr):
36    rng = arr.max()-arr.min()36    rng = arr.max()-arr.min()
37    amin = arr.min()37    amin = arr.min()
38    return (arr-amin)*255/rngimport numpy as np38    return (arr-amin)*255/rngimport numpy as np
39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
40pctl = np.percentile(scores,np.arange(0,100,25))40pctl = np.percentile(scores,np.arange(0,100,25))
t41best_cultivar_indices = np.where(scores>pctl[-1])t41best_cultivar_indices = np.where(scores >pctl[-1])
42print(f'Cultivars with the following IDs are in the top quartile with a score of42print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
43best=cultivarIDs[best_cultivar_indices]43best=cultivarIDs[best_cultivar_indices]
44best.sort()44best.sort()
45print(', '.join([str(int(x)) for x in best]))45print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 389, P-Value: 2.99e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
n5    x = np.arange(0.0,4*np.pi,0.01)n5    x = np.linspace(0, 4*np.pi, 80)
6    plt.plot(x,np.sin(x))6    y = np.sin(x)
7    plt.xlabel('x (radians)')7    plt.xlabel('x (radians)')
8    plt.ylabel('sin(x)')8    plt.ylabel('sin(x)')
n9    plt.xlim(1,4*np.pi)n9    plt.xlim(0, 4*np.pi)
10    plt.ylim(-1,1)10    plt.ylim(-1,1)
t11    plt.xticks(list(np.linspace(0, 12, 7)))t11    plt.plot(x, y, '-b')
12    plt.savefig(filename)12    plt.savefig(filename)
13if __name__=='__main__':13if __name__=='__main__':
14    make_plot('my_plot.png')14    make_plot('my_plot.png')
15    if compare_plots('my_plot.png','instructors_plot.png'):15    if compare_plots('my_plot.png','instructors_plot.png'):
16        print('Success!')16        print('Success!')
17    else:17    else:
18        print('Keep trying.')18        print('Keep trying.')
19import matplotlib.pyplot as plt19import matplotlib.pyplot as plt
20from scipy.linalg import norm20from scipy.linalg import norm
21from scipy import sum,average21from scipy import sum,average
22def compare_plots(imagefile1,imagefile2):22def compare_plots(imagefile1,imagefile2):
23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
25    if img1.size!=img2.size:25    if img1.size!=img2.size:
26        return False26        return False
27    diff = img1 - img2  27    diff = img1 - img2  
28    nm = sum(abs(diff))  28    nm = sum(abs(diff))  
29    nz = norm(diff.ravel(), 0)  29    nz = norm(diff.ravel(), 0)  
30    return nm/img1.size < 1 and nz/img1.size < 130    return nm/img1.size < 1 and nz/img1.size < 1
31def to_grayscale(arr):31def to_grayscale(arr):
32    if len(arr.shape) == 3:32    if len(arr.shape) == 3:
33        return average(arr, -1)  33        return average(arr, -1)  
34    else:34    else:
35        return arr35        return arr
36def normalize(arr):36def normalize(arr):
37    rng = arr.max()-arr.min()37    rng = arr.max()-arr.min()
38    amin = arr.min()38    amin = arr.min()
39    return (arr-amin)*255/rngimport numpy as np39    return (arr-amin)*255/rngimport numpy as np
40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
41quartile_boundaries = np.percentile(scores,np.arange(0,100,25))41quartile_boundaries = np.percentile(scores,np.arange(0,100,25))
42top_indices, = np.where(scores>quartile_boundaries[-1])42top_indices, = np.where(scores>quartile_boundaries[-1])
43print(f'Cultivars with the following IDs are in the top quartile with a score of43print(f'Cultivars with the following IDs are in the top quartile with a score of
> {quartile_boundaries[-1]} or better:')> {quartile_boundaries[-1]} or better:')
44best=cultivarIDs[top_indices]44best=cultivarIDs[top_indices]
45best.sort()45best.sort()
46print(', '.join([str(int(x)) for x in best]))46print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 244, P-Value: 3.01e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
n5    x = np.linspace(0,(4*(np.pi)))n5    x = np.linspace(0, 4*np.pi, 80) 
6    y = np.sin(x)
7    limits = [0,(4*np.pi),-1,1]
8    plt.plot(x,y,'-b')6    plt.plot(x,np.sin(x), 'b-')
9    plt.axis(limits)7    plt.axis([0,4*np.pi,-1,1])
8    plt.xlabel('x (radians)')
10    plt.ylabel('sin(x)')9    plt.ylabel('sin(x)')
n11    plt.xlabel('x (radians)')n
12    plt.savefig(filename)10    plt.savefig(filename)
13if __name__=='__main__':11if __name__=='__main__':
14    make_plot('my_plot.png')12    make_plot('my_plot.png')
15    if compare_plots('my_plot.png','instructors_plot.png'):13    if compare_plots('my_plot.png','instructors_plot.png'):
16        print('Success!')14        print('Success!')
17    else:15    else:
18        print('Keep trying.')16        print('Keep trying.')
19import matplotlib.pyplot as plt17import matplotlib.pyplot as plt
20from scipy.linalg import norm18from scipy.linalg import norm
21from scipy import sum,average19from scipy import sum,average
22def compare_plots(imagefile1,imagefile2):20def compare_plots(imagefile1,imagefile2):
23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))21    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))22    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
25    if img1.size!=img2.size:23    if img1.size!=img2.size:
26        return False24        return False
27    diff = img1 - img2  25    diff = img1 - img2  
28    nm = sum(abs(diff))  26    nm = sum(abs(diff))  
29    nz = norm(diff.ravel(), 0)  27    nz = norm(diff.ravel(), 0)  
30    return nm/img1.size < 1 and nz/img1.size < 128    return nm/img1.size < 1 and nz/img1.size < 1
31def to_grayscale(arr):29def to_grayscale(arr):
32    if len(arr.shape) == 3:30    if len(arr.shape) == 3:
33        return average(arr, -1)  31        return average(arr, -1)  
34    else:32    else:
35        return arr33        return arr
36def normalize(arr):34def normalize(arr):
37    rng = arr.max()-arr.min()35    rng = arr.max()-arr.min()
38    amin = arr.min()36    amin = arr.min()
39    return (arr-amin)*255/rngimport numpy as np37    return (arr-amin)*255/rngimport numpy as np
40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='38cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
t41quartile_boundaries = np.percentile(scores,np.arange(0,100,25))t39quartile_boundaries = np.percentile(scores,np.arange(0,100,75))
42best_cultivar_indices, = np.where(scores>quartile_boundaries[-1])40best_cultivar_indices, = np.where(scores>quartile_boundaries[-1])
43print(f'Cultivars with the following IDs are in the top quartile with a score of41print(f'Cultivars with the following IDs are in the top quartile with a score of
> {quartile_boundaries[-1]} or better:')> {quartile_boundaries[-1]} or better:')
44best=cultivarIDs[best_cultivar_indices]42best=cultivarIDs[best_cultivar_indices]
45best.sort()43best.sort()
46print(', '.join([str(int(x)) for x in best]))44print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 376, P-Value: 3.01e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
n5    xval = np.linspace(0,np.pi*4,100)n5    x_val = np.linspace(0, 4 * np.pi, 100)
6    yval = np.sin(xval)6    y_val = np.sin(x_val)
7    plt.plot(xval,yval,'b')7    plt.plot(x_val, y_val, 'b')
8    plt.xlabel('x(radians)')8    plt.xlabel('x(radians)')
9    plt.ylabel('sin(x)')9    plt.ylabel('sin(x)')
10    plt.margins(0,0)10    plt.margins(0,0)
t11    plt.ylim([-1,1])t
12    plt.show()
13    plt.savefig(filename)11    plt.savefig(filename)
14if __name__=='__main__':12if __name__=='__main__':
15    make_plot('my_plot.png')13    make_plot('my_plot.png')
16    if compare_plots('my_plot.png','instructors_plot.png'):14    if compare_plots('my_plot.png','instructors_plot.png'):
17        print('Success!')15        print('Success!')
18    else:16    else:
19        print('Keep trying.')17        print('Keep trying.')
20import matplotlib.pyplot as plt18import matplotlib.pyplot as plt
21from scipy.linalg import norm19from scipy.linalg import norm
22from scipy import sum,average20from scipy import sum,average
23def compare_plots(imagefile1,imagefile2):21def compare_plots(imagefile1,imagefile2):
24    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
25    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
26    if img1.size!=img2.size:24    if img1.size!=img2.size:
27        return False25        return False
28    diff = img1 - img2  26    diff = img1 - img2  
29    nm = sum(abs(diff))  27    nm = sum(abs(diff))  
30    nz = norm(diff.ravel(), 0)  28    nz = norm(diff.ravel(), 0)  
31    return nm/img1.size < 1 and nz/img1.size < 129    return nm/img1.size < 1 and nz/img1.size < 1
32def to_grayscale(arr):30def to_grayscale(arr):
33    if len(arr.shape) == 3:31    if len(arr.shape) == 3:
34        return average(arr, -1)  32        return average(arr, -1)  
35    else:33    else:
36        return arr34        return arr
37def normalize(arr):35def normalize(arr):
38    rng = arr.max()-arr.min()36    rng = arr.max()-arr.min()
39    amin = arr.min()37    amin = arr.min()
40    return (arr-amin)*255/rngimport numpy as np38    return (arr-amin)*255/rngimport numpy as np
41cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
42pctl = np.percentile(scores,np.arange(0,100,25))40pctl = np.percentile(scores,np.arange(0,100,25))
43best_cultivar_indices = np.where(scores>pctl[-1])41best_cultivar_indices = np.where(scores>pctl[-1])
44print(f'Cultivars with the following IDs are in the top quartile with a score of42print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
45best=cultivarIDs[best_cultivar_indices]43best=cultivarIDs[best_cultivar_indices]
46best.sort()44best.sort()
47print(', '.join([str(int(x)) for x in best]))45print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 151, P-Value: 3.05e-01

Student (left) and Nearest Neighbor (right).


nn1import matplotlib.pyplot as plt
1import numpy as np2import numpy as np
n2import matplotlib.pyplot as pltn
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
n5    x = np.linspace(0,4*np.pi, 80)n5    x = np.linspace(0,4*np.pi, num = 80)
6    y = np.sin(x)6    y = np.sin(x)
n7    plt.ylim([-1.0,1.0])n
8    plt.xlim([0,4*np.pi])7    plt.xlim([0,4*np.pi])
nn8    plt.ylim([-1,1])
9    plt.xticks(list(range(0,13,2)))
10    plt.xlabel('x(radians)')
11    plt.ylabel('sin(x)')
9    plt.plot(x,y, '-b')12    plt.plot(x,y, '-b')
n10    plt.xlabel('x (radians)')n
11    plt.ylabel('sin(x)')
12    plt.savefig(filename)13    plt.savefig(filename)
13if __name__=='__main__':14if __name__=='__main__':
14    make_plot('my_plot.png')15    make_plot('my_plot.png')
15    if compare_plots('my_plot.png','instructors_plot.png'):16    if compare_plots('my_plot.png','instructors_plot.png'):
16        print('Success!')17        print('Success!')
17    else:18    else:
18        print('Keep trying.')19        print('Keep trying.')
19import matplotlib.pyplot as plt20import matplotlib.pyplot as plt
20from scipy.linalg import norm21from scipy.linalg import norm
21from scipy import sum,average22from scipy import sum,average
22def compare_plots(imagefile1,imagefile2):23def compare_plots(imagefile1,imagefile2):
23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))24    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))25    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
25    if img1.size!=img2.size:26    if img1.size!=img2.size:
26        return False27        return False
27    diff = img1 - img2  28    diff = img1 - img2  
28    nm = sum(abs(diff))  29    nm = sum(abs(diff))  
29    nz = norm(diff.ravel(), 0)  30    nz = norm(diff.ravel(), 0)  
30    return nm/img1.size < 1 and nz/img1.size < 131    return nm/img1.size < 1 and nz/img1.size < 1
31def to_grayscale(arr):32def to_grayscale(arr):
32    if len(arr.shape) == 3:33    if len(arr.shape) == 3:
33        return average(arr, -1)  34        return average(arr, -1)  
34    else:35    else:
35        return arr36        return arr
36def normalize(arr):37def normalize(arr):
37    rng = arr.max()-arr.min()38    rng = arr.max()-arr.min()
38    amin = arr.min()39    amin = arr.min()
39    return (arr-amin)*255/rngimport numpy as np40    return (arr-amin)*255/rngimport numpy as np
40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='41cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
41quartile_boundaries = np.percentile(scores,np.arange(0,100,25))42quartile_boundaries = np.percentile(scores,np.arange(0,100,25))
t42pctl = np.percentile(scores, np.arange(0,100,25))t43pctl = quartile_boundaries
43best_cultivar_indices, = np.where(scores>pctl[-1])44best_cultivar_indices, = np.where(scores>quartile_boundaries[-1])
44print(f'Cultivars with the following IDs are in the top quartile with a score of45print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
45best=cultivarIDs[best_cultivar_indices]46best=cultivarIDs[best_cultivar_indices]
46best.sort()47best.sort()
47print(', '.join([str(int(x)) for x in best]))48print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 47, P-Value: 3.05e-01

Student (left) and Nearest Neighbor (right).


nn1import numpy as np
1import matplotlib.pyplot as plt2import matplotlib.pyplot as plt
n2import numpy as npn
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
n5    x = np.linspace(0,4*np.pi, num = 80)n5    x = np.linspace(0,4*np.pi, 80)
6    y = np.sin(x)6    y = np.sin(x)
nn7    plt.ylim([-1.0,1.0])
7    plt.xlim([0,4*np.pi])8    plt.xlim([0,4*np.pi])
n8    plt.ylim([-1,1])n9    plt.plot(x,y, '-b')
9    plt.xticks(list(range(0,13,2)))
10    plt.xlabel('x(radians)')10    plt.xlabel('x (radians)')
11    plt.ylabel('sin(x)')11    plt.ylabel('sin(x)')
n12    plt.plot(x,y, '-b')n
13    plt.savefig(filename)12    plt.savefig(filename)
14if __name__=='__main__':13if __name__=='__main__':
15    make_plot('my_plot.png')14    make_plot('my_plot.png')
16    if compare_plots('my_plot.png','instructors_plot.png'):15    if compare_plots('my_plot.png','instructors_plot.png'):
17        print('Success!')16        print('Success!')
18    else:17    else:
19        print('Keep trying.')18        print('Keep trying.')
20import matplotlib.pyplot as plt19import matplotlib.pyplot as plt
21from scipy.linalg import norm20from scipy.linalg import norm
22from scipy import sum,average21from scipy import sum,average
23def compare_plots(imagefile1,imagefile2):22def compare_plots(imagefile1,imagefile2):
24    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
25    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
26    if img1.size!=img2.size:25    if img1.size!=img2.size:
27        return False26        return False
28    diff = img1 - img2  27    diff = img1 - img2  
29    nm = sum(abs(diff))  28    nm = sum(abs(diff))  
30    nz = norm(diff.ravel(), 0)  29    nz = norm(diff.ravel(), 0)  
31    return nm/img1.size < 1 and nz/img1.size < 130    return nm/img1.size < 1 and nz/img1.size < 1
32def to_grayscale(arr):31def to_grayscale(arr):
33    if len(arr.shape) == 3:32    if len(arr.shape) == 3:
34        return average(arr, -1)  33        return average(arr, -1)  
35    else:34    else:
36        return arr35        return arr
37def normalize(arr):36def normalize(arr):
38    rng = arr.max()-arr.min()37    rng = arr.max()-arr.min()
39    amin = arr.min()38    amin = arr.min()
40    return (arr-amin)*255/rngimport numpy as np39    return (arr-amin)*255/rngimport numpy as np
41cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
42quartile_boundaries = np.percentile(scores,np.arange(0,100,25))41quartile_boundaries = np.percentile(scores,np.arange(0,100,25))
t43pctl = quartile_boundariest42pctl = np.percentile(scores, np.arange(0,100,25))
44best_cultivar_indices, = np.where(scores>quartile_boundaries[-1])43best_cultivar_indices, = np.where(scores>pctl[-1])
45print(f'Cultivars with the following IDs are in the top quartile with a score of44print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
46best=cultivarIDs[best_cultivar_indices]45best=cultivarIDs[best_cultivar_indices]
47best.sort()46best.sort()
48print(', '.join([str(int(x)) for x in best]))47print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 226, P-Value: 3.08e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
n5    X=np.linspace(0,4*np.pi,80)n5    = np.linspace(0, 4*np.pi, 80)
6    Y=np.sin(X)6    = np.sin(x)
7    plt.xlim([0,4*np.pi])
8    plt.ylim([-1,1])
9    plt.xlabel('x(radians)')7    plt.xlabel('x (radians)')
10    plt.ylabel('sin(x)')8    plt.ylabel('sin(x)')
tt9    plt.xlim(0, 4*np.pi)
10    plt.ylim(-1,1)
11    plt.plot(X,Y,'-b')11    plt.plot(x, y, '-b')
12    plt.savefig(filename)12    plt.savefig(filename)
13if __name__=='__main__':13if __name__=='__main__':
14    make_plot('my_plot.png')14    make_plot('my_plot.png')
15    if compare_plots('my_plot.png','instructors_plot.png'):15    if compare_plots('my_plot.png','instructors_plot.png'):
16        print('Success!')16        print('Success!')
17    else:17    else:
18        print('Keep trying.')18        print('Keep trying.')
19import matplotlib.pyplot as plt19import matplotlib.pyplot as plt
20from scipy.linalg import norm20from scipy.linalg import norm
21from scipy import sum,average21from scipy import sum,average
22def compare_plots(imagefile1,imagefile2):22def compare_plots(imagefile1,imagefile2):
23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
25    if img1.size!=img2.size:25    if img1.size!=img2.size:
26        return False26        return False
27    diff = img1 - img2  27    diff = img1 - img2  
28    nm = sum(abs(diff))  28    nm = sum(abs(diff))  
29    nz = norm(diff.ravel(), 0)  29    nz = norm(diff.ravel(), 0)  
30    return nm/img1.size < 1 and nz/img1.size < 130    return nm/img1.size < 1 and nz/img1.size < 1
31def to_grayscale(arr):31def to_grayscale(arr):
32    if len(arr.shape) == 3:32    if len(arr.shape) == 3:
33        return average(arr, -1)  33        return average(arr, -1)  
34    else:34    else:
35        return arr35        return arr
36def normalize(arr):36def normalize(arr):
37    rng = arr.max()-arr.min()37    rng = arr.max()-arr.min()
38    amin = arr.min()38    amin = arr.min()
39    return (arr-amin)*255/rngimport numpy as np39    return (arr-amin)*255/rngimport numpy as np
40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
41quartile_boundaries = np.percentile(scores,np.arange(0,100,25))41quartile_boundaries = np.percentile(scores,np.arange(0,100,25))
42top_indices, = np.where(scores>quartile_boundaries[-1])42top_indices, = np.where(scores>quartile_boundaries[-1])
43print(f'Cultivars with the following IDs are in the top quartile with a score of43print(f'Cultivars with the following IDs are in the top quartile with a score of
> {quartile_boundaries[-1]} or better:')> {quartile_boundaries[-1]} or better:')
44best=cultivarIDs[top_indices]44best=cultivarIDs[top_indices]
45best.sort()45best.sort()
46print(', '.join([str(int(x)) for x in best]))46print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 60, P-Value: 3.10e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
n5    plt.ylim([-1.00,1.00])n5    x = np.linspace(0,13, num= 80)
6    plt.xlim([0,12.5663706144])6    y = np.sin(x)
7    plt.xlabel('x (radians)')7    plt.xlabel('x (radians)')
8    plt.ylabel('sin(x)')8    plt.ylabel('sin(x)')
t9    x = np.linspace(0, 12.5663706144, 80, True)t9    plt.xlim([0,12.5664])
10    y = np.sin(x)10    plt.ylim([-1,1])
11    plt.plot(x,y)11    plt.plot(x,y,'b')
12    plt.savefig(filename)12    plt.savefig(filename)
13if __name__=='__main__':13if __name__=='__main__':
14    make_plot('my_plot.png')14    make_plot('my_plot.png')
15    if compare_plots('my_plot.png','instructors_plot.png'):15    if compare_plots('my_plot.png','instructors_plot.png'):
16        print('Success!')16        print('Success!')
17    else:17    else:
18        print('Keep trying.')18        print('Keep trying.')
19import matplotlib.pyplot as plt19import matplotlib.pyplot as plt
20from scipy.linalg import norm20from scipy.linalg import norm
21from scipy import sum,average21from scipy import sum,average
22def compare_plots(imagefile1,imagefile2):22def compare_plots(imagefile1,imagefile2):
23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
25    if img1.size!=img2.size:25    if img1.size!=img2.size:
26        return False26        return False
27    diff = img1 - img2  27    diff = img1 - img2  
28    nm = sum(abs(diff))  28    nm = sum(abs(diff))  
29    nz = norm(diff.ravel(), 0)  29    nz = norm(diff.ravel(), 0)  
30    return nm/img1.size < 1 and nz/img1.size < 130    return nm/img1.size < 1 and nz/img1.size < 1
31def to_grayscale(arr):31def to_grayscale(arr):
32    if len(arr.shape) == 3:32    if len(arr.shape) == 3:
33        return average(arr, -1)  33        return average(arr, -1)  
34    else:34    else:
35        return arr35        return arr
36def normalize(arr):36def normalize(arr):
37    rng = arr.max()-arr.min()37    rng = arr.max()-arr.min()
38    amin = arr.min()38    amin = arr.min()
39    return (arr-amin)*255/rngimport numpy as np39    return (arr-amin)*255/rngimport numpy as np
40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
41quartile_boundaries = np.percentile(scores,np.arange(0,100,25))41quartile_boundaries = np.percentile(scores,np.arange(0,100,25))
42best_cultivar_indices, = np.where(scores>quartile_boundaries[-1])42best_cultivar_indices, = np.where(scores>quartile_boundaries[-1])
43print(f'Cultivars with the following IDs are in the top quartile with a score of43print(f'Cultivars with the following IDs are in the top quartile with a score of
> {quartile_boundaries[-1]} or better:')> {quartile_boundaries[-1]} or better:')
44best=cultivarIDs[best_cultivar_indices]44best=cultivarIDs[best_cultivar_indices]
45best.sort()45best.sort()
46print(', '.join([str(int(x)) for x in best]))46print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 94, P-Value: 3.15e-01

Student (left) and Nearest Neighbor (right).


n1from math import radiansn
2import matplotlib.pyplot as plt1import matplotlib.pyplot as plt
3import numpy as np2import numpy as np
4from compare_plots import compare_plots3from compare_plots import compare_plots
nn4from math import sin, pi
5def make_plot(filename):5def make_plot(filename):
n6    x = np.linspace(0, 4*np.pi, num=80)n
7    y = np.sin(x)
8    plt.plot(x, y, '-b')
9    plt.xlim([0, 4*np.pi])6    plt.xlim([0,4*pi])
10    plt.ylim([-1.00, 1.00])7    plt.ylim([-1,1])
8    x = np.linspace(0,13, num=80)
9    y = [sin(x) for x in x]
11    plt.xlabel('x (radians)')10    plt.xlabel('x (radians)')
12    plt.ylabel('sin(x)')11    plt.ylabel('sin(x)')
nn12    plt.plot(x,y, '-b')
13    plt.savefig(filename)13    plt.savefig(filename)
14if __name__=='__main__':14if __name__=='__main__':
15    make_plot('my_plot.png')15    make_plot('my_plot.png')
16    if compare_plots('my_plot.png','instructors_plot.png'):16    if compare_plots('my_plot.png','instructors_plot.png'):
17        print('Success!')17        print('Success!')
18    else:18    else:
19        print('Keep trying.')19        print('Keep trying.')
20import matplotlib.pyplot as plt20import matplotlib.pyplot as plt
21from scipy.linalg import norm21from scipy.linalg import norm
22from scipy import sum,average22from scipy import sum,average
23def compare_plots(imagefile1,imagefile2):23def compare_plots(imagefile1,imagefile2):
24    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))24    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
25    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))25    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
26    if img1.size!=img2.size:26    if img1.size!=img2.size:
27        return False27        return False
28    diff = img1 - img2  28    diff = img1 - img2  
29    nm = sum(abs(diff))  29    nm = sum(abs(diff))  
30    nz = norm(diff.ravel(), 0)  30    nz = norm(diff.ravel(), 0)  
31    return nm/img1.size < 1 and nz/img1.size < 131    return nm/img1.size < 1 and nz/img1.size < 1
32def to_grayscale(arr):32def to_grayscale(arr):
33    if len(arr.shape) == 3:33    if len(arr.shape) == 3:
34        return average(arr, -1)  34        return average(arr, -1)  
35    else:35    else:
36        return arr36        return arr
37def normalize(arr):37def normalize(arr):
38    rng = arr.max()-arr.min()38    rng = arr.max()-arr.min()
39    amin = arr.min()39    amin = arr.min()
40    return (arr-amin)*255/rngimport numpy as np40    return (arr-amin)*255/rngimport numpy as np
41cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='41cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
t42percentile = np.percentile(scores,np.arange(0,100,25))t42pctl = np.percentile(scores,np.arange(0,100,25))
43best_cultivar_indices, = np.where(scores>percentile[-1])43best_cultivar_indices, = np.where(scores>pctl[-1])
44print(f'Cultivars with the following IDs are in the top quartile with a score of44print(f'Cultivars with the following IDs are in the top quartile with a score of
> {percentile[-1]} or better:')> {pctl[-1]} or better:')
45best=cultivarIDs[best_cultivar_indices]45best=cultivarIDs[best_cultivar_indices]
46best.sort()46best.sort()
47print(', '.join([str(int(x)) for x in best]))47print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 160, P-Value: 3.17e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
nn5    x = np.arange(0,4 *np.pi,0.01)
6    y = np.sin(x)
7    plt.plot(x,y)
8    plt.ylim([-1,1])
5    plt.xlabel('x (radians)')9    plt.xlabel('x (radians)')
6    plt.ylabel('sin(x)')10    plt.ylabel('sin(x)')
n7    x = np.linspace(0,4*np.pi,num=80)n
8    y = np.sin(x)
9    plt.plot(x,y)
10    plt.xlim([0,4*np.pi])11    plt.xlim([0,4*np.pi])
n11    plt.ylim([-1.0,1.0])n
12    plt.savefig(filename)12    plt.savefig(filename)
13if __name__=='__main__':13if __name__=='__main__':
14    make_plot('my_plot.png')14    make_plot('my_plot.png')
15    if compare_plots('my_plot.png','instructors_plot.png'):15    if compare_plots('my_plot.png','instructors_plot.png'):
16        print('Success!')16        print('Success!')
17    else:17    else:
18        print('Keep trying.')18        print('Keep trying.')
19import matplotlib.pyplot as plt19import matplotlib.pyplot as plt
20from scipy.linalg import norm20from scipy.linalg import norm
21from scipy import sum,average21from scipy import sum,average
22def compare_plots(imagefile1,imagefile2):22def compare_plots(imagefile1,imagefile2):
23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
25    if img1.size!=img2.size:25    if img1.size!=img2.size:
26        return False26        return False
27    diff = img1 - img2  27    diff = img1 - img2  
28    nm = sum(abs(diff))  28    nm = sum(abs(diff))  
29    nz = norm(diff.ravel(), 0)  29    nz = norm(diff.ravel(), 0)  
30    return nm/img1.size < 1 and nz/img1.size < 130    return nm/img1.size < 1 and nz/img1.size < 1
31def to_grayscale(arr):31def to_grayscale(arr):
32    if len(arr.shape) == 3:32    if len(arr.shape) == 3:
33        return average(arr, -1)  33        return average(arr, -1)  
34    else:34    else:
35        return arr35        return arr
36def normalize(arr):36def normalize(arr):
37    rng = arr.max()-arr.min()37    rng = arr.max()-arr.min()
38    amin = arr.min()38    amin = arr.min()
39    return (arr-amin)*255/rngimport numpy as np39    return (arr-amin)*255/rngimport numpy as np
40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
t41my_array = list(scores)t
42pctl = np.percentile(my_array,np.arange(0,100,25))41pctl = np.percentile(scores,np.arange(0,100,25))
43best_cultivar_indices, = np.where(my_array>pctl[-1])42best_cultivar_indices, = np.where(scores>pctl[-1])
44print(f'Cultivars with the following IDs are in the top quartile with a score of43print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
45best=cultivarIDs[best_cultivar_indices]44best=cultivarIDs[best_cultivar_indices]
46best.sort()45best.sort()
47print(', '.join([str(int(x)) for x in best]))46print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 170, P-Value: 3.21e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
nn3from compare_plots import compare_plots
3def make_plot(filename):4def make_plot(filename):
4    x=np.linspace(0,np.pi*4,80)5    x=np.linspace(0,np.pi*4,80)
5    y=np.sin(x)6    y=np.sin(x)
6    plt.plot(x,y,'b')7    plt.plot(x,y,'b')
t7    plt.xlabel('x(radians')t8    plt.xlabel('x(radians)')
8    plt.ylabel('sin(x)')9    plt.ylabel('sin(x)')
9    plt.margins(0,0)10    plt.margins(0,0)
10    plt.savefig(filename)11    plt.savefig(filename)
11if __name__=='__main__':12if __name__=='__main__':
12    make_plot('my_plot.png')13    make_plot('my_plot.png')
13    if compare_plots('my_plot.png','instructors_plot.png'):14    if compare_plots('my_plot.png','instructors_plot.png'):
14        print('Success!')15        print('Success!')
15    else:16    else:
16        print('Keep trying.')17        print('Keep trying.')
17import matplotlib.pyplot as plt18import matplotlib.pyplot as plt
18from scipy.linalg import norm19from scipy.linalg import norm
19from scipy import sum,average20from scipy import sum,average
20def compare_plots(imagefile1,imagefile2):21def compare_plots(imagefile1,imagefile2):
21    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
22    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
23    if img1.size!=img2.size:24    if img1.size!=img2.size:
24        return False25        return False
25    diff = img1 - img2  26    diff = img1 - img2  
26    nm = sum(abs(diff))  27    nm = sum(abs(diff))  
27    nz = norm(diff.ravel(), 0)  28    nz = norm(diff.ravel(), 0)  
28    return nm/img1.size < 1 and nz/img1.size < 129    return nm/img1.size < 1 and nz/img1.size < 1
29def to_grayscale(arr):30def to_grayscale(arr):
30    if len(arr.shape) == 3:31    if len(arr.shape) == 3:
31        return average(arr, -1)  32        return average(arr, -1)  
32    else:33    else:
33        return arr34        return arr
34def normalize(arr):35def normalize(arr):
35    rng = arr.max()-arr.min()36    rng = arr.max()-arr.min()
36    amin = arr.min()37    amin = arr.min()
37    return (arr-amin)*255/rngimport numpy as np38    return (arr-amin)*255/rngimport numpy as np
38cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
39pctl = np.percentile(scores, np.arange(0,100,25))40pctl = np.percentile(scores, np.arange(0,100,25))
40best_cultivar_indices = np.where(scores >= pctl[-1])41best_cultivar_indices = np.where(scores >= pctl[-1])
41print(f'Cultivars with the following IDs are in the top quartile with a score of42print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
42best=cultivarIDs[best_cultivar_indices]43best=cultivarIDs[best_cultivar_indices]
43best.sort()44best.sort()
44print(', '.join([str(int(x)) for x in best]))45print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 50, P-Value: 3.24e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
n4from math import sinn
5from math import pi
6def make_plot(filename):4def make_plot(filename):
n7    x = np.linspace(start=0,stop=4*pi,num=80)n5    x = np.linspace(0, 4*np.pi, 80)
8    y=np.sin(x)6    y = np.sin(x)
9    plt.plot(x,y,'-b')
10    plt.xlim(0,4*pi)
11    plt.ylim(-1,1)
12    plt.xlabel('x (radians)')7    plt.xlabel('x (radians)')
13    plt.ylabel('sin(x)')8    plt.ylabel('sin(x)')
nn9    plt.xlim(0, 4*np.pi)
10    plt.ylim(-1,1)
11    plt.plot(x, y, '-b')
14    plt.savefig(filename)12    plt.savefig(filename)
15if __name__=='__main__':13if __name__=='__main__':
16    make_plot('my_plot.png')14    make_plot('my_plot.png')
17    if compare_plots('my_plot.png','instructors_plot.png'):15    if compare_plots('my_plot.png','instructors_plot.png'):
18        print('Success!')16        print('Success!')
19    else:17    else:
20        print('Keep trying.')18        print('Keep trying.')
21import matplotlib.pyplot as plt19import matplotlib.pyplot as plt
22from scipy.linalg import norm20from scipy.linalg import norm
23from scipy import sum,average21from scipy import sum,average
24def compare_plots(imagefile1,imagefile2):22def compare_plots(imagefile1,imagefile2):
25    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
26    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
27    if img1.size!=img2.size:25    if img1.size!=img2.size:
28        return False26        return False
29    diff = img1 - img2  27    diff = img1 - img2  
30    nm = sum(abs(diff))  28    nm = sum(abs(diff))  
31    nz = norm(diff.ravel(), 0)  29    nz = norm(diff.ravel(), 0)  
32    return nm/img1.size < 1 and nz/img1.size < 130    return nm/img1.size < 1 and nz/img1.size < 1
33def to_grayscale(arr):31def to_grayscale(arr):
34    if len(arr.shape) == 3:32    if len(arr.shape) == 3:
35        return average(arr, -1)  33        return average(arr, -1)  
36    else:34    else:
37        return arr35        return arr
38def normalize(arr):36def normalize(arr):
39    rng = arr.max()-arr.min()37    rng = arr.max()-arr.min()
40    amin = arr.min()38    amin = arr.min()
41    return (arr-amin)*255/rngimport numpy as np39    return (arr-amin)*255/rngimport numpy as np
42cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
43quartile_boundaries = np.percentile(scores,np.arange(0,100,25))41quartile_boundaries = np.percentile(scores,np.arange(0,100,25))
n44best_cultivar_indices, = np.where(scores>quartile_boundaries[-1])n42top_indices, = np.where(scores>quartile_boundaries[-1])
45print(f'Cultivars with the following IDs are in the top quartile with a score of43print(f'Cultivars with the following IDs are in the top quartile with a score of
> {quartile_boundaries[-1]} or better:')> {quartile_boundaries[-1]} or better:')
t46best=cultivarIDs[best_cultivar_indices]t44best=cultivarIDs[top_indices]
47best.sort()45best.sort()
48print(', '.join([str(int(x)) for x in best]))46print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 267, P-Value: 3.24e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
n5    plt.xlim([0,np.pi*4])n
6    plt.xticks(list(range(0,13,2)))5    plt.xticks(list(range(0,13,2)))
tt6    plt.axis([0,4*np.pi,-1,1])
7    x = np.linspace(0, 4*np.pi, 80)
8    wave_f = np.sin(x)
9    plt.xlabel('sin(x)')
7    plt.xlabel('x (radians)')10    plt.ylabel('x (radians)')
8    plt.ylabel('sin(x)')11    plt.plot(x,wave_f)
9    plt.ylim([-1,1])
10    x = np.linspace(0, np.pi*4, 201)
11    plt.plot(x, np.sin(x), '-b')
12    plt.show()
13    plt.savefig(filename)12    plt.savefig(filename)
14if __name__=='__main__':13if __name__=='__main__':
15    make_plot('my_plot.png')14    make_plot('my_plot.png')
16    if compare_plots('my_plot.png','instructors_plot.png'):15    if compare_plots('my_plot.png','instructors_plot.png'):
17        print('Success!')16        print('Success!')
18    else:17    else:
19        print('Keep trying.')18        print('Keep trying.')
20import matplotlib.pyplot as plt19import matplotlib.pyplot as plt
21from scipy.linalg import norm20from scipy.linalg import norm
22from scipy import sum,average21from scipy import sum,average
23def compare_plots(imagefile1,imagefile2):22def compare_plots(imagefile1,imagefile2):
24    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
25    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
26    if img1.size!=img2.size:25    if img1.size!=img2.size:
27        return False26        return False
28    diff = img1 - img2  27    diff = img1 - img2  
29    nm = sum(abs(diff))  28    nm = sum(abs(diff))  
30    nz = norm(diff.ravel(), 0)  29    nz = norm(diff.ravel(), 0)  
31    return nm/img1.size < 1 and nz/img1.size < 130    return nm/img1.size < 1 and nz/img1.size < 1
32def to_grayscale(arr):31def to_grayscale(arr):
33    if len(arr.shape) == 3:32    if len(arr.shape) == 3:
34        return average(arr, -1)  33        return average(arr, -1)  
35    else:34    else:
36        return arr35        return arr
37def normalize(arr):36def normalize(arr):
38    rng = arr.max()-arr.min()37    rng = arr.max()-arr.min()
39    amin = arr.min()38    amin = arr.min()
40    return (arr-amin)*255/rngimport numpy as np39    return (arr-amin)*255/rngimport numpy as np
41cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
42pctl = np.percentile(scores,np.arange(0,100,25))41pctl = np.percentile(scores,np.arange(0,100,25))
43best_cultivar_indices, = np.where(scores>pctl[-1])42best_cultivar_indices, = np.where(scores>pctl[-1])
44print(f'Cultivars with the following IDs are in the top quartile with a score of43print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
45best=cultivarIDs[best_cultivar_indices]44best=cultivarIDs[best_cultivar_indices]
46best.sort()45best.sort()
47print(', '.join([str(int(x)) for x in best]))46print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 265, P-Value: 3.28e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
n5    x = np.linspace(0,np.pi*4, 80)n5    x = np.linspace(0, 4*np.pi, 80)
6    y = np.sin(x)6    y = np.sin(x)
n7    plt.plot(x,y,'-b')n
8    plt.xlabel('x (radians)')7    plt.xlabel('x (radians)')
9    plt.ylabel('sin(x)')8    plt.ylabel('sin(x)')
n10    plt.xlim(0,max(x))n9    plt.xlim(0, 4*np.pi)
11    plt.ylim(-1,1)10    plt.ylim(-1,1)
nn11    plt.plot(x, y, '-b')
12    plt.savefig(filename)12    plt.savefig(filename)
13if __name__=='__main__':13if __name__=='__main__':
14    make_plot('my_plot.png')14    make_plot('my_plot.png')
15    if compare_plots('my_plot.png','instructors_plot.png'):15    if compare_plots('my_plot.png','instructors_plot.png'):
16        print('Success!')16        print('Success!')
17    else:17    else:
18        print('Keep trying.')18        print('Keep trying.')
19import matplotlib.pyplot as plt19import matplotlib.pyplot as plt
20from scipy.linalg import norm20from scipy.linalg import norm
21from scipy import sum,average21from scipy import sum,average
22def compare_plots(imagefile1,imagefile2):22def compare_plots(imagefile1,imagefile2):
23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
25    if img1.size!=img2.size:25    if img1.size!=img2.size:
26        return False26        return False
27    diff = img1 - img2  27    diff = img1 - img2  
28    nm = sum(abs(diff))  28    nm = sum(abs(diff))  
29    nz = norm(diff.ravel(), 0)  29    nz = norm(diff.ravel(), 0)  
30    return nm/img1.size < 1 and nz/img1.size < 130    return nm/img1.size < 1 and nz/img1.size < 1
31def to_grayscale(arr):31def to_grayscale(arr):
32    if len(arr.shape) == 3:32    if len(arr.shape) == 3:
33        return average(arr, -1)  33        return average(arr, -1)  
34    else:34    else:
35        return arr35        return arr
36def normalize(arr):36def normalize(arr):
37    rng = arr.max()-arr.min()37    rng = arr.max()-arr.min()
38    amin = arr.min()38    amin = arr.min()
39    return (arr-amin)*255/rngimport numpy as np39    return (arr-amin)*255/rngimport numpy as np
n40cultivarIDs, my_array =np.loadtxt('cultivar_test_scores.csv',unpack=True,delimitn40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>er=',')>,')
41quartile_boundaries = np.percentile(my_array,np.arange(0,100,25))41quartile_boundaries = np.percentile(scores,np.arange(0,100,25))
42best_cultivar_indices, = np.where(my_array>quartile_boundaries[-1])42top_indices, = np.where(scores>quartile_boundaries[-1])
43print(f'Cultivars with the following IDs are in the top quartile with a score of43print(f'Cultivars with the following IDs are in the top quartile with a score of
> {quartile_boundaries[-1]} or better:')> {quartile_boundaries[-1]} or better:')
t44best=cultivarIDs[best_cultivar_indices]t44best=cultivarIDs[top_indices]
45best.sort()45best.sort()
46print(', '.join([str(int(x)) for x in best]))46print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 156, P-Value: 3.35e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
nn5    plt.xlim(0, 4*np.pi)
6    plt.ylim(-1,1)
5    x = np.linspace(0,4*np.pi,80)7    x = np.linspace(0, 4*np.pi, num = 80)
6    y = np.sin(x)8    y = np.sin(x)
n7    plt.xlim([0,4*np.pi])n9    plt.plot(x, y, '-b')
8    plt.ylim([-1,1])
9    plt.xlabel('x (radians)')10    plt.xlabel('x (radians)')
10    plt.ylabel('sin(x)')11    plt.ylabel('sin(x)')
n11    plt.plot(x,y,'-b') n
12    plt.savefig(filename)12    plt.savefig(filename)
13if __name__=='__main__':13if __name__=='__main__':
14    make_plot('my_plot.png')14    make_plot('my_plot.png')
15    if compare_plots('my_plot.png','instructors_plot.png'):15    if compare_plots('my_plot.png','instructors_plot.png'):
16        print('Success!')16        print('Success!')
17    else:17    else:
18        print('Keep trying.')18        print('Keep trying.')
19import matplotlib.pyplot as plt19import matplotlib.pyplot as plt
20from scipy.linalg import norm20from scipy.linalg import norm
21from scipy import sum,average21from scipy import sum,average
22def compare_plots(imagefile1,imagefile2):22def compare_plots(imagefile1,imagefile2):
23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
25    if img1.size!=img2.size:25    if img1.size!=img2.size:
26        return False26        return False
27    diff = img1 - img2  27    diff = img1 - img2  
28    nm = sum(abs(diff))  28    nm = sum(abs(diff))  
29    nz = norm(diff.ravel(), 0)  29    nz = norm(diff.ravel(), 0)  
30    return nm/img1.size < 1 and nz/img1.size < 130    return nm/img1.size < 1 and nz/img1.size < 1
31def to_grayscale(arr):31def to_grayscale(arr):
32    if len(arr.shape) == 3:32    if len(arr.shape) == 3:
33        return average(arr, -1)  33        return average(arr, -1)  
34    else:34    else:
35        return arr35        return arr
36def normalize(arr):36def normalize(arr):
37    rng = arr.max()-arr.min()37    rng = arr.max()-arr.min()
38    amin = arr.min()38    amin = arr.min()
39    return (arr-amin)*255/rngimport numpy as np39    return (arr-amin)*255/rngimport numpy as np
40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
41my_array = scores41my_array = scores
42quartile_boundaries = np.percentile(my_array,np.arange(0,100,25))42quartile_boundaries = np.percentile(my_array,np.arange(0,100,25))
43top_indices, = np.where(my_array>quartile_boundaries[-1])43top_indices, = np.where(my_array>quartile_boundaries[-1])
n44best_cultivar_indices = top_indicesn
45print(f'Cultivars with the following IDs are in the top quartile with a score of44print(f'Cultivars with the following IDs are in the top quartile with a score of
> {quartile_boundaries[-1]} or better:')> {quartile_boundaries[-1]} or better:')
t46best=cultivarIDs[best_cultivar_indices]t45best=cultivarIDs[top_indices]
47best.sort()46best.sort()
48print(', '.join([str(int(x)) for x in best]))47print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 385, P-Value: 3.35e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
n5    xVal = np.linspace(0,(4*np.pi),80)n5    x=np.linspace(0,4*np.pi,80)
6    plt.plot(xVal,np.sin(xVal),'-b')6    plt.plot(x,np.sin(x),'-b')
7    plt.xlim(0,(4*np.pi))7    plt.xlim([0,4*np.pi])
8    plt.xlabel("x (radians)")
9    plt.ylim(-1,1)8    plt.ylim([-1,1])
9    plt.xlabel('x (radians)')
10    plt.ylabel("sin(x)")10    plt.ylabel('sin(x)')
11    plt.savefig(filename)11    plt.savefig(filename)
12if __name__=='__main__':12if __name__=='__main__':
13    make_plot('my_plot.png')13    make_plot('my_plot.png')
14    if compare_plots('my_plot.png','instructors_plot.png'):14    if compare_plots('my_plot.png','instructors_plot.png'):
15        print('Success!')15        print('Success!')
16    else:16    else:
17        print('Keep trying.')17        print('Keep trying.')
18import matplotlib.pyplot as plt18import matplotlib.pyplot as plt
19from scipy.linalg import norm19from scipy.linalg import norm
20from scipy import sum,average20from scipy import sum,average
21def compare_plots(imagefile1,imagefile2):21def compare_plots(imagefile1,imagefile2):
22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
24    if img1.size!=img2.size:24    if img1.size!=img2.size:
25        return False25        return False
26    diff = img1 - img2  26    diff = img1 - img2  
27    nm = sum(abs(diff))  27    nm = sum(abs(diff))  
28    nz = norm(diff.ravel(), 0)  28    nz = norm(diff.ravel(), 0)  
29    return nm/img1.size < 1 and nz/img1.size < 129    return nm/img1.size < 1 and nz/img1.size < 1
30def to_grayscale(arr):30def to_grayscale(arr):
31    if len(arr.shape) == 3:31    if len(arr.shape) == 3:
32        return average(arr, -1)  32        return average(arr, -1)  
33    else:33    else:
34        return arr34        return arr
35def normalize(arr):35def normalize(arr):
36    rng = arr.max()-arr.min()36    rng = arr.max()-arr.min()
37    amin = arr.min()37    amin = arr.min()
38    return (arr-amin)*255/rngimport numpy as np38    return (arr-amin)*255/rngimport numpy as np
39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
t40pctl = np.percentile(scores,np.arange(0,100,25))t40pctl = np.percentile(scores, np.arange(0,100,25))
41best_cultivar_indices = np.where(scores >= pctl[-1])41best_cultivar_indices = np.where(scores >= pctl[-1])
42print(f'Cultivars with the following IDs are in the top quartile with a score of42print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
43best=cultivarIDs[best_cultivar_indices]43best=cultivarIDs[best_cultivar_indices]
44best.sort()44best.sort()
45print(', '.join([str(int(x)) for x in best]))45print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 345, P-Value: 3.38e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
5    x = np.linspace(0,4*np.pi,80) 5    x = np.linspace(0,4*np.pi,80) 
6    plt.plot(x,np.sin(x),'-b')    6    plt.plot(x,np.sin(x),'-b')    
7    plt.xlim(0,4*np.pi)           7    plt.xlim(0,4*np.pi)           
n8    plt.ylim(-1,1)                n8    plt.ylim(-1,1)               
9    plt.xlabel("x (radians)")     9    plt.xlabel("x (radians)")     
10    plt.ylabel("sin(x)")          10    plt.ylabel("sin(x)")          
11    plt.savefig(filename)11    plt.savefig(filename)
12if __name__=='__main__':12if __name__=='__main__':
13    make_plot('my_plot.png')13    make_plot('my_plot.png')
14    if compare_plots('my_plot.png','instructors_plot.png'):14    if compare_plots('my_plot.png','instructors_plot.png'):
15        print('Success!')15        print('Success!')
16    else:16    else:
17        print('Keep trying.')17        print('Keep trying.')
18import matplotlib.pyplot as plt18import matplotlib.pyplot as plt
19from scipy.linalg import norm19from scipy.linalg import norm
20from scipy import sum,average20from scipy import sum,average
21def compare_plots(imagefile1,imagefile2):21def compare_plots(imagefile1,imagefile2):
22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
24    if img1.size!=img2.size:24    if img1.size!=img2.size:
25        return False25        return False
26    diff = img1 - img2  26    diff = img1 - img2  
27    nm = sum(abs(diff))  27    nm = sum(abs(diff))  
28    nz = norm(diff.ravel(), 0)  28    nz = norm(diff.ravel(), 0)  
29    return nm/img1.size < 1 and nz/img1.size < 129    return nm/img1.size < 1 and nz/img1.size < 1
30def to_grayscale(arr):30def to_grayscale(arr):
31    if len(arr.shape) == 3:31    if len(arr.shape) == 3:
32        return average(arr, -1)  32        return average(arr, -1)  
33    else:33    else:
34        return arr34        return arr
35def normalize(arr):35def normalize(arr):
36    rng = arr.max()-arr.min()36    rng = arr.max()-arr.min()
37    amin = arr.min()37    amin = arr.min()
38    return (arr-amin)*255/rngimport numpy as np38    return (arr-amin)*255/rngimport numpy as np
39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
t40quartile_boundaries = np.percentile(scores,np.arange(0,100,25))t40pctl = np.percentile(scores, np.arange(0,100,25))
41best_cultivar_indices = np.where(scores>quartile_boundaries[-1])41best_cultivar_indices = np.where(scores >= pctl[-1])
42print(f'Cultivars with the following IDs are in the top quartile with a score of42print(f'Cultivars with the following IDs are in the top quartile with a score of
> {quartile_boundaries[-1]} or better:')> {pctl[-1]} or better:')
43best=cultivarIDs[best_cultivar_indices]43best=cultivarIDs[best_cultivar_indices]
44best.sort()44best.sort()
45print(', '.join([str(int(x)) for x in best]))45print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 280, P-Value: 3.38e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
n5    plt.xlim([0,4*np.pi])n
6    plt.ylim([-1.0,1.0])
7    plt.xlabel('x(radians)')
8    plt.ylabel('sin(x)')
9    x = np.linspace(0,4*np.pi,80)5    x = np.linspace(0,4*np.pi,80)
10    y = np.sin(x)6    y = np.sin(x)
nn7    plt.xlim([0,4*np.pi])
8    plt.ylim([-1,1])
11    plt.plot(x,y)9    plt.plot(x, y)
10    plt.xlabel('x (radians)')
11    plt.ylabel('sin(x)')
12    plt.savefig(filename)12    plt.savefig(filename)
13    plt.show()13    plt.show()
14if __name__=='__main__':14if __name__=='__main__':
15    make_plot('my_plot.png')15    make_plot('my_plot.png')
16    if compare_plots('my_plot.png','instructors_plot.png'):16    if compare_plots('my_plot.png','instructors_plot.png'):
17        print('Success!')17        print('Success!')
18    else:18    else:
19        print('Keep trying.')19        print('Keep trying.')
20import matplotlib.pyplot as plt20import matplotlib.pyplot as plt
21from scipy.linalg import norm21from scipy.linalg import norm
22from scipy import sum,average22from scipy import sum,average
23def compare_plots(imagefile1,imagefile2):23def compare_plots(imagefile1,imagefile2):
24    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))24    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
25    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))25    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
26    if img1.size!=img2.size:26    if img1.size!=img2.size:
27        return False27        return False
28    diff = img1 - img2  28    diff = img1 - img2  
29    nm = sum(abs(diff))  29    nm = sum(abs(diff))  
30    nz = norm(diff.ravel(), 0)  30    nz = norm(diff.ravel(), 0)  
31    return nm/img1.size < 1 and nz/img1.size < 131    return nm/img1.size < 1 and nz/img1.size < 1
32def to_grayscale(arr):32def to_grayscale(arr):
33    if len(arr.shape) == 3:33    if len(arr.shape) == 3:
34        return average(arr, -1)  34        return average(arr, -1)  
35    else:35    else:
36        return arr36        return arr
37def normalize(arr):37def normalize(arr):
38    rng = arr.max()-arr.min()38    rng = arr.max()-arr.min()
39    amin = arr.min()39    amin = arr.min()
40    return (arr-amin)*255/rngimport numpy as np40    return (arr-amin)*255/rngimport numpy as np
41cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='41cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
t42quartile_boundaries = np.percentile(my_array,np.arange(0,100,25))t42quartile_boundaries = np.percentile(scores,np.arange(0,100,25))
43top_indices, = np.where(my_array>quartile_boundaries[-1])43best_cultivar_indices, = np.where(scores>quartile_boundaries[-1])
44pctl = quartile_boundaries
44print(f'Cultivars with the following IDs are in the top quartile with a score of45print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
45best=cultivarIDs[best_cultivar_indices]46best=cultivarIDs[best_cultivar_indices]
46best.sort()47best.sort()
47print(', '.join([str(int(x)) for x in best]))48print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 279, P-Value: 3.42e-01

Student (left) and Nearest Neighbor (right).


f1from cmath import pif1from cmath import pi
2import matplotlib.pyplot as plt2import matplotlib.pyplot as plt
n3import numpy as nmn3import numpy as np
4from compare_plots import compare_plots4from compare_plots import compare_plots
5def make_plot(filename):5def make_plot(filename):
n6    x=list(nm.linspace(0,4*pi,80))n6    x = list(np.linspace(0,4*pi,80))
7    y=list(nm.sin(x))7    y = list(np.sin(x))
8    plt.plot(x,y)8    plt.plot(x, y)
9    plt.ylabel('sin(x)')9    plt.ylabel('sin(x)')
10    plt.xlabel('x (radians)')10    plt.xlabel('x (radians)')
11    plt.xlim([0,4*pi])11    plt.xlim([0,4*pi])
12    plt.ylim([-1,1])12    plt.ylim([-1,1])
13    plt.savefig(filename)13    plt.savefig(filename)
n14if __name__=="__main__":n14if __name__=='__main__':
15    make_plot('my_plot.png')15    make_plot('my_plot.png')
n16    if compare_plots("my_plot.png", "instructors_plot.png"):n16    if compare_plots('my_plot.png','instructors_plot.png'):
17        print('Sucess!')17        print('Success!')
18    else:18    else:
n19        print("Keep trying.")n19        print('Keep trying.')
20import matplotlib.pyplot as plt20import matplotlib.pyplot as plt
21from scipy.linalg import norm21from scipy.linalg import norm
22from scipy import sum,average22from scipy import sum,average
23def compare_plots(imagefile1,imagefile2):23def compare_plots(imagefile1,imagefile2):
24    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))24    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
25    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))25    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
26    if img1.size!=img2.size:26    if img1.size!=img2.size:
27        return False27        return False
28    diff = img1 - img2  28    diff = img1 - img2  
29    nm = sum(abs(diff))  29    nm = sum(abs(diff))  
30    nz = norm(diff.ravel(), 0)  30    nz = norm(diff.ravel(), 0)  
31    return nm/img1.size < 1 and nz/img1.size < 131    return nm/img1.size < 1 and nz/img1.size < 1
32def to_grayscale(arr):32def to_grayscale(arr):
33    if len(arr.shape) == 3:33    if len(arr.shape) == 3:
34        return average(arr, -1)  34        return average(arr, -1)  
35    else:35    else:
36        return arr36        return arr
37def normalize(arr):37def normalize(arr):
38    rng = arr.max()-arr.min()38    rng = arr.max()-arr.min()
39    amin = arr.min()39    amin = arr.min()
40    return (arr-amin)*255/rngimport numpy as np40    return (arr-amin)*255/rngimport numpy as np
41cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='41cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
t42pctl = np.percentile(scores, np.arange(0,100,25))t42pctl = np.percentile(scores, np.arange(0, 100, 25))
43best_cultivar_indices = np.where(scores >= pctl[-1])43best_cultivar_indices, = np.where(scores > pctl[-1])
44print(f'Cultivars with the following IDs are in the top quartile with a score of44print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
45best=cultivarIDs[best_cultivar_indices]45best=cultivarIDs[best_cultivar_indices]
46best.sort()46best.sort()
47print(', '.join([str(int(x)) for x in best]))47print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 102, P-Value: 3.46e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
nn5    FREQUENCY = 1/(2*np.pi)
5    RADIAN_STEP = 1/80.06    RADIAN_STEP = 1/80.0
6    t1 = np.arange(0.0, 4*np.pi, RADIAN_STEP)7    t1 = np.arange(0.0, 4*np.pi, RADIAN_STEP)
7    wave = np.sin(t1)8    wave = np.sin(t1)
8    plt.plot(t1, wave)9    plt.plot(t1, wave)
9    plt.xlabel("x (radians)")10    plt.xlabel("x (radians)")
10    plt.ylabel("sin(x)")11    plt.ylabel("sin(x)")
11    plt.axis([0, 4*np.pi, -1.00, 1.00])12    plt.axis([0, 4*np.pi, -1.00, 1.00])
12    plt.show()13    plt.show()
13    plt.savefig(filename)14    plt.savefig(filename)
14if __name__=='__main__':15if __name__=='__main__':
15    make_plot('my_plot.png')16    make_plot('my_plot.png')
16    if compare_plots('my_plot.png','instructors_plot.png'):17    if compare_plots('my_plot.png','instructors_plot.png'):
17        print('Success!')18        print('Success!')
18    else:19    else:
19        print('Keep trying.')20        print('Keep trying.')
20import matplotlib.pyplot as plt21import matplotlib.pyplot as plt
21from scipy.linalg import norm22from scipy.linalg import norm
22from scipy import sum,average23from scipy import sum,average
23def compare_plots(imagefile1,imagefile2):24def compare_plots(imagefile1,imagefile2):
24    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))25    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
25    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))26    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
26    if img1.size!=img2.size:27    if img1.size!=img2.size:
27        return False28        return False
28    diff = img1 - img2  29    diff = img1 - img2  
29    nm = sum(abs(diff))  30    nm = sum(abs(diff))  
30    nz = norm(diff.ravel(), 0)  31    nz = norm(diff.ravel(), 0)  
31    return nm/img1.size < 1 and nz/img1.size < 132    return nm/img1.size < 1 and nz/img1.size < 1
32def to_grayscale(arr):33def to_grayscale(arr):
33    if len(arr.shape) == 3:34    if len(arr.shape) == 3:
34        return average(arr, -1)  35        return average(arr, -1)  
35    else:36    else:
36        return arr37        return arr
37def normalize(arr):38def normalize(arr):
38    rng = arr.max()-arr.min()39    rng = arr.max()-arr.min()
39    amin = arr.min()40    amin = arr.min()
40    return (arr-amin)*255/rngimport numpy as np41    return (arr-amin)*255/rngimport numpy as np
41cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='42cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
t42pctl= np.percentile(scores, np.arange(0,100,25))t43pctl = np.percentile(scores, np.arange(0, 100, 25))
43best_cultivar_indices = np.where(scores >pctl[-1])44best_cultivar_indices = np.where(scores>pctl[-1])
44print(f'Cultivars with the following IDs are in the top quartile with a score of45print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
45best=cultivarIDs[best_cultivar_indices]46best=cultivarIDs[best_cultivar_indices]
46best.sort()47best.sort()
47print(', '.join([str(int(x)) for x in best]))48print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 269, P-Value: 3.46e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
5        x = np.linspace(0,np.pi * 4,100)5        x = np.linspace(0,np.pi * 4,100)
6        y = np.sin(x)6        y = np.sin(x)
7        plt.plot(x,y,'b')7        plt.plot(x,y,'b')
8        plt.xlabel('x(radians)')8        plt.xlabel('x(radians)')
9        plt.ylabel('sin(x)')9        plt.ylabel('sin(x)')
10        plt.margins(0,0)10        plt.margins(0,0)
11        plt.savefig(filename) 11        plt.savefig(filename) 
12if __name__=='__main__':12if __name__=='__main__':
13    make_plot('my_plot.png')13    make_plot('my_plot.png')
14    if compare_plots('my_plot.png','instructors_plot.png'):14    if compare_plots('my_plot.png','instructors_plot.png'):
15        print('Success!')15        print('Success!')
16    else:16    else:
17        print('Keep trying.')17        print('Keep trying.')
18import matplotlib.pyplot as plt18import matplotlib.pyplot as plt
19from scipy.linalg import norm19from scipy.linalg import norm
20from scipy import sum,average20from scipy import sum,average
21def compare_plots(imagefile1,imagefile2):21def compare_plots(imagefile1,imagefile2):
22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
24    if img1.size!=img2.size:24    if img1.size!=img2.size:
25        return False25        return False
26    diff = img1 - img2  26    diff = img1 - img2  
27    nm = sum(abs(diff))  27    nm = sum(abs(diff))  
28    nz = norm(diff.ravel(), 0)  28    nz = norm(diff.ravel(), 0)  
29    return nm/img1.size < 1 and nz/img1.size < 129    return nm/img1.size < 1 and nz/img1.size < 1
30def to_grayscale(arr):30def to_grayscale(arr):
31    if len(arr.shape) == 3:31    if len(arr.shape) == 3:
32        return average(arr, -1)  32        return average(arr, -1)  
33    else:33    else:
34        return arr34        return arr
35def normalize(arr):35def normalize(arr):
36    rng = arr.max()-arr.min()36    rng = arr.max()-arr.min()
37    amin = arr.min()37    amin = arr.min()
38    return (arr-amin)*255/rngimport numpy as np38    return (arr-amin)*255/rngimport numpy as np
n39cultivarIDs, scores = np.loadtxt('cultivar_test_scores.csv', dtype='int,int', den39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>limiter=',', usecols=(0, 1),unpack =True)>,')
40pctl = np.percentile(scores, np.arange(0,100,25))40pctl = np.percentile(scores, np.arange(0,100,25))
41best_cultivar_indices = np.where(scores >= pctl[-1])41best_cultivar_indices = np.where(scores >= pctl[-1])
n42print(f'Cultivars with the following IDs are in the top quartite with a score ofn42print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
43best = cultivarIDs[best_cultivar_indices]43best=cultivarIDs[best_cultivar_indices]
44best.sort()44best.sort()
t45print(','.join([str(int(x)) for x in best]))t45print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 26, P-Value: 3.47e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
n5    x=np.linspace(0, 4 * np.pi, 80)n5    xval = np.linspace(0, 4 * np.pi, 80)
6    plt.plot(x, np.sin(x), '-b')6    plt.plot(xval, np.sin(xval), '-b')
7    plt.xlim(0, 4 * np.pi)7    plt.xlim([0, 4 * np.pi])
8    plt.ylim(-1, 1)8    plt.ylim([-1, 1])
9    plt.xlabel('x (radians)')9    plt.xlabel('x (radians)')
10    plt.ylabel('sin(x)')10    plt.ylabel('sin(x)')
11    plt.savefig(filename)11    plt.savefig(filename)
12if __name__=='__main__':12if __name__=='__main__':
13    make_plot('my_plot.png')13    make_plot('my_plot.png')
14    if compare_plots('my_plot.png','instructors_plot.png'):14    if compare_plots('my_plot.png','instructors_plot.png'):
15        print('Success!')15        print('Success!')
16    else:16    else:
17        print('Keep trying.')17        print('Keep trying.')
18import matplotlib.pyplot as plt18import matplotlib.pyplot as plt
19from scipy.linalg import norm19from scipy.linalg import norm
20from scipy import sum,average20from scipy import sum,average
21def compare_plots(imagefile1,imagefile2):21def compare_plots(imagefile1,imagefile2):
22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
24    if img1.size!=img2.size:24    if img1.size!=img2.size:
25        return False25        return False
26    diff = img1 - img2  26    diff = img1 - img2  
27    nm = sum(abs(diff))  27    nm = sum(abs(diff))  
28    nz = norm(diff.ravel(), 0)  28    nz = norm(diff.ravel(), 0)  
29    return nm/img1.size < 1 and nz/img1.size < 129    return nm/img1.size < 1 and nz/img1.size < 1
30def to_grayscale(arr):30def to_grayscale(arr):
31    if len(arr.shape) == 3:31    if len(arr.shape) == 3:
32        return average(arr, -1)  32        return average(arr, -1)  
33    else:33    else:
34        return arr34        return arr
35def normalize(arr):35def normalize(arr):
36    rng = arr.max()-arr.min()36    rng = arr.max()-arr.min()
37    amin = arr.min()37    amin = arr.min()
38    return (arr-amin)*255/rngimport numpy as np38    return (arr-amin)*255/rngimport numpy as np
39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
n40usecols = (0, 1)n
41unpack = True
42pctl = np.percentile(scores, np.arange(0, 100, 25))40pctl = np.percentile(scores, np.arange(0, 100, 25))
t43best_cultivar_indices = np.where(scores >= pctl[-1])t41best_cultivar_indices, = np.where(scores > pctl[-1])
44print(f'Cultivars with the following IDs are in the top quartile with a score of42print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
45best=cultivarIDs[best_cultivar_indices]43best=cultivarIDs[best_cultivar_indices]
46best.sort()44best.sort()
47print(', '.join([str(int(x)) for x in best]))45print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 127, P-Value: 3.49e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
n5    x=np.linspace(0,4*np.pi,num=80)n5    x = np.linspace(0,4*np.pi,80)
6    y= np.sin(x)6    y = np.sin(x)
7    plt.xlim([0,4*np.pi])7    plt.xlim([0,4*np.pi])
8    plt.ylim([-1,1])8    plt.ylim([-1,1])
n9    plt.xlabel("x (radians)")n9    plt.xlabel('x (radians)')
10    plt.ylabel('sin(x)')10    plt.ylabel('sin(x)')
n11    plt.plot(x,y,'-b')n11    plt.plot(x,y,'-b') 
12    plt.savefig(filename)12    plt.savefig(filename)
13if __name__=='__main__':13if __name__=='__main__':
14    make_plot('my_plot.png')14    make_plot('my_plot.png')
15    if compare_plots('my_plot.png','instructors_plot.png'):15    if compare_plots('my_plot.png','instructors_plot.png'):
16        print('Success!')16        print('Success!')
17    else:17    else:
18        print('Keep trying.')18        print('Keep trying.')
19import matplotlib.pyplot as plt19import matplotlib.pyplot as plt
20from scipy.linalg import norm20from scipy.linalg import norm
21from scipy import sum,average21from scipy import sum,average
22def compare_plots(imagefile1,imagefile2):22def compare_plots(imagefile1,imagefile2):
23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
25    if img1.size!=img2.size:25    if img1.size!=img2.size:
26        return False26        return False
27    diff = img1 - img2  27    diff = img1 - img2  
28    nm = sum(abs(diff))  28    nm = sum(abs(diff))  
29    nz = norm(diff.ravel(), 0)  29    nz = norm(diff.ravel(), 0)  
30    return nm/img1.size < 1 and nz/img1.size < 130    return nm/img1.size < 1 and nz/img1.size < 1
31def to_grayscale(arr):31def to_grayscale(arr):
32    if len(arr.shape) == 3:32    if len(arr.shape) == 3:
33        return average(arr, -1)  33        return average(arr, -1)  
34    else:34    else:
35        return arr35        return arr
36def normalize(arr):36def normalize(arr):
37    rng = arr.max()-arr.min()37    rng = arr.max()-arr.min()
38    amin = arr.min()38    amin = arr.min()
39    return (arr-amin)*255/rngimport numpy as np39    return (arr-amin)*255/rngimport numpy as np
40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
n41my_array=scoresn41my_array = scores
42quartile_boundaries = np.percentile(my_array,np.arange(0,100,25))42quartile_boundaries = np.percentile(my_array,np.arange(0,100,25))
t43best_cultivar_indices = np.where(my_array>quartile_boundaries[-1])t43top_indices, = np.where(my_array>quartile_boundaries[-1])
44best_cultivar_indices = top_indices
44print(f'Cultivars with the following IDs are in the top quartile with a score of45print(f'Cultivars with the following IDs are in the top quartile with a score of
> {quartile_boundaries[-1]} or better:')> {quartile_boundaries[-1]} or better:')
45best=cultivarIDs[best_cultivar_indices]46best=cultivarIDs[best_cultivar_indices]
46best.sort()47best.sort()
47print(', '.join([str(int(x)) for x in best]))48print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 75, P-Value: 3.49e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
n5    x = np.linspace(0,(4*np.pi),80)n5    xVal = np.linspace(0,(4*np.pi),80)
6    plt.plot(xVal,np.sin(xVal),'-b')
6    plt.xlim(0,(4*np.pi))7    plt.xlim(0,(4*np.pi))
nn8    plt.xlabel("x (radians)")
7    plt.ylim(-1,1)9    plt.ylim(-1,1)
n8    plt.xlabel("x (radians)")n
9    plt.ylabel("sin(x)")10    plt.ylabel("sin(x)")
n10    plt.plot(x,np.sin(x),'-b')n
11    plt.savefig(filename)11    plt.savefig(filename)
12if __name__=='__main__':12if __name__=='__main__':
13    make_plot('my_plot.png')13    make_plot('my_plot.png')
14    if compare_plots('my_plot.png','instructors_plot.png'):14    if compare_plots('my_plot.png','instructors_plot.png'):
15        print('Success!')15        print('Success!')
16    else:16    else:
17        print('Keep trying.')17        print('Keep trying.')
18import matplotlib.pyplot as plt18import matplotlib.pyplot as plt
19from scipy.linalg import norm19from scipy.linalg import norm
20from scipy import sum,average20from scipy import sum,average
21def compare_plots(imagefile1,imagefile2):21def compare_plots(imagefile1,imagefile2):
22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
24    if img1.size!=img2.size:24    if img1.size!=img2.size:
25        return False25        return False
26    diff = img1 - img2  26    diff = img1 - img2  
27    nm = sum(abs(diff))  27    nm = sum(abs(diff))  
28    nz = norm(diff.ravel(), 0)  28    nz = norm(diff.ravel(), 0)  
29    return nm/img1.size < 1 and nz/img1.size < 129    return nm/img1.size < 1 and nz/img1.size < 1
30def to_grayscale(arr):30def to_grayscale(arr):
31    if len(arr.shape) == 3:31    if len(arr.shape) == 3:
32        return average(arr, -1)  32        return average(arr, -1)  
33    else:33    else:
34        return arr34        return arr
35def normalize(arr):35def normalize(arr):
36    rng = arr.max()-arr.min()36    rng = arr.max()-arr.min()
37    amin = arr.min()37    amin = arr.min()
38    return (arr-amin)*255/rngimport numpy as np38    return (arr-amin)*255/rngimport numpy as np
39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
t40bounds = np.percentile(scores, np.arange(0,100,25))t40pctl = np.percentile(scores,np.arange(0,100,25))
41best_cultivar_indices = np.where(scores>bounds[-1])41best_cultivar_indices = np.where(scores >= pctl[-1])
42print(f'Cultivars with the following IDs are in the top quartile with a score of42print(f'Cultivars with the following IDs are in the top quartile with a score of
> {bounds[-1]} or better:')> {pctl[-1]} or better:')
43best=cultivarIDs[best_cultivar_indices]43best=cultivarIDs[best_cultivar_indices]
44best.sort()44best.sort()
45print(', '.join([str(int(x)) for x in best]))45print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 341, P-Value: 3.49e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
n5    x = np.linspace(0,12,num = 80)n5    x = np.linspace(0,4*np.pi,num=80)
6    y = np.sin(x)6    y = np.sin(x)
n7    plt.plot(x, y, '-b')n7    plt.plot(x, y,'-b')
8    plt.xticks(np.arange(0,12, step = 2))8    plt.xlim([0,4*np.pi])
9    plt.yticks(np.arange(-1,1, step = 0.25))
10    plt.ylim([-1,1])9    plt.ylim([-1,1])
n11    plt.xlim([0,(4*np.pi)])n
12    plt.xlabel('x(radians)')10    plt.xlabel('x (radians)')
13    plt.ylabel('sin(x)')11    plt.ylabel('sin(x)')
14    plt.savefig(filename)12    plt.savefig(filename)
15if __name__=='__main__':13if __name__=='__main__':
16    make_plot('my_plot.png')14    make_plot('my_plot.png')
17    if compare_plots('my_plot.png','instructors_plot.png'):15    if compare_plots('my_plot.png','instructors_plot.png'):
18        print('Success!')16        print('Success!')
19    else:17    else:
20        print('Keep trying.')18        print('Keep trying.')
21import matplotlib.pyplot as plt19import matplotlib.pyplot as plt
22from scipy.linalg import norm20from scipy.linalg import norm
23from scipy import sum,average21from scipy import sum,average
24def compare_plots(imagefile1,imagefile2):22def compare_plots(imagefile1,imagefile2):
25    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
26    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
27    if img1.size!=img2.size:25    if img1.size!=img2.size:
28        return False26        return False
29    diff = img1 - img2  27    diff = img1 - img2  
30    nm = sum(abs(diff))  28    nm = sum(abs(diff))  
31    nz = norm(diff.ravel(), 0)  29    nz = norm(diff.ravel(), 0)  
32    return nm/img1.size < 1 and nz/img1.size < 130    return nm/img1.size < 1 and nz/img1.size < 1
33def to_grayscale(arr):31def to_grayscale(arr):
34    if len(arr.shape) == 3:32    if len(arr.shape) == 3:
35        return average(arr, -1)  33        return average(arr, -1)  
36    else:34    else:
37        return arr35        return arr
38def normalize(arr):36def normalize(arr):
39    rng = arr.max()-arr.min()37    rng = arr.max()-arr.min()
40    amin = arr.min()38    amin = arr.min()
41    return (arr-amin)*255/rngimport numpy as np39    return (arr-amin)*255/rngimport numpy as np
42cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
43pctl = np.percentile(scores,np.arange(0,100,25))41pctl = np.percentile(scores,np.arange(0,100,25))
t44best_cultivar_indices, = np.where(scores>pctl[-1])t42best_cultivar_indices = np.where(scores> pctl[-1])
45print(f'Cultivars with the following IDs are in the top quartile with a score of43print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
46best=cultivarIDs[best_cultivar_indices]44best=cultivarIDs[best_cultivar_indices]
47best.sort()45best.sort()
48print(', '.join([str(int(x)) for x in best]))46print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 236, P-Value: 3.49e-01

Student (left) and Nearest Neighbor (right).


n1from cmath import pin
2import matplotlib.pyplot as plt1import matplotlib.pyplot as plt
3import numpy as np2import numpy as np
4from compare_plots import compare_plots3from compare_plots import compare_plots
5def make_plot(filename):4def make_plot(filename):
n6    radians = np.linspace(0,4*pi,80)n5    x = np.linspace(0, 4*np.pi, 80)
7    sinx = np.sin(radians)6    y = np.sin(x)
7    plt.xlabel('x (radians)')
8    plt.ylabel('sin(x)')
8    plt.xlim(0,4*pi)9    plt.xlim(0, 4*np.pi)
9    plt.ylim(-1,1)10    plt.ylim(-1,1)
t10    plt.xlabel('radians')t
11    plt.ylabel('sin(x)')
12    plt.plot(radians,sinx, '-b')11    plt.plot(x, y, '-b')
13    plt.savefig(filename)12    plt.savefig(filename)
14if __name__=='__main__':13if __name__=='__main__':
15    make_plot('my_plot.png')14    make_plot('my_plot.png')
16    if compare_plots('my_plot.png','instructors_plot.png'):15    if compare_plots('my_plot.png','instructors_plot.png'):
17        print('Success!')16        print('Success!')
18    else:17    else:
19        print('Keep trying.')18        print('Keep trying.')
20import matplotlib.pyplot as plt19import matplotlib.pyplot as plt
21from scipy.linalg import norm20from scipy.linalg import norm
22from scipy import sum,average21from scipy import sum,average
23def compare_plots(imagefile1,imagefile2):22def compare_plots(imagefile1,imagefile2):
24    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
25    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
26    if img1.size!=img2.size:25    if img1.size!=img2.size:
27        return False26        return False
28    diff = img1 - img2  27    diff = img1 - img2  
29    nm = sum(abs(diff))  28    nm = sum(abs(diff))  
30    nz = norm(diff.ravel(), 0)  29    nz = norm(diff.ravel(), 0)  
31    return nm/img1.size < 1 and nz/img1.size < 130    return nm/img1.size < 1 and nz/img1.size < 1
32def to_grayscale(arr):31def to_grayscale(arr):
33    if len(arr.shape) == 3:32    if len(arr.shape) == 3:
34        return average(arr, -1)  33        return average(arr, -1)  
35    else:34    else:
36        return arr35        return arr
37def normalize(arr):36def normalize(arr):
38    rng = arr.max()-arr.min()37    rng = arr.max()-arr.min()
39    amin = arr.min()38    amin = arr.min()
40    return (arr-amin)*255/rngimport numpy as np39    return (arr-amin)*255/rngimport numpy as np
41cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
42quartile_boundaries = np.percentile(scores,np.arange(0,100,25))41quartile_boundaries = np.percentile(scores,np.arange(0,100,25))
43top_indices, = np.where(scores>quartile_boundaries[-1])42top_indices, = np.where(scores>quartile_boundaries[-1])
44print(f'Cultivars with the following IDs are in the top quartile with a score of43print(f'Cultivars with the following IDs are in the top quartile with a score of
> {quartile_boundaries[-1]} or better:')> {quartile_boundaries[-1]} or better:')
45best=cultivarIDs[top_indices]44best=cultivarIDs[top_indices]
46best.sort()45best.sort()
47print(', '.join([str(int(x)) for x in best]))46print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 180, P-Value: 3.52e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
n5    x = np.linspace(0, 4 * np.pi, 80, endpoint = False)n5    domain = np.linspace(0, 4*np.pi, 80)
6    plt.plot(x, np.sin(x), '-b')6    plt.plot(domain, np.sin(domain), '-b')
7    plt.xlim([0, 4 * np.pi])7    plt.xlabel('x (radians)')
8    plt.ylim([-1,1])
9    plt.ylabel('sin(x)')8    plt.ylabel('sin(x)')
n10    plt.xlabel('x (radians)')   n9    plt.axis([0,4*np.pi, -1 ,1])
11    plt.savefig(filename)10    plt.savefig(filename)
tt11    plt.show()
12if __name__=='__main__':12if __name__=='__main__':
13    make_plot('my_plot.png')13    make_plot('my_plot.png')
14    if compare_plots('my_plot.png','instructors_plot.png'):14    if compare_plots('my_plot.png','instructors_plot.png'):
15        print('Success!')15        print('Success!')
16    else:16    else:
17        print('Keep trying.')17        print('Keep trying.')
18import matplotlib.pyplot as plt18import matplotlib.pyplot as plt
19from scipy.linalg import norm19from scipy.linalg import norm
20from scipy import sum,average20from scipy import sum,average
21def compare_plots(imagefile1,imagefile2):21def compare_plots(imagefile1,imagefile2):
22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
24    if img1.size!=img2.size:24    if img1.size!=img2.size:
25        return False25        return False
26    diff = img1 - img2  26    diff = img1 - img2  
27    nm = sum(abs(diff))  27    nm = sum(abs(diff))  
28    nz = norm(diff.ravel(), 0)  28    nz = norm(diff.ravel(), 0)  
29    return nm/img1.size < 1 and nz/img1.size < 129    return nm/img1.size < 1 and nz/img1.size < 1
30def to_grayscale(arr):30def to_grayscale(arr):
31    if len(arr.shape) == 3:31    if len(arr.shape) == 3:
32        return average(arr, -1)  32        return average(arr, -1)  
33    else:33    else:
34        return arr34        return arr
35def normalize(arr):35def normalize(arr):
36    rng = arr.max()-arr.min()36    rng = arr.max()-arr.min()
37    amin = arr.min()37    amin = arr.min()
38    return (arr-amin)*255/rngimport numpy as np38    return (arr-amin)*255/rngimport numpy as np
39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
40pctl = np.percentile(scores,np.arange(0,100,75))40pctl = np.percentile(scores,np.arange(0,100,75))
41best_cultivar_indices = np.where(scores>pctl[-1])41best_cultivar_indices = np.where(scores>pctl[-1])
42print(f'Cultivars with the following IDs are in the top quartile with a score of42print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
43best=cultivarIDs[best_cultivar_indices]43best=cultivarIDs[best_cultivar_indices]
44best.sort()44best.sort()
45print(', '.join([str(int(x)) for x in best]))45print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 208, P-Value: 3.52e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
n5    plt.xlim([0,4*np.pi])n
6    plt.xticks(list(range(0,13,2)))5    plt.xticks(list(range(0,13,2)))
t7    plt.ylim([-1,1])t6    plt.axis([0,4*np.pi,-1,1])
7    x = np.linspace(0, 4*np.pi, 80)
8    wave_f = np.sin(x)
9    plt.xlabel('sin(x)')
8    plt.xlabel('x (radians)')10    plt.ylabel('x (radians)')
9    plt.ylabel('sin(x)')
10    angle = np.linspace(0,4*np.pi,80)
11    wave = np.sin(angle)
12    plt.plot(angle,wave)11    plt.plot(x,wave_f)
13    plt.savefig(filename)12    plt.savefig(filename)
14if __name__=='__main__':13if __name__=='__main__':
15    make_plot('my_plot.png')14    make_plot('my_plot.png')
16    if compare_plots('my_plot.png','instructors_plot.png'):15    if compare_plots('my_plot.png','instructors_plot.png'):
17        print('Success!')16        print('Success!')
18    else:17    else:
19        print('Keep trying.')18        print('Keep trying.')
20import matplotlib.pyplot as plt19import matplotlib.pyplot as plt
21from scipy.linalg import norm20from scipy.linalg import norm
22from scipy import sum,average21from scipy import sum,average
23def compare_plots(imagefile1,imagefile2):22def compare_plots(imagefile1,imagefile2):
24    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
25    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
26    if img1.size!=img2.size:25    if img1.size!=img2.size:
27        return False26        return False
28    diff = img1 - img2  27    diff = img1 - img2  
29    nm = sum(abs(diff))  28    nm = sum(abs(diff))  
30    nz = norm(diff.ravel(), 0)  29    nz = norm(diff.ravel(), 0)  
31    return nm/img1.size < 1 and nz/img1.size < 130    return nm/img1.size < 1 and nz/img1.size < 1
32def to_grayscale(arr):31def to_grayscale(arr):
33    if len(arr.shape) == 3:32    if len(arr.shape) == 3:
34        return average(arr, -1)  33        return average(arr, -1)  
35    else:34    else:
36        return arr35        return arr
37def normalize(arr):36def normalize(arr):
38    rng = arr.max()-arr.min()37    rng = arr.max()-arr.min()
39    amin = arr.min()38    amin = arr.min()
40    return (arr-amin)*255/rngimport numpy as np39    return (arr-amin)*255/rngimport numpy as np
41cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
42pctl = np.percentile(scores,np.arange(0,100,25))41pctl = np.percentile(scores,np.arange(0,100,25))
43best_cultivar_indices, = np.where(scores>pctl[-1])42best_cultivar_indices, = np.where(scores>pctl[-1])
44print(f'Cultivars with the following IDs are in the top quartile with a score of43print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
45best=cultivarIDs[best_cultivar_indices]44best=cultivarIDs[best_cultivar_indices]
46best.sort()45best.sort()
47print(', '.join([str(int(x)) for x in best]))46print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 216, P-Value: 3.54e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
n4filename = 'my_plot.png'n
5def make_plot(filename):4def make_plot(filename):
n6    x = np.linspace(0, 4*np.pi, num=80, endpoint=False)n5    x = np.linspace(0, 4 * np.pi, 80, endpoint = False)
7    plt.plot(x, np.sin(x), '-b')6    plt.plot(x, np.sin(x), '-b')
nn7    plt.xlim([0, 4 * np.pi])
8    plt.ylim([-1,1])8    plt.ylim([-1,1])
n9    plt.xlim([0,4*np.pi])n
10    plt.xlabel('x (radians)')
11    plt.ylabel('sin(x)')9    plt.ylabel('sin(x)')
nn10    plt.xlabel('x (radians)')   
12    plt.savefig(filename)11    plt.savefig(filename)
t13    returnt
14if __name__=='__main__':12if __name__=='__main__':
15    make_plot('my_plot.png')13    make_plot('my_plot.png')
16    if compare_plots('my_plot.png','instructors_plot.png'):14    if compare_plots('my_plot.png','instructors_plot.png'):
17        print('Success!')15        print('Success!')
18    else:16    else:
19        print('Keep trying.')17        print('Keep trying.')
20import matplotlib.pyplot as plt18import matplotlib.pyplot as plt
21from scipy.linalg import norm19from scipy.linalg import norm
22from scipy import sum,average20from scipy import sum,average
23def compare_plots(imagefile1,imagefile2):21def compare_plots(imagefile1,imagefile2):
24    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
25    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
26    if img1.size!=img2.size:24    if img1.size!=img2.size:
27        return False25        return False
28    diff = img1 - img2  26    diff = img1 - img2  
29    nm = sum(abs(diff))  27    nm = sum(abs(diff))  
30    nz = norm(diff.ravel(), 0)  28    nz = norm(diff.ravel(), 0)  
31    return nm/img1.size < 1 and nz/img1.size < 129    return nm/img1.size < 1 and nz/img1.size < 1
32def to_grayscale(arr):30def to_grayscale(arr):
33    if len(arr.shape) == 3:31    if len(arr.shape) == 3:
34        return average(arr, -1)  32        return average(arr, -1)  
35    else:33    else:
36        return arr34        return arr
37def normalize(arr):35def normalize(arr):
38    rng = arr.max()-arr.min()36    rng = arr.max()-arr.min()
39    amin = arr.min()37    amin = arr.min()
40    return (arr-amin)*255/rngimport numpy as np38    return (arr-amin)*255/rngimport numpy as np
41cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
42pctl = np.percentile(scores,np.arange(0,100,75))40pctl = np.percentile(scores,np.arange(0,100,75))
43best_cultivar_indices = np.where(scores>pctl[-1])41best_cultivar_indices = np.where(scores>pctl[-1])
44print(f'Cultivars with the following IDs are in the top quartile with a score of42print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
45best=cultivarIDs[best_cultivar_indices]43best=cultivarIDs[best_cultivar_indices]
46best.sort()44best.sort()
47print(', '.join([str(int(x)) for x in best]))45print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 493, P-Value: 3.54e-01

Student (left) and Nearest Neighbor (right).


n1from cmath import pin1from math import radians
2import matplotlib.pyplot as plt2import matplotlib.pyplot as plt
3import numpy as np3import numpy as np
4from compare_plots import compare_plots4from compare_plots import compare_plots
5def make_plot(filename):5def make_plot(filename):
n6    x_axis = np.linspace(0,4*np.pi,80)n6    x = np.linspace(0, 4*np.pi, num=80)
7    y_axis = np.sin(x_axis)7    y = np.sin(x)
8    plt.plot(x, y, '-b')
8    plt.xlim([0,4*np.pi])9    plt.xlim([0, 4*np.pi])
9    plt.ylim([-1.00,1.00])10    plt.ylim([-1.00, 1.00])
10    plt.plot(x_axis,y_axis,'-b')
11    plt.xlabel('x (radians)')11    plt.xlabel('x (radians)')
12    plt.ylabel('sin(x)')12    plt.ylabel('sin(x)')
13    plt.savefig(filename)13    plt.savefig(filename)
14if __name__=='__main__':14if __name__=='__main__':
15    make_plot('my_plot.png')15    make_plot('my_plot.png')
16    if compare_plots('my_plot.png','instructors_plot.png'):16    if compare_plots('my_plot.png','instructors_plot.png'):
17        print('Success!')17        print('Success!')
18    else:18    else:
19        print('Keep trying.')19        print('Keep trying.')
20import matplotlib.pyplot as plt20import matplotlib.pyplot as plt
21from scipy.linalg import norm21from scipy.linalg import norm
22from scipy import sum,average22from scipy import sum,average
23def compare_plots(imagefile1,imagefile2):23def compare_plots(imagefile1,imagefile2):
24    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))24    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
25    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))25    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
26    if img1.size!=img2.size:26    if img1.size!=img2.size:
27        return False27        return False
28    diff = img1 - img2  28    diff = img1 - img2  
29    nm = sum(abs(diff))  29    nm = sum(abs(diff))  
30    nz = norm(diff.ravel(), 0)  30    nz = norm(diff.ravel(), 0)  
31    return nm/img1.size < 1 and nz/img1.size < 131    return nm/img1.size < 1 and nz/img1.size < 1
32def to_grayscale(arr):32def to_grayscale(arr):
33    if len(arr.shape) == 3:33    if len(arr.shape) == 3:
34        return average(arr, -1)  34        return average(arr, -1)  
35    else:35    else:
36        return arr36        return arr
37def normalize(arr):37def normalize(arr):
38    rng = arr.max()-arr.min()38    rng = arr.max()-arr.min()
39    amin = arr.min()39    amin = arr.min()
40    return (arr-amin)*255/rngimport numpy as np40    return (arr-amin)*255/rngimport numpy as np
41cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='41cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
t42pctl = np.percentile(scores,np.arange(0,100,25))t42percentile = np.percentile(scores,np.arange(0,100,25))
43best_cultivar_indices, = np.where(scores>pctl[3])43best_cultivar_indices, = np.where(scores>percentile[-1])
44print(f'Cultivars with the following IDs are in the top quartile with a score of44print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {percentile[-1]} or better:')
45best=cultivarIDs[best_cultivar_indices]45best=cultivarIDs[best_cultivar_indices]
46best.sort()46best.sort()
47print(', '.join([str(int(x)) for x in best]))47print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 337, P-Value: 3.55e-01

Student (left) and Nearest Neighbor (right).


n1from re import Xn
2import matplotlib.pyplot as plt1import matplotlib.pyplot as plt
3import numpy as np2import numpy as np
4from compare_plots import compare_plots3from compare_plots import compare_plots
5def make_plot(filename):4def make_plot(filename):
n6    x_values = np.arange(0, 4*np.pi ,0.1)n5    x = np.arange(0, 4*np.pi, 0.1)
7    y_ = np.sin(x_values)6    y = np.sin(x)
8    plt.axis([0,4*np.pi, -1,1])7    plt.axis([0, 4*np.pi, -1, 1])
9    plt.plot(x_values, y_, '-b')8    plt.plot(x,y, '-b')
10    plt.savefig(filename)9    plt.savefig(filename)
11if __name__=='__main__':10if __name__=='__main__':
12    make_plot('my_plot.png')11    make_plot('my_plot.png')
13    if compare_plots('my_plot.png','instructors_plot.png'):12    if compare_plots('my_plot.png','instructors_plot.png'):
14        print('Success!')13        print('Success!')
15    else:14    else:
16        print('Keep trying.')15        print('Keep trying.')
17import matplotlib.pyplot as plt16import matplotlib.pyplot as plt
18from scipy.linalg import norm17from scipy.linalg import norm
19from scipy import sum,average18from scipy import sum,average
20def compare_plots(imagefile1,imagefile2):19def compare_plots(imagefile1,imagefile2):
21    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))20    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
22    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))21    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
23    if img1.size!=img2.size:22    if img1.size!=img2.size:
24        return False23        return False
25    diff = img1 - img2  24    diff = img1 - img2  
26    nm = sum(abs(diff))  25    nm = sum(abs(diff))  
27    nz = norm(diff.ravel(), 0)  26    nz = norm(diff.ravel(), 0)  
28    return nm/img1.size < 1 and nz/img1.size < 127    return nm/img1.size < 1 and nz/img1.size < 1
29def to_grayscale(arr):28def to_grayscale(arr):
30    if len(arr.shape) == 3:29    if len(arr.shape) == 3:
31        return average(arr, -1)  30        return average(arr, -1)  
32    else:31    else:
33        return arr32        return arr
34def normalize(arr):33def normalize(arr):
35    rng = arr.max()-arr.min()34    rng = arr.max()-arr.min()
36    amin = arr.min()35    amin = arr.min()
37    return (arr-amin)*255/rngimport numpy as np36    return (arr-amin)*255/rngimport numpy as np
38cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='37cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
tt38arr = np.sort(scores)
39quartile_boundaries = np.percentile(scores,np.arange(0,100,25))39quartile_boundaries = np.percentile(arr,np.arange(0,100,25))
40top_indices, = np.where(scores>quartile_boundaries[-1])40top_indices, = np.where(scores>quartile_boundaries[-1])
41print(f'Cultivars with the following IDs are in the top quartile with a score of41print(f'Cultivars with the following IDs are in the top quartile with a score of
> {quartile_boundaries[-1]} or better:')> {quartile_boundaries[-1]} or better:')
42best=cultivarIDs[top_indices]42best=cultivarIDs[top_indices]
43best.sort()43best.sort()
44print(', '.join([str(int(x)) for x in best]))44print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 28, P-Value: 3.57e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
n5    a = np.linspace(0.0, 4*np.pi, 80)n5    arrayx = np.linspace(0, (4*np.pi), 80)
6    plt.xlim(0,4*np.pi)6    plt.plot(arrayx, np.sin(arrayx), '-b')
7    plt.ylim(-1,1)
8    plt.ylabel('sin(x)')7    plt.ylabel('sin(x)')
9    plt.xlabel('x (radians)')8    plt.xlabel('x (radians)')
n10    plt.savefig(filename)n9    plt.xlim(0, 4*np.pi)
11    amp = np.sin(a)10    plt.ylim(-1, 1)
12    plt.plot(a,amp)
13    plt.savefig(filename)11    plt.savefig(filename)
14if __name__=='__main__':12if __name__=='__main__':
15    make_plot('my_plot.png')13    make_plot('my_plot.png')
16    if compare_plots('my_plot.png','instructors_plot.png'):14    if compare_plots('my_plot.png','instructors_plot.png'):
17        print('Success!')15        print('Success!')
18    else:16    else:
19        print('Keep trying.')17        print('Keep trying.')
20import matplotlib.pyplot as plt18import matplotlib.pyplot as plt
21from scipy.linalg import norm19from scipy.linalg import norm
22from scipy import sum,average20from scipy import sum,average
23def compare_plots(imagefile1,imagefile2):21def compare_plots(imagefile1,imagefile2):
24    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
25    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
26    if img1.size!=img2.size:24    if img1.size!=img2.size:
27        return False25        return False
28    diff = img1 - img2  26    diff = img1 - img2  
29    nm = sum(abs(diff))  27    nm = sum(abs(diff))  
30    nz = norm(diff.ravel(), 0)  28    nz = norm(diff.ravel(), 0)  
31    return nm/img1.size < 1 and nz/img1.size < 129    return nm/img1.size < 1 and nz/img1.size < 1
32def to_grayscale(arr):30def to_grayscale(arr):
33    if len(arr.shape) == 3:31    if len(arr.shape) == 3:
34        return average(arr, -1)  32        return average(arr, -1)  
35    else:33    else:
36        return arr34        return arr
37def normalize(arr):35def normalize(arr):
38    rng = arr.max()-arr.min()36    rng = arr.max()-arr.min()
39    amin = arr.min()37    amin = arr.min()
40    return (arr-amin)*255/rngimport numpy as np38    return (arr-amin)*255/rngimport numpy as np
41cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
t42pclt = np.percentile(scores,np.arange(0,100,25))t40pctl = np.percentile(scores,np.arange(0,100,25))
43best_cultivar_indices, = np.where(scores>pclt[-1])41best_cultivar_indices, = np.where(scores>pctl[-1])
44print(f'Cultivars with the following IDs are in the top quartile with a score of42print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pclt[-1]} or better:')> {pctl[-1]} or better:')
45best=cultivarIDs[best_cultivar_indices]43best=cultivarIDs[best_cultivar_indices]
46best.sort()44best.sort()
47print(', '.join([str(int(x)) for x in best]))45print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 459, P-Value: 3.66e-01

Student (left) and Nearest Neighbor (right).


nn1from re import X
1import matplotlib.pyplot as plt2import matplotlib.pyplot as plt
2import numpy as np3import numpy as np
3from compare_plots import compare_plots4from compare_plots import compare_plots
4def make_plot(filename):5def make_plot(filename):
n5    x = np.arange(0, 4*np.pi, 0.1)n6    x_values = np.arange(0, 4*np.pi ,0.1)
6    y = np.sin(x)7    y_ = np.sin(x_values)
7    plt.axis([0, 4*np.pi, -1, 1])8    plt.axis([0,4*np.pi, -1,1])
8    plt.plot(x,y, '-b')9    plt.plot(x_values, y_, '-b')
9    plt.savefig(filename)10    plt.savefig(filename)
10if __name__=='__main__':11if __name__=='__main__':
11    make_plot('my_plot.png')12    make_plot('my_plot.png')
12    if compare_plots('my_plot.png','instructors_plot.png'):13    if compare_plots('my_plot.png','instructors_plot.png'):
13        print('Success!')14        print('Success!')
14    else:15    else:
15        print('Keep trying.')16        print('Keep trying.')
16import matplotlib.pyplot as plt17import matplotlib.pyplot as plt
17from scipy.linalg import norm18from scipy.linalg import norm
18from scipy import sum,average19from scipy import sum,average
19def compare_plots(imagefile1,imagefile2):20def compare_plots(imagefile1,imagefile2):
20    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))21    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
21    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))22    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
22    if img1.size!=img2.size:23    if img1.size!=img2.size:
23        return False24        return False
24    diff = img1 - img2  25    diff = img1 - img2  
25    nm = sum(abs(diff))  26    nm = sum(abs(diff))  
26    nz = norm(diff.ravel(), 0)  27    nz = norm(diff.ravel(), 0)  
27    return nm/img1.size < 1 and nz/img1.size < 128    return nm/img1.size < 1 and nz/img1.size < 1
28def to_grayscale(arr):29def to_grayscale(arr):
29    if len(arr.shape) == 3:30    if len(arr.shape) == 3:
30        return average(arr, -1)  31        return average(arr, -1)  
31    else:32    else:
32        return arr33        return arr
33def normalize(arr):34def normalize(arr):
34    rng = arr.max()-arr.min()35    rng = arr.max()-arr.min()
35    amin = arr.min()36    amin = arr.min()
36    return (arr-amin)*255/rngimport numpy as np37    return (arr-amin)*255/rngimport numpy as np
37cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='38cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
t38arr = np.sort(scores)t
39quartile_boundaries = np.percentile(arr,np.arange(0,100,25))39quartile_boundaries = np.percentile(scores,np.arange(0,100,25))
40top_indices, = np.where(scores>quartile_boundaries[-1])40top_indices, = np.where(scores>quartile_boundaries[-1])
41print(f'Cultivars with the following IDs are in the top quartile with a score of41print(f'Cultivars with the following IDs are in the top quartile with a score of
> {quartile_boundaries[-1]} or better:')> {quartile_boundaries[-1]} or better:')
42best=cultivarIDs[top_indices]42best=cultivarIDs[top_indices]
43best.sort()43best.sort()
44print(', '.join([str(int(x)) for x in best]))44print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 179, P-Value: 3.68e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
n3from cmath import pin3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
n5    x = np.linspace(0, 4*pi, 80)n5    x = np.linspace(0, 4*np.pi, 80)
6    y = np.sin(x)6    y= np.sin(x)
7    plt.xlim([0, 4*np.pi])
8    plt.ylim([-1, 1])
7    plt.plot(x,y,'b-')9    plt.plot(x,y,'b-')
n8    plt.xlabel("x(radians)")n10    plt.xlabel('x (radians)')
9    plt.ylabel('sin(x)')11    plt.ylabel('sin(x)')
n10    plt.xlim([0,4*pi])n
11    plt.ylim([-1,1])
12    plt.savefig(filename)12    plt.savefig(filename)
13if __name__=='__main__':13if __name__=='__main__':
14    make_plot('my_plot.png')14    make_plot('my_plot.png')
15    if compare_plots('my_plot.png','instructors_plot.png'):15    if compare_plots('my_plot.png','instructors_plot.png'):
16        print('Success!')16        print('Success!')
17    else:17    else:
18        print('Keep trying.')18        print('Keep trying.')
19import matplotlib.pyplot as plt19import matplotlib.pyplot as plt
20from scipy.linalg import norm20from scipy.linalg import norm
21from scipy import sum,average21from scipy import sum,average
22def compare_plots(imagefile1,imagefile2):22def compare_plots(imagefile1,imagefile2):
23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
25    if img1.size!=img2.size:25    if img1.size!=img2.size:
26        return False26        return False
27    diff = img1 - img2  27    diff = img1 - img2  
28    nm = sum(abs(diff))  28    nm = sum(abs(diff))  
29    nz = norm(diff.ravel(), 0)  29    nz = norm(diff.ravel(), 0)  
30    return nm/img1.size < 1 and nz/img1.size < 130    return nm/img1.size < 1 and nz/img1.size < 1
31def to_grayscale(arr):31def to_grayscale(arr):
32    if len(arr.shape) == 3:32    if len(arr.shape) == 3:
33        return average(arr, -1)  33        return average(arr, -1)  
34    else:34    else:
35        return arr35        return arr
36def normalize(arr):36def normalize(arr):
37    rng = arr.max()-arr.min()37    rng = arr.max()-arr.min()
38    amin = arr.min()38    amin = arr.min()
39    return (arr-amin)*255/rngimport numpy as np39    return (arr-amin)*255/rngimport numpy as np
40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
t41quartile_boundaries = np.percentile(scores,np.arange(0,100,25))t41quartile_boundaries = np.percentile((scores),np.arange(0,100,25))
42best_cultivar_indices, = np.where(scores>quartile_boundaries[-1])42best_cultivar_indices, = np.where(scores>quartile_boundaries[-1])
43print(f'Cultivars with the following IDs are in the top quartile with a score of43print(f'Cultivars with the following IDs are in the top quartile with a score of
> {quartile_boundaries[-1]} or better:')> {quartile_boundaries[-1]} or better:')
44best=cultivarIDs[best_cultivar_indices]44best=cultivarIDs[best_cultivar_indices]
45best.sort()45best.sort()
46print(', '.join([str(int(x)) for x in best]))46print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 445, P-Value: 3.73e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
n5    radians = np.linspace(0,4*np.pi,80)n5    x = np.linspace(0, 4*np.pi, 80)
6    amplitude = np.sin(radians)6    y = np.sin(x)
7    plt.xlabel('x (radians)')7    plt.xlabel('x (radians)')
n8    plt.xlim((0,4*np.pi))n
9    plt.ylabel('sin(x)')8    plt.ylabel('sin(x)')
nn9    plt.xlim(0, 4*np.pi)
10    plt.ylim((-1,1))10    plt.ylim(-1,1)
11    plt.plot(radians,amplitude,'-b')11    plt.plot(x, y, '-b')
12    plt.savefig(filename)12    plt.savefig(filename)
13if __name__=='__main__':13if __name__=='__main__':
14    make_plot('my_plot.png')14    make_plot('my_plot.png')
15    if compare_plots('my_plot.png','instructors_plot.png'):15    if compare_plots('my_plot.png','instructors_plot.png'):
16        print('Success!')16        print('Success!')
17    else:17    else:
18        print('Keep trying.')18        print('Keep trying.')
19import matplotlib.pyplot as plt19import matplotlib.pyplot as plt
20from scipy.linalg import norm20from scipy.linalg import norm
21from scipy import sum,average21from scipy import sum,average
22def compare_plots(imagefile1,imagefile2):22def compare_plots(imagefile1,imagefile2):
23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
25    if img1.size!=img2.size:25    if img1.size!=img2.size:
26        return False26        return False
27    diff = img1 - img2  27    diff = img1 - img2  
28    nm = sum(abs(diff))  28    nm = sum(abs(diff))  
29    nz = norm(diff.ravel(), 0)  29    nz = norm(diff.ravel(), 0)  
30    return nm/img1.size < 1 and nz/img1.size < 130    return nm/img1.size < 1 and nz/img1.size < 1
31def to_grayscale(arr):31def to_grayscale(arr):
32    if len(arr.shape) == 3:32    if len(arr.shape) == 3:
33        return average(arr, -1)  33        return average(arr, -1)  
34    else:34    else:
35        return arr35        return arr
36def normalize(arr):36def normalize(arr):
37    rng = arr.max()-arr.min()37    rng = arr.max()-arr.min()
38    amin = arr.min()38    amin = arr.min()
39    return (arr-amin)*255/rngimport numpy as np39    return (arr-amin)*255/rngimport numpy as np
40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
41quartile_boundaries = np.percentile(scores,np.arange(0,100,25))41quartile_boundaries = np.percentile(scores,np.arange(0,100,25))
n42best_cultivar_indices = np.where(scores>quartile_boundaries[-1])n42top_indices, = np.where(scores>quartile_boundaries[-1])
43print(f'Cultivars with the following IDs are in the top quartile with a score of43print(f'Cultivars with the following IDs are in the top quartile with a score of
> {quartile_boundaries[-1]} or better:')> {quartile_boundaries[-1]} or better:')
t44best=cultivarIDs[best_cultivar_indices]t44best=cultivarIDs[top_indices]
45best.sort()45best.sort()
46print(', '.join([str(int(x)) for x in best]))46print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 264, P-Value: 3.75e-01

Student (left) and Nearest Neighbor (right).


n1from cmath import pin
2import matplotlib.pyplot as plt1import matplotlib.pyplot as plt
3import numpy as np2import numpy as np
4from compare_plots import compare_plots3from compare_plots import compare_plots
nn4from math import sin, pi
5def make_plot(filename):5def make_plot(filename):
nn6    plt.xlim([0,4*pi])
7    plt.ylim([-1,1])
6    x = np.linspace(0, 4*pi, num=80)8    x = np.linspace(0,13, num=80)
7    y = np.sin(x)9    y = [sin(x) for x in x]
8    plt.xlim([min(x),max(x)])
9    plt.ylim([min(y),max(y)])
10    plt.xlabel('x (radians)')10    plt.xlabel('x (radians)')
n11    plt.xticks(list(range(0,13, 2)))n
12    plt.ylabel('sin(x)')11    plt.ylabel('sin(x)')
13    plt.plot(x,y, '-b')12    plt.plot(x,y, '-b')
14    plt.savefig(filename)13    plt.savefig(filename)
15if __name__=='__main__':14if __name__=='__main__':
16    make_plot('my_plot.png')15    make_plot('my_plot.png')
17    if compare_plots('my_plot.png','instructors_plot.png'):16    if compare_plots('my_plot.png','instructors_plot.png'):
18        print('Success!')17        print('Success!')
19    else:18    else:
20        print('Keep trying.')19        print('Keep trying.')
21import matplotlib.pyplot as plt20import matplotlib.pyplot as plt
22from scipy.linalg import norm21from scipy.linalg import norm
23from scipy import sum,average22from scipy import sum,average
24def compare_plots(imagefile1,imagefile2):23def compare_plots(imagefile1,imagefile2):
25    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))24    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
26    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))25    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
27    if img1.size!=img2.size:26    if img1.size!=img2.size:
28        return False27        return False
29    diff = img1 - img2  28    diff = img1 - img2  
30    nm = sum(abs(diff))  29    nm = sum(abs(diff))  
31    nz = norm(diff.ravel(), 0)  30    nz = norm(diff.ravel(), 0)  
32    return nm/img1.size < 1 and nz/img1.size < 131    return nm/img1.size < 1 and nz/img1.size < 1
33def to_grayscale(arr):32def to_grayscale(arr):
34    if len(arr.shape) == 3:33    if len(arr.shape) == 3:
35        return average(arr, -1)  34        return average(arr, -1)  
36    else:35    else:
37        return arr36        return arr
38def normalize(arr):37def normalize(arr):
39    rng = arr.max()-arr.min()38    rng = arr.max()-arr.min()
40    amin = arr.min()39    amin = arr.min()
41    return (arr-amin)*255/rngimport numpy as np40    return (arr-amin)*255/rngimport numpy as np
42cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='41cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
43pctl = np.percentile(scores,np.arange(0,100,25))42pctl = np.percentile(scores,np.arange(0,100,25))
t44best_cultivar_indices = np.where(scores>pctl[-1])t43best_cultivar_indices, = np.where(scores>pctl[-1])
45print(f'Cultivars with the following IDs are in the top quartile with a score of44print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
46best=cultivarIDs[best_cultivar_indices]45best=cultivarIDs[best_cultivar_indices]
47best.sort()46best.sort()
48print(', '.join([str(int(x)) for x in best]))47print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 458, P-Value: 3.78e-01

Student (left) and Nearest Neighbor (right).


nn1import math
1import matplotlib.pyplot as plt2import matplotlib.pyplot as plt
2import numpy as np3import numpy as np
n3import math n
4from compare_plots import compare_plots4from compare_plots import compare_plots
5def make_plot(filename):5def make_plot(filename):
n6    A=np.linspace(0,math.pi*4,81)n6    x=np.linspace(0,4*np.pi,80)
7    plt.plot(A,np.sin(A), color='blue')7    plt.plot(x,np.sin(x),'-b')
8    plt.xlim([0,4*np.pi])
9    plt.ylim([-1,1])
8    plt.xlabel('x (radians)')10    plt.xlabel('x (radians)')
9    plt.ylabel('sin(x)')11    plt.ylabel('sin(x)')
t10    plt.xlim([0,4*math.pi])t
11    plt.ylim([-1,1])
12    plt.savefig(filename)12    plt.savefig(filename)
13if __name__=='__main__':13if __name__=='__main__':
14    make_plot('my_plot.png')14    make_plot('my_plot.png')
15    if compare_plots('my_plot.png','instructors_plot.png'):15    if compare_plots('my_plot.png','instructors_plot.png'):
16        print('Success!')16        print('Success!')
17    else:17    else:
18        print('Keep trying.')18        print('Keep trying.')
19import matplotlib.pyplot as plt19import matplotlib.pyplot as plt
20from scipy.linalg import norm20from scipy.linalg import norm
21from scipy import sum,average21from scipy import sum,average
22def compare_plots(imagefile1,imagefile2):22def compare_plots(imagefile1,imagefile2):
23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
25    if img1.size!=img2.size:25    if img1.size!=img2.size:
26        return False26        return False
27    diff = img1 - img2  27    diff = img1 - img2  
28    nm = sum(abs(diff))  28    nm = sum(abs(diff))  
29    nz = norm(diff.ravel(), 0)  29    nz = norm(diff.ravel(), 0)  
30    return nm/img1.size < 1 and nz/img1.size < 130    return nm/img1.size < 1 and nz/img1.size < 1
31def to_grayscale(arr):31def to_grayscale(arr):
32    if len(arr.shape) == 3:32    if len(arr.shape) == 3:
33        return average(arr, -1)  33        return average(arr, -1)  
34    else:34    else:
35        return arr35        return arr
36def normalize(arr):36def normalize(arr):
37    rng = arr.max()-arr.min()37    rng = arr.max()-arr.min()
38    amin = arr.min()38    amin = arr.min()
39    return (arr-amin)*255/rngimport numpy as np39    return (arr-amin)*255/rngimport numpy as np
40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
41pctl = np.percentile(scores, np.arange(0,100,25))41pctl = np.percentile(scores, np.arange(0,100,25))
42best_cultivar_indices = np.where(scores >= pctl[-1])42best_cultivar_indices = np.where(scores >= pctl[-1])
43print(f'Cultivars with the following IDs are in the top quartile with a score of43print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
44best=cultivarIDs[best_cultivar_indices]44best=cultivarIDs[best_cultivar_indices]
45best.sort()45best.sort()
46print(', '.join([str(int(x)) for x in best]))46print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 476, P-Value: 3.90e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
n5    plt.xlabel('x(radians)')n5    plt.xlabel('x (radians)')
6    plt.ylabel('sin(x)')6    plt.ylabel('sin(x)')      
7    z = np.linspace(0,12.57, 80)7    domain = np.linspace(0,12.57,num = 80)
8    plt.plot(z, np.sin(z),'-b')8    plt.plot(domain,np.sin(domain),'-b')
9    plt.ylim([-1,1])9    plt.ylim([-1, 1])
10    plt.xlim([0,12.57])10    plt.xlim([0, 12.57])
11    plt.savefig(filename)11    plt.savefig(filename)
12if __name__=='__main__':12if __name__=='__main__':
13    make_plot('my_plot.png')13    make_plot('my_plot.png')
14    if compare_plots('my_plot.png','instructors_plot.png'):14    if compare_plots('my_plot.png','instructors_plot.png'):
15        print('Success!')15        print('Success!')
16    else:16    else:
17        print('Keep trying.')17        print('Keep trying.')
18import matplotlib.pyplot as plt18import matplotlib.pyplot as plt
19from scipy.linalg import norm19from scipy.linalg import norm
20from scipy import sum,average20from scipy import sum,average
21def compare_plots(imagefile1,imagefile2):21def compare_plots(imagefile1,imagefile2):
22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
24    if img1.size!=img2.size:24    if img1.size!=img2.size:
25        return False25        return False
26    diff = img1 - img2  26    diff = img1 - img2  
27    nm = sum(abs(diff))  27    nm = sum(abs(diff))  
28    nz = norm(diff.ravel(), 0)  28    nz = norm(diff.ravel(), 0)  
29    return nm/img1.size < 1 and nz/img1.size < 129    return nm/img1.size < 1 and nz/img1.size < 1
30def to_grayscale(arr):30def to_grayscale(arr):
31    if len(arr.shape) == 3:31    if len(arr.shape) == 3:
32        return average(arr, -1)  32        return average(arr, -1)  
33    else:33    else:
34        return arr34        return arr
35def normalize(arr):35def normalize(arr):
36    rng = arr.max()-arr.min()36    rng = arr.max()-arr.min()
37    amin = arr.min()37    amin = arr.min()
38    return (arr-amin)*255/rngimport numpy as np38    return (arr-amin)*255/rngimport numpy as np
39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
t40x= np.percentile(scores, np.arange(0,100,25))t40percent_calc = np.percentile(scores, np.arange(0,100,25))
41best_cultivar_indices,= np.where(scores>x[-1])41best_cultivar_indices,= np.where(scores>percent_calc[-1])
42print(f'Cultivars with the following IDs are in the top quartile with a score of42print(f'Cultivars with the following IDs are in the top quartile with a score of
> {x[-1]} or better:')> {percent_calc[-1]} or better:')
43best=cultivarIDs[best_cultivar_indices]43best=cultivarIDs[best_cultivar_indices]
44best.sort()44best.sort()
45print(', '.join([str(int(x)) for x in best]))45print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 149, P-Value: 3.90e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
n5    plt.xlabel('x (radians)')n5    plt.xlabel('x(radians)')
6    plt.ylabel('sin(x)')      6    plt.ylabel('sin(x)')
7    domain = np.linspace(0,12.57,num = 80)7    z = np.linspace(0,12.57, 80)
8    plt.plot(domain,np.sin(domain),'-b')8    plt.plot(z, np.sin(z),'-b')
9    plt.ylim([-1, 1])9    plt.ylim([-1,1])
10    plt.xlim([0, 12.57])10    plt.xlim([0,12.57])
11    plt.savefig(filename)11    plt.savefig(filename)
12if __name__=='__main__':12if __name__=='__main__':
13    make_plot('my_plot.png')13    make_plot('my_plot.png')
14    if compare_plots('my_plot.png','instructors_plot.png'):14    if compare_plots('my_plot.png','instructors_plot.png'):
15        print('Success!')15        print('Success!')
16    else:16    else:
17        print('Keep trying.')17        print('Keep trying.')
18import matplotlib.pyplot as plt18import matplotlib.pyplot as plt
19from scipy.linalg import norm19from scipy.linalg import norm
20from scipy import sum,average20from scipy import sum,average
21def compare_plots(imagefile1,imagefile2):21def compare_plots(imagefile1,imagefile2):
22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
24    if img1.size!=img2.size:24    if img1.size!=img2.size:
25        return False25        return False
26    diff = img1 - img2  26    diff = img1 - img2  
27    nm = sum(abs(diff))  27    nm = sum(abs(diff))  
28    nz = norm(diff.ravel(), 0)  28    nz = norm(diff.ravel(), 0)  
29    return nm/img1.size < 1 and nz/img1.size < 129    return nm/img1.size < 1 and nz/img1.size < 1
30def to_grayscale(arr):30def to_grayscale(arr):
31    if len(arr.shape) == 3:31    if len(arr.shape) == 3:
32        return average(arr, -1)  32        return average(arr, -1)  
33    else:33    else:
34        return arr34        return arr
35def normalize(arr):35def normalize(arr):
36    rng = arr.max()-arr.min()36    rng = arr.max()-arr.min()
37    amin = arr.min()37    amin = arr.min()
38    return (arr-amin)*255/rngimport numpy as np38    return (arr-amin)*255/rngimport numpy as np
39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
t40percent_calc = np.percentile(scores, np.arange(0,100,25))t40x= np.percentile(scores, np.arange(0,100,25))
41best_cultivar_indices,= np.where(scores>percent_calc[-1])41best_cultivar_indices,= np.where(scores>x[-1])
42print(f'Cultivars with the following IDs are in the top quartile with a score of42print(f'Cultivars with the following IDs are in the top quartile with a score of
> {percent_calc[-1]} or better:')> {x[-1]} or better:')
43best=cultivarIDs[best_cultivar_indices]43best=cultivarIDs[best_cultivar_indices]
44best.sort()44best.sort()
45print(', '.join([str(int(x)) for x in best]))45print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 315, P-Value: 3.92e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
n5    plt.plot(np.linspace(0, 4*np.pi, 80), np.sin(np.linspace(0, 4*np.pi, 80)), cn5    x=np.linspace(0,4*np.pi,80)
>olor = 'blue') 
6    plt.plot(x,np.sin(x),'-b')
7    plt.xlim([0,4*np.pi])
8    plt.ylim([-1,1])
6    plt.xlabel('x (radians)')9    plt.xlabel('x (radians)')
7    plt.ylabel('sin(x)')10    plt.ylabel('sin(x)')
n8    plt.xlim([0, 4 * np.pi])n
9    plt.ylim([-1,1])
10    plt.savefig(filename)11    plt.savefig(filename)
11if __name__=='__main__':12if __name__=='__main__':
12    make_plot('my_plot.png')13    make_plot('my_plot.png')
13    if compare_plots('my_plot.png','instructors_plot.png'):14    if compare_plots('my_plot.png','instructors_plot.png'):
14        print('Success!')15        print('Success!')
15    else:16    else:
16        print('Keep trying.')17        print('Keep trying.')
17import matplotlib.pyplot as plt18import matplotlib.pyplot as plt
18from scipy.linalg import norm19from scipy.linalg import norm
19from scipy import sum,average20from scipy import sum,average
20def compare_plots(imagefile1,imagefile2):21def compare_plots(imagefile1,imagefile2):
21    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
22    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
23    if img1.size!=img2.size:24    if img1.size!=img2.size:
24        return False25        return False
25    diff = img1 - img2  26    diff = img1 - img2  
26    nm = sum(abs(diff))  27    nm = sum(abs(diff))  
27    nz = norm(diff.ravel(), 0)  28    nz = norm(diff.ravel(), 0)  
28    return nm/img1.size < 1 and nz/img1.size < 129    return nm/img1.size < 1 and nz/img1.size < 1
29def to_grayscale(arr):30def to_grayscale(arr):
30    if len(arr.shape) == 3:31    if len(arr.shape) == 3:
31        return average(arr, -1)  32        return average(arr, -1)  
32    else:33    else:
33        return arr34        return arr
34def normalize(arr):35def normalize(arr):
35    rng = arr.max()-arr.min()36    rng = arr.max()-arr.min()
36    amin = arr.min()37    amin = arr.min()
37    return (arr-amin)*255/rngimport numpy as np38    return (arr-amin)*255/rngimport numpy as np
38cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
t39pctl = np.percentile(scores, np.arange(0, 100, 25))t40pctl = np.percentile(scores, np.arange(0,100,25))
40best_cultivar_indices = np.where(scores >= pctl[-1])41best_cultivar_indices = np.where(scores >= pctl[-1])
41print(f'Cultivars with the following IDs are in the top quartile with a score of42print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
42best=cultivarIDs[best_cultivar_indices]43best=cultivarIDs[best_cultivar_indices]
43best.sort()44best.sort()
44print(', '.join([str(int(x)) for x in best]))45print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 343, P-Value: 3.95e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
n5    x = np.arange(0, 4 * np.pi, .01)n5    x = np.linspace(0, 4*np.pi, 80)
6    y = np.sin(x)6    y = np.sin(x)
nn7    plt.xlabel('x (radians)')
8    plt.ylabel('sin(x)')
7    plt.xlim((0,4*np.pi))9    plt.xlim(0, 4*np.pi)
8    plt.ylim((-1,1))10    plt.ylim(-1,1)
9    plt.xlabel("x (radians)") 
10    plt.ylabel("sin(x)") 
11    plt.plot(x, y, '-b')11    plt.plot(x, y, '-b')
t12    plt.show()t
13    plt.savefig(filename)12    plt.savefig(filename)
14if __name__=='__main__':13if __name__=='__main__':
15    make_plot('my_plot.png')14    make_plot('my_plot.png')
16    if compare_plots('my_plot.png','instructors_plot.png'):15    if compare_plots('my_plot.png','instructors_plot.png'):
17        print('Success!')16        print('Success!')
18    else:17    else:
19        print('Keep trying.')18        print('Keep trying.')
20import matplotlib.pyplot as plt19import matplotlib.pyplot as plt
21from scipy.linalg import norm20from scipy.linalg import norm
22from scipy import sum,average21from scipy import sum,average
23def compare_plots(imagefile1,imagefile2):22def compare_plots(imagefile1,imagefile2):
24    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
25    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
26    if img1.size!=img2.size:25    if img1.size!=img2.size:
27        return False26        return False
28    diff = img1 - img2  27    diff = img1 - img2  
29    nm = sum(abs(diff))  28    nm = sum(abs(diff))  
30    nz = norm(diff.ravel(), 0)  29    nz = norm(diff.ravel(), 0)  
31    return nm/img1.size < 1 and nz/img1.size < 130    return nm/img1.size < 1 and nz/img1.size < 1
32def to_grayscale(arr):31def to_grayscale(arr):
33    if len(arr.shape) == 3:32    if len(arr.shape) == 3:
34        return average(arr, -1)  33        return average(arr, -1)  
35    else:34    else:
36        return arr35        return arr
37def normalize(arr):36def normalize(arr):
38    rng = arr.max()-arr.min()37    rng = arr.max()-arr.min()
39    amin = arr.min()38    amin = arr.min()
40    return (arr-amin)*255/rngimport numpy as np39    return (arr-amin)*255/rngimport numpy as np
41cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
42quartile_boundaries = np.percentile(scores,np.arange(0,100,25))41quartile_boundaries = np.percentile(scores,np.arange(0,100,25))
43top_indices, = np.where(scores>quartile_boundaries[-1])42top_indices, = np.where(scores>quartile_boundaries[-1])
44print(f'Cultivars with the following IDs are in the top quartile with a score of43print(f'Cultivars with the following IDs are in the top quartile with a score of
> {quartile_boundaries[-1]} or better:')> {quartile_boundaries[-1]} or better:')
45best=cultivarIDs[top_indices]44best=cultivarIDs[top_indices]
46best.sort()45best.sort()
47print(', '.join([str(int(x)) for x in best]))46print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 306, P-Value: 3.95e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
n5    A = np.linspace(0,4*np.pi,80)n5    A = np.linspace(0, 4*np.pi, 80)
6    B = np.sin(A)
7    plt.plot(A,B, '-b')
6    plt.xlabel('x (radians)')8    plt.xlabel('x (radians)')
7    plt.ylabel('sin(x)')9    plt.ylabel('sin(x)')
n8    plt.xlim([0, 4*np.pi])n10    plt.xlim([0,4*np.pi])
9    plt.ylim([-1,1])11    plt.ylim([-1,1])
n10    plt.plot(A, np.sin(A), '-b')n
11    plt.savefig(filename)12    plt.savefig(filename)
12if __name__=='__main__':13if __name__=='__main__':
13    make_plot('my_plot.png')14    make_plot('my_plot.png')
14    if compare_plots('my_plot.png','instructors_plot.png'):15    if compare_plots('my_plot.png','instructors_plot.png'):
15        print('Success!')16        print('Success!')
16    else:17    else:
17        print('Keep trying.')18        print('Keep trying.')
18import matplotlib.pyplot as plt19import matplotlib.pyplot as plt
19from scipy.linalg import norm20from scipy.linalg import norm
20from scipy import sum,average21from scipy import sum,average
21def compare_plots(imagefile1,imagefile2):22def compare_plots(imagefile1,imagefile2):
22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
24    if img1.size!=img2.size:25    if img1.size!=img2.size:
25        return False26        return False
26    diff = img1 - img2  27    diff = img1 - img2  
27    nm = sum(abs(diff))  28    nm = sum(abs(diff))  
28    nz = norm(diff.ravel(), 0)  29    nz = norm(diff.ravel(), 0)  
29    return nm/img1.size < 1 and nz/img1.size < 130    return nm/img1.size < 1 and nz/img1.size < 1
30def to_grayscale(arr):31def to_grayscale(arr):
31    if len(arr.shape) == 3:32    if len(arr.shape) == 3:
32        return average(arr, -1)  33        return average(arr, -1)  
33    else:34    else:
34        return arr35        return arr
35def normalize(arr):36def normalize(arr):
36    rng = arr.max()-arr.min()37    rng = arr.max()-arr.min()
37    amin = arr.min()38    amin = arr.min()
38    return (arr-amin)*255/rngimport numpy as np39    return (arr-amin)*255/rngimport numpy as np
39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
n40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='n
>,') 
41pctl = np.percentile(scores,np.arange(0,100,25))41pctl = np.percentile(scores,np.arange(0,100,25))
t42best_cultivar_indices, = np.where(scores>pctl[-1])t42best_cultivar_indices, = np.where(scores>pctl[-1]) 
43print(f'Cultivars with the following IDs are in the top quartile with a score of43print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
44best=cultivarIDs[best_cultivar_indices]44best=cultivarIDs[best_cultivar_indices]
45best.sort()45best.sort()
46print(', '.join([str(int(x)) for x in best]))46print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 147, P-Value: 4.02e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
n3import mathn
4from compare_plots import compare_plots3from compare_plots import compare_plots
5def make_plot(filename):4def make_plot(filename):
n6    radians = np.linspace(0.0, 4*np.pi, num=80)n5    x = np.linspace(0, 4*np.pi, 80)
7    sine = np.sin(radians)6    y = np.sin(x)
8    plt.plot(radians, sine, '-b')7    plt.plot(x, y)
9    plt.xlabel('x (radians)')8    plt.xlabel('x (radians)')
10    plt.ylabel('sin(x)')9    plt.ylabel('sin(x)')
n11    plt.axis([0, 4*np.pi, -1.00, 1.00])n10    plt.axis([0, np.pi*4, -1, 1])
12    plt.savefig(filename)11    plt.savefig(filename)
n13if __name__=='__main__':n12if __name__ == '__main__':
14    make_plot('my_plot.png')13    make_plot('my_plot.png')
n15    if compare_plots('my_plot.png','instructors_plot.png'):n14    if compare_plots('my_plot.png', 'instructors_plot.png'):
16        print('Success!')15        print('Success!')
17    else:16    else:
18        print('Keep trying.')17        print('Keep trying.')
19import matplotlib.pyplot as plt18import matplotlib.pyplot as plt
20from scipy.linalg import norm19from scipy.linalg import norm
21from scipy import sum,average20from scipy import sum,average
22def compare_plots(imagefile1,imagefile2):21def compare_plots(imagefile1,imagefile2):
23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
25    if img1.size!=img2.size:24    if img1.size!=img2.size:
26        return False25        return False
27    diff = img1 - img2  26    diff = img1 - img2  
28    nm = sum(abs(diff))  27    nm = sum(abs(diff))  
29    nz = norm(diff.ravel(), 0)  28    nz = norm(diff.ravel(), 0)  
30    return nm/img1.size < 1 and nz/img1.size < 129    return nm/img1.size < 1 and nz/img1.size < 1
31def to_grayscale(arr):30def to_grayscale(arr):
32    if len(arr.shape) == 3:31    if len(arr.shape) == 3:
33        return average(arr, -1)  32        return average(arr, -1)  
34    else:33    else:
35        return arr34        return arr
36def normalize(arr):35def normalize(arr):
37    rng = arr.max()-arr.min()36    rng = arr.max()-arr.min()
38    amin = arr.min()37    amin = arr.min()
39    return (arr-amin)*255/rngimport numpy as np38    return (arr-amin)*255/rngimport numpy as np
t40import csvt
41cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
42pctl = np.percentile(scores,np.arange(0,100,25))40pctl = np.percentile(scores,np.arange(0,100,25))
43best_cultivar_indices, = np.where(scores>pctl[-1])41best_cultivar_indices, = np.where(scores>pctl[-1])
44print(f'Cultivars with the following IDs are in the top quartile with a score of42print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
45best=cultivarIDs[best_cultivar_indices]43best=cultivarIDs[best_cultivar_indices]
46best.sort()44best.sort()
47print(', '.join([str(int(x)) for x in best]))45print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 272, P-Value: 4.07e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
n5    plt.xlabel('x (radians)')n5    plt.xlabel('x(radians)')
6    plt.ylabel('sin(x)')6    plt.ylabel('sin(x)')
n7    Valrange = np.linspace(0,12.57,num = 80)n7    z = np.linspace(0,12.57, 80)
8    plt.plot(Valrange,np.sin(Valrange),'b-')8    plt.plot(z, np.sin(z),'-b')
9    plt.ylim([-1,1])9    plt.ylim([-1,1])
10    plt.xlim([0,12.57])10    plt.xlim([0,12.57])
11    plt.savefig(filename)11    plt.savefig(filename)
12if __name__=='__main__':12if __name__=='__main__':
13    make_plot('my_plot.png')13    make_plot('my_plot.png')
14    if compare_plots('my_plot.png','instructors_plot.png'):14    if compare_plots('my_plot.png','instructors_plot.png'):
15        print('Success!')15        print('Success!')
16    else:16    else:
17        print('Keep trying.')17        print('Keep trying.')
18import matplotlib.pyplot as plt18import matplotlib.pyplot as plt
19from scipy.linalg import norm19from scipy.linalg import norm
20from scipy import sum,average20from scipy import sum,average
21def compare_plots(imagefile1,imagefile2):21def compare_plots(imagefile1,imagefile2):
22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
24    if img1.size!=img2.size:24    if img1.size!=img2.size:
25        return False25        return False
26    diff = img1 - img2  26    diff = img1 - img2  
27    nm = sum(abs(diff))  27    nm = sum(abs(diff))  
28    nz = norm(diff.ravel(), 0)  28    nz = norm(diff.ravel(), 0)  
29    return nm/img1.size < 1 and nz/img1.size < 129    return nm/img1.size < 1 and nz/img1.size < 1
30def to_grayscale(arr):30def to_grayscale(arr):
31    if len(arr.shape) == 3:31    if len(arr.shape) == 3:
32        return average(arr, -1)  32        return average(arr, -1)  
33    else:33    else:
34        return arr34        return arr
35def normalize(arr):35def normalize(arr):
36    rng = arr.max()-arr.min()36    rng = arr.max()-arr.min()
37    amin = arr.min()37    amin = arr.min()
38    return (arr-amin)*255/rngimport numpy as np38    return (arr-amin)*255/rngimport numpy as np
39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
t40ptl = np.percentile(scores,np.arange(0,100,25))t40x= np.percentile(scores, np.arange(0,100,25))
41best_cultivar_indices, = np.where(scores>ptl[-1])41best_cultivar_indices,= np.where(scores>x[-1])
42print(f'Cultivars with the following IDs are in the top quartile with a score of42print(f'Cultivars with the following IDs are in the top quartile with a score of
> {ptl[-1]} or better:')> {x[-1]} or better:')
43best=cultivarIDs[best_cultivar_indices]43best=cultivarIDs[best_cultivar_indices]
44best.sort()44best.sort()
45print(', '.join([str(int(x)) for x in best]))45print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 36, P-Value: 4.16e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
n4def make_plot(main):n4def make_plot(filename):
5    x = np.linspace(0,np.pi*4,100)5    x = np.linspace(0,np.pi * 4,100)
6    y= np.sin(x)6    y = np.sin(x)
7    plt.plot(x,y,"b")7    plt.plot(x,y,'b')
8    plt.xlabel('x(radians)')8    plt.xlabel('x(radians)')
9    plt.ylabel('sin(x)')9    plt.ylabel('sin(x)')
10    plt.margins(0,0)10    plt.margins(0,0)
n11    plt.savefig(main)n11    plt.savefig(filename)
12if __name__=='__main__':12if __name__=='__main__':
13    make_plot('my_plot.png')13    make_plot('my_plot.png')
14    if compare_plots('my_plot.png','instructors_plot.png'):14    if compare_plots('my_plot.png','instructors_plot.png'):
15        print('Success!')15        print('Success!')
16    else:16    else:
17        print('Keep trying.')17        print('Keep trying.')
18import matplotlib.pyplot as plt18import matplotlib.pyplot as plt
19from scipy.linalg import norm19from scipy.linalg import norm
20from scipy import sum,average20from scipy import sum,average
21def compare_plots(imagefile1,imagefile2):21def compare_plots(imagefile1,imagefile2):
22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
24    if img1.size!=img2.size:24    if img1.size!=img2.size:
25        return False25        return False
26    diff = img1 - img2  26    diff = img1 - img2  
27    nm = sum(abs(diff))  27    nm = sum(abs(diff))  
28    nz = norm(diff.ravel(), 0)  28    nz = norm(diff.ravel(), 0)  
29    return nm/img1.size < 1 and nz/img1.size < 129    return nm/img1.size < 1 and nz/img1.size < 1
30def to_grayscale(arr):30def to_grayscale(arr):
31    if len(arr.shape) == 3:31    if len(arr.shape) == 3:
32        return average(arr, -1)  32        return average(arr, -1)  
33    else:33    else:
34        return arr34        return arr
35def normalize(arr):35def normalize(arr):
36    rng = arr.max()-arr.min()36    rng = arr.max()-arr.min()
37    amin = arr.min()37    amin = arr.min()
38    return (arr-amin)*255/rngimport numpy as np38    return (arr-amin)*255/rngimport numpy as np
39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
40pctl=np.percentile(scores,np.arange(0,100,25))40pctl=np.percentile(scores,np.arange(0,100,25))
t41best_cultivar_indices = np.where(scores>=pctl[-1])t41best_cultivar_indices=np.where(scores>=pctl[-1])
42print(f'Cultivars with the following IDs are in the top quartile with a score of42print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
43best=cultivarIDs[best_cultivar_indices]43best=cultivarIDs[best_cultivar_indices]
44best.sort()44best.sort()
45print(', '.join([str(int(x)) for x in best]))45print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 230, P-Value: 4.19e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
nn3from compare_plots import compare_plots
3import math4import math
n4from compare_plots import compare_plotsn
5def make_plot(filename):5def make_plot(filename):
n6    x=np.linspace(0,12.56,80)n6    x=np.linspace(0,13,80)
7    y=list(map(math.sin,x))7    y= np.sin(x)
8    plt.plot(x,y,'-b')8    plt.plot(x,y,'-b')
nn9    plt.xlim([0,12.58])
10    plt.ylim([-1.00,1.00])
9    plt.xlabel('x (radians)')11    plt.xlabel('x (radians)')
10    plt.ylabel('sin(x)')12    plt.ylabel('sin(x)')
t11    plt.axis([-0,12.56,-1,1])t
12    plt.savefig(filename)13    plt.savefig(filename)
13if __name__=='__main__':14if __name__=='__main__':
14    make_plot('my_plot.png')15    make_plot('my_plot.png')
15    if compare_plots('my_plot.png','instructors_plot.png'):16    if compare_plots('my_plot.png','instructors_plot.png'):
16        print('Success!')17        print('Success!')
17    else:18    else:
18        print('Keep trying.')19        print('Keep trying.')
19import matplotlib.pyplot as plt20import matplotlib.pyplot as plt
20from scipy.linalg import norm21from scipy.linalg import norm
21from scipy import sum,average22from scipy import sum,average
22def compare_plots(imagefile1,imagefile2):23def compare_plots(imagefile1,imagefile2):
23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))24    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))25    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
25    if img1.size!=img2.size:26    if img1.size!=img2.size:
26        return False27        return False
27    diff = img1 - img2  28    diff = img1 - img2  
28    nm = sum(abs(diff))  29    nm = sum(abs(diff))  
29    nz = norm(diff.ravel(), 0)  30    nz = norm(diff.ravel(), 0)  
30    return nm/img1.size < 1 and nz/img1.size < 131    return nm/img1.size < 1 and nz/img1.size < 1
31def to_grayscale(arr):32def to_grayscale(arr):
32    if len(arr.shape) == 3:33    if len(arr.shape) == 3:
33        return average(arr, -1)  34        return average(arr, -1)  
34    else:35    else:
35        return arr36        return arr
36def normalize(arr):37def normalize(arr):
37    rng = arr.max()-arr.min()38    rng = arr.max()-arr.min()
38    amin = arr.min()39    amin = arr.min()
39    return (arr-amin)*255/rngimport numpy as np40    return (arr-amin)*255/rngimport numpy as np
40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='41cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
41pctl = np.percentile(scores, np.arange(0,100,25))42pctl = np.percentile(scores, np.arange(0,100,25))
42best_cultivar_indices = np.where(scores >= pctl[-1])43best_cultivar_indices = np.where(scores >= pctl[-1])
43print(f'Cultivars with the following IDs are in the top quartile with a score of44print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
44best=cultivarIDs[best_cultivar_indices]45best=cultivarIDs[best_cultivar_indices]
45best.sort()46best.sort()
46print(', '.join([str(int(x)) for x in best]))47print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 328, P-Value: 4.19e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
n5    X = np.linspace(-np.pi,4*np.pi, 80)n5    arrayx = np.linspace(0, (4*np.pi), 80)
6    y = np.sin(X)6    plt.plot(arrayx, np.sin(arrayx), '-b')
7    plt.xlim(0,np.pi*4)7    plt.ylabel('sin(x)')
8    plt.ylim(-1,1)
9    plt.plot(X,y,'-b')
10    plt.xlabel('x (radians)')8    plt.xlabel('x (radians)')
n11    plt.ylabel('sin(x)')n9    plt.xlim(0, 4*np.pi)
10    plt.ylim(-1, 1)
12    plt.savefig(filename)11    plt.savefig(filename)
t13    return filenamet
14if __name__=='__main__':12if __name__=='__main__':
15    make_plot('my_plot.png')13    make_plot('my_plot.png')
16    if compare_plots('my_plot.png','instructors_plot.png'):14    if compare_plots('my_plot.png','instructors_plot.png'):
17        print('Success!')15        print('Success!')
18    else:16    else:
19        print('Keep trying.')17        print('Keep trying.')
20import matplotlib.pyplot as plt18import matplotlib.pyplot as plt
21from scipy.linalg import norm19from scipy.linalg import norm
22from scipy import sum,average20from scipy import sum,average
23def compare_plots(imagefile1,imagefile2):21def compare_plots(imagefile1,imagefile2):
24    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
25    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
26    if img1.size!=img2.size:24    if img1.size!=img2.size:
27        return False25        return False
28    diff = img1 - img2  26    diff = img1 - img2  
29    nm = sum(abs(diff))  27    nm = sum(abs(diff))  
30    nz = norm(diff.ravel(), 0)  28    nz = norm(diff.ravel(), 0)  
31    return nm/img1.size < 1 and nz/img1.size < 129    return nm/img1.size < 1 and nz/img1.size < 1
32def to_grayscale(arr):30def to_grayscale(arr):
33    if len(arr.shape) == 3:31    if len(arr.shape) == 3:
34        return average(arr, -1)  32        return average(arr, -1)  
35    else:33    else:
36        return arr34        return arr
37def normalize(arr):35def normalize(arr):
38    rng = arr.max()-arr.min()36    rng = arr.max()-arr.min()
39    amin = arr.min()37    amin = arr.min()
40    return (arr-amin)*255/rngimport numpy as np38    return (arr-amin)*255/rngimport numpy as np
41cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
42pctl = np.percentile(scores,np.arange(0,100,25))40pctl = np.percentile(scores,np.arange(0,100,25))
43best_cultivar_indices, = np.where(scores>pctl[-1])41best_cultivar_indices, = np.where(scores>pctl[-1])
44print(f'Cultivars with the following IDs are in the top quartile with a score of42print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
45best=cultivarIDs[best_cultivar_indices]43best=cultivarIDs[best_cultivar_indices]
46best.sort()44best.sort()
47print(', '.join([str(int(x)) for x in best]))45print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 57, P-Value: 4.21e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
n3import mathn
4from compare_plots import compare_plots3from compare_plots import compare_plots
5def make_plot(filename):4def make_plot(filename):
n6    x = np.linspace(0,13,80)n5    x = np.linspace(0,4*np.pi, num = 80)
7    y = np.sin(x)6    y = np.sin(x)
n8    plt.xlim([0,4*math.pi])n7    plt.xlim([0,4*np.pi])
8    plt.ylim([-1,1])
9    plt.xticks(list(range(2,13,2)))9    plt.xticks(list(range(0,13,2)))
10    plt.xlabel('x (radians)')10    plt.xlabel('x(radians)')
11    plt.ylim([-1.00,1.00])
12    plt.ylabel('sin(x)')11    plt.ylabel('sin(x)')
n13    plt.plot(x, y, '-b')n12    plt.plot(x,y, '-b')
14    plt.savefig(filename)13    plt.savefig(filename)
15if __name__=='__main__':14if __name__=='__main__':
16    make_plot('my_plot.png')15    make_plot('my_plot.png')
17    if compare_plots('my_plot.png','instructors_plot.png'):16    if compare_plots('my_plot.png','instructors_plot.png'):
18        print('Success!')17        print('Success!')
19    else:18    else:
20        print('Keep trying.')19        print('Keep trying.')
21import matplotlib.pyplot as plt20import matplotlib.pyplot as plt
22from scipy.linalg import norm21from scipy.linalg import norm
23from scipy import sum,average22from scipy import sum,average
24def compare_plots(imagefile1,imagefile2):23def compare_plots(imagefile1,imagefile2):
25    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))24    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
26    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))25    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
27    if img1.size!=img2.size:26    if img1.size!=img2.size:
28        return False27        return False
29    diff = img1 - img2  28    diff = img1 - img2  
30    nm = sum(abs(diff))  29    nm = sum(abs(diff))  
31    nz = norm(diff.ravel(), 0)  30    nz = norm(diff.ravel(), 0)  
32    return nm/img1.size < 1 and nz/img1.size < 131    return nm/img1.size < 1 and nz/img1.size < 1
33def to_grayscale(arr):32def to_grayscale(arr):
34    if len(arr.shape) == 3:33    if len(arr.shape) == 3:
35        return average(arr, -1)  34        return average(arr, -1)  
36    else:35    else:
37        return arr36        return arr
38def normalize(arr):37def normalize(arr):
39    rng = arr.max()-arr.min()38    rng = arr.max()-arr.min()
40    amin = arr.min()39    amin = arr.min()
41    return (arr-amin)*255/rngimport numpy as np40    return (arr-amin)*255/rngimport numpy as np
42cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='41cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
43quartile_boundaries = np.percentile(scores,np.arange(0,100,25))42quartile_boundaries = np.percentile(scores,np.arange(0,100,25))
t44y = quartile_boundaries[-1]t43pctl = quartile_boundaries
45top_indices, = np.where(scores>quartile_boundaries[-1])44best_cultivar_indices, = np.where(scores>quartile_boundaries[-1])
46print(f'Cultivars with the following IDs are in the top quartile with a score of45print(f'Cultivars with the following IDs are in the top quartile with a score of
> {y} or better:')> {pctl[-1]} or better:')
47best=cultivarIDs[top_indices]46best=cultivarIDs[best_cultivar_indices]
48best.sort()47best.sort()
49print(', '.join([str(int(x)) for x in best]))48print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 126, P-Value: 4.33e-01

Student (left) and Nearest Neighbor (right).


nn1from cmath import pi
1import matplotlib.pyplot as plt2import matplotlib.pyplot as plt
2import numpy as np3import numpy as np
n3from cmath import pin
4from compare_plots import compare_plots4from compare_plots import compare_plots
5def make_plot(filename):5def make_plot(filename):
nn6    xRadians = np.linspace(0,4*np.pi,80)
7    sinx = np.sin(xRadians)
8    plt.plot(xRadians,sinx,'b-') 
6    plt.xlim(0,4*np.pi)9    plt.xlim(0,4*np.pi)
7    plt.ylim(-1.00,1.00)10    plt.ylim(-1.00,1.00)
n8    x = np.linspace(0,4*np.pi,80)n
9    y = np.sin(x)
10    plt.plot(x,y,'b-')
11    plt.savefig(filename)11    plt.savefig(filename) 
12if __name__=='__main__':12if __name__=='__main__':
13    make_plot('my_plot.png')13    make_plot('my_plot.png')
14    if compare_plots('my_plot.png','instructors_plot.png'):14    if compare_plots('my_plot.png','instructors_plot.png'):
15        print('Success!')15        print('Success!')
16    else:16    else:
17        print('Keep trying.')17        print('Keep trying.')
18import matplotlib.pyplot as plt18import matplotlib.pyplot as plt
19from scipy.linalg import norm19from scipy.linalg import norm
20from scipy import sum,average20from scipy import sum,average
21def compare_plots(imagefile1,imagefile2):21def compare_plots(imagefile1,imagefile2):
22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
24    if img1.size!=img2.size:24    if img1.size!=img2.size:
25        return False25        return False
26    diff = img1 - img2  26    diff = img1 - img2  
27    nm = sum(abs(diff))  27    nm = sum(abs(diff))  
28    nz = norm(diff.ravel(), 0)  28    nz = norm(diff.ravel(), 0)  
29    return nm/img1.size < 1 and nz/img1.size < 129    return nm/img1.size < 1 and nz/img1.size < 1
30def to_grayscale(arr):30def to_grayscale(arr):
31    if len(arr.shape) == 3:31    if len(arr.shape) == 3:
32        return average(arr, -1)  32        return average(arr, -1)  
33    else:33    else:
34        return arr34        return arr
35def normalize(arr):35def normalize(arr):
36    rng = arr.max()-arr.min()36    rng = arr.max()-arr.min()
37    amin = arr.min()37    amin = arr.min()
38    return (arr-amin)*255/rngimport numpy as np38    return (arr-amin)*255/rngimport numpy as np
39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
40quartile_boundaries = np.percentile(scores,np.arange(0,100,25))40quartile_boundaries = np.percentile(scores,np.arange(0,100,25))
n41best_cultivar_indices = np.where(scores>quartile_boundaries[-1])n41top_indices = np.where(scores>quartile_boundaries[-1])
42print(f'Cultivars with the following IDs are in the top quartile with a score of42print(f'Cultivars with the following IDs are in the top quartile with a score of
> {quartile_boundaries[-1]} or better:')> {quartile_boundaries[-1]} or better:')
t43best=cultivarIDs[best_cultivar_indices]t43best=cultivarIDs[top_indices]
44best.sort()44best.sort()
45print(', '.join([str(int(x)) for x in best]))45print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 145, P-Value: 4.33e-01

Student (left) and Nearest Neighbor (right).


n1from cmath import pin
2import matplotlib.pyplot as plt1import matplotlib.pyplot as plt
3import numpy as np2import numpy as np
nn3from cmath import pi
4from compare_plots import compare_plots4from compare_plots import compare_plots
5def make_plot(filename):5def make_plot(filename):
n6    xRadians = np.linspace(0,4*np.pi,80)n
7    sinx = np.sin(xRadians)
8    plt.plot(xRadians,sinx,'b-') 
9    plt.xlim(0,4*np.pi)6    plt.xlim(0,4*np.pi)
10    plt.ylim(-1.00,1.00)7    plt.ylim(-1.00,1.00)
nn8    x = np.linspace(0,4*np.pi,80)
9    y = np.sin(x)
10    plt.plot(x,y,'b-')
11    plt.savefig(filename) 11    plt.savefig(filename)
12if __name__=='__main__':12if __name__=='__main__':
13    make_plot('my_plot.png')13    make_plot('my_plot.png')
14    if compare_plots('my_plot.png','instructors_plot.png'):14    if compare_plots('my_plot.png','instructors_plot.png'):
15        print('Success!')15        print('Success!')
16    else:16    else:
17        print('Keep trying.')17        print('Keep trying.')
18import matplotlib.pyplot as plt18import matplotlib.pyplot as plt
19from scipy.linalg import norm19from scipy.linalg import norm
20from scipy import sum,average20from scipy import sum,average
21def compare_plots(imagefile1,imagefile2):21def compare_plots(imagefile1,imagefile2):
22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
24    if img1.size!=img2.size:24    if img1.size!=img2.size:
25        return False25        return False
26    diff = img1 - img2  26    diff = img1 - img2  
27    nm = sum(abs(diff))  27    nm = sum(abs(diff))  
28    nz = norm(diff.ravel(), 0)  28    nz = norm(diff.ravel(), 0)  
29    return nm/img1.size < 1 and nz/img1.size < 129    return nm/img1.size < 1 and nz/img1.size < 1
30def to_grayscale(arr):30def to_grayscale(arr):
31    if len(arr.shape) == 3:31    if len(arr.shape) == 3:
32        return average(arr, -1)  32        return average(arr, -1)  
33    else:33    else:
34        return arr34        return arr
35def normalize(arr):35def normalize(arr):
36    rng = arr.max()-arr.min()36    rng = arr.max()-arr.min()
37    amin = arr.min()37    amin = arr.min()
38    return (arr-amin)*255/rngimport numpy as np38    return (arr-amin)*255/rngimport numpy as np
39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
40quartile_boundaries = np.percentile(scores,np.arange(0,100,25))40quartile_boundaries = np.percentile(scores,np.arange(0,100,25))
n41top_indices = np.where(scores>quartile_boundaries[-1])n41best_cultivar_indices = np.where(scores>quartile_boundaries[-1])
42print(f'Cultivars with the following IDs are in the top quartile with a score of42print(f'Cultivars with the following IDs are in the top quartile with a score of
> {quartile_boundaries[-1]} or better:')> {quartile_boundaries[-1]} or better:')
t43best=cultivarIDs[top_indices]t43best=cultivarIDs[best_cultivar_indices]
44best.sort()44best.sort()
45print(', '.join([str(int(x)) for x in best]))45print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 159, P-Value: 4.33e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
n5    xval = np.linspace(0,12.565,80)n5    x = np.linspace(0.0, np.pi *4,num=80)
6    yval = np.sin(xval)6    plt.plot(x, np.sin(x), 'b-')
7    plt.plot(xval,yval, '-b')
8    plt.xlabel('x (radians)')7    plt.xlabel('x(radians)')
9    plt.ylabel('sin(x)')8    plt.ylabel('sin(x)')
n10    plt.xlim(0,12.565)n9    plt.xlim(0, np.pi*4)
11    plt.ylim(-1.00,1.00)10    plt.ylim(-1,1)
12    plt.savefig(filename)11    plt.savefig(filename)
13if __name__=='__main__':12if __name__=='__main__':
14    make_plot('my_plot.png')13    make_plot('my_plot.png')
15    if compare_plots('my_plot.png','instructors_plot.png'):14    if compare_plots('my_plot.png','instructors_plot.png'):
16        print('Success!')15        print('Success!')
17    else:16    else:
18        print('Keep trying.')17        print('Keep trying.')
19import matplotlib.pyplot as plt18import matplotlib.pyplot as plt
20from scipy.linalg import norm19from scipy.linalg import norm
21from scipy import sum,average20from scipy import sum,average
22def compare_plots(imagefile1,imagefile2):21def compare_plots(imagefile1,imagefile2):
23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
25    if img1.size!=img2.size:24    if img1.size!=img2.size:
26        return False25        return False
27    diff = img1 - img2  26    diff = img1 - img2  
28    nm = sum(abs(diff))  27    nm = sum(abs(diff))  
29    nz = norm(diff.ravel(), 0)  28    nz = norm(diff.ravel(), 0)  
30    return nm/img1.size < 1 and nz/img1.size < 129    return nm/img1.size < 1 and nz/img1.size < 1
31def to_grayscale(arr):30def to_grayscale(arr):
32    if len(arr.shape) == 3:31    if len(arr.shape) == 3:
33        return average(arr, -1)  32        return average(arr, -1)  
34    else:33    else:
35        return arr34        return arr
36def normalize(arr):35def normalize(arr):
37    rng = arr.max()-arr.min()36    rng = arr.max()-arr.min()
38    amin = arr.min()37    amin = arr.min()
39    return (arr-amin)*255/rngimport numpy as np38    return (arr-amin)*255/rngimport numpy as np
40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
t41pct1 = np.percentile(scores,np.arange(0,100,25))t40pctl = np.percentile(scores,np.arange(0,100,25))
42best_cultivar_indices, = np.where(scores>pct1[-1])41best_cultivar_indices, = np.where(scores>pctl[-1])
43print(f'Cultivars with the following IDs are in the top quartile with a score of42print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pct1[-1]} or better:')> {pctl[-1]} or better:')
44best=cultivarIDs[best_cultivar_indices]43best=cultivarIDs[best_cultivar_indices]
45best.sort()44best.sort()
46print(', '.join([str(int(x)) for x in best]))45print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 109, P-Value: 4.33e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
n5    x = np.linspace(0, 4 * np.pi, 80)n5    x=np.linspace (0,np.pi*4, 80)
6    y = np.sin(x)6    y= np.sin(x)
7    plt.plot(x, y)7    plt.plot(x,y)
8    plt.axis([0, 4 * np.pi, -1, 1])8    plt.axis([0,4*np.pi,-1,1])
9    plt.savefig(filename)9    plt.savefig(filename)
10if __name__=='__main__':10if __name__=='__main__':
11    make_plot('my_plot.png')11    make_plot('my_plot.png')
12    if compare_plots('my_plot.png','instructors_plot.png'):12    if compare_plots('my_plot.png','instructors_plot.png'):
13        print('Success!')13        print('Success!')
14    else:14    else:
15        print('Keep trying.')15        print('Keep trying.')
16import matplotlib.pyplot as plt16import matplotlib.pyplot as plt
17from scipy.linalg import norm17from scipy.linalg import norm
18from scipy import sum,average18from scipy import sum,average
19def compare_plots(imagefile1,imagefile2):19def compare_plots(imagefile1,imagefile2):
20    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))20    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
21    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))21    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
22    if img1.size!=img2.size:22    if img1.size!=img2.size:
23        return False23        return False
24    diff = img1 - img2  24    diff = img1 - img2  
25    nm = sum(abs(diff))  25    nm = sum(abs(diff))  
26    nz = norm(diff.ravel(), 0)  26    nz = norm(diff.ravel(), 0)  
27    return nm/img1.size < 1 and nz/img1.size < 127    return nm/img1.size < 1 and nz/img1.size < 1
28def to_grayscale(arr):28def to_grayscale(arr):
29    if len(arr.shape) == 3:29    if len(arr.shape) == 3:
30        return average(arr, -1)  30        return average(arr, -1)  
31    else:31    else:
32        return arr32        return arr
33def normalize(arr):33def normalize(arr):
34    rng = arr.max()-arr.min()34    rng = arr.max()-arr.min()
35    amin = arr.min()35    amin = arr.min()
36    return (arr-amin)*255/rngimport numpy as np36    return (arr-amin)*255/rngimport numpy as np
37cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='37cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
38pctl = np.percentile(scores,np.arange(0,100,25))38pctl = np.percentile(scores,np.arange(0,100,25))
t39best_cultivar_indices= np.where(scores>pctl[-1])t39best_cultivar_indices=np.where(scores>=pctl[-1])
40print(f'Cultivars with the following IDs are in the top quartile with a score of40print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
41best=cultivarIDs[best_cultivar_indices]41best=cultivarIDs[best_cultivar_indices]
42best.sort()42best.sort()
43print(', '.join([str(int(x)) for x in best]))43print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 107, P-Value: 4.33e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
n5    x=np.linspace (0,np.pi*4, 80)n5    x = np.linspace(0, 4 * np.pi, 80)
6    y= np.sin(x)6    y = np.sin(x)
7    plt.plot(x,y)7    plt.plot(x, y)
8    plt.axis([0,4*np.pi,-1,1])8    plt.axis([0, 4 * np.pi, -1, 1])
9    plt.savefig(filename)9    plt.savefig(filename)
10if __name__=='__main__':10if __name__=='__main__':
11    make_plot('my_plot.png')11    make_plot('my_plot.png')
12    if compare_plots('my_plot.png','instructors_plot.png'):12    if compare_plots('my_plot.png','instructors_plot.png'):
13        print('Success!')13        print('Success!')
14    else:14    else:
15        print('Keep trying.')15        print('Keep trying.')
16import matplotlib.pyplot as plt16import matplotlib.pyplot as plt
17from scipy.linalg import norm17from scipy.linalg import norm
18from scipy import sum,average18from scipy import sum,average
19def compare_plots(imagefile1,imagefile2):19def compare_plots(imagefile1,imagefile2):
20    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))20    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
21    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))21    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
22    if img1.size!=img2.size:22    if img1.size!=img2.size:
23        return False23        return False
24    diff = img1 - img2  24    diff = img1 - img2  
25    nm = sum(abs(diff))  25    nm = sum(abs(diff))  
26    nz = norm(diff.ravel(), 0)  26    nz = norm(diff.ravel(), 0)  
27    return nm/img1.size < 1 and nz/img1.size < 127    return nm/img1.size < 1 and nz/img1.size < 1
28def to_grayscale(arr):28def to_grayscale(arr):
29    if len(arr.shape) == 3:29    if len(arr.shape) == 3:
30        return average(arr, -1)  30        return average(arr, -1)  
31    else:31    else:
32        return arr32        return arr
33def normalize(arr):33def normalize(arr):
34    rng = arr.max()-arr.min()34    rng = arr.max()-arr.min()
35    amin = arr.min()35    amin = arr.min()
36    return (arr-amin)*255/rngimport numpy as np36    return (arr-amin)*255/rngimport numpy as np
37cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='37cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
38pctl = np.percentile(scores,np.arange(0,100,25))38pctl = np.percentile(scores,np.arange(0,100,25))
t39best_cultivar_indices=np.where(scores>=pctl[-1])t39best_cultivar_indices= np.where(scores>pctl[-1])
40print(f'Cultivars with the following IDs are in the top quartile with a score of40print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
41best=cultivarIDs[best_cultivar_indices]41best=cultivarIDs[best_cultivar_indices]
42best.sort()42best.sort()
43print(', '.join([str(int(x)) for x in best]))43print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 194, P-Value: 4.38e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
n5    plt.xlim([0,4*np.pi])n
6    plt.ylim([-1.0,1.0])
7    plt.xlabel('x(radians)')
8    plt.ylabel('sin(x)')
9    x = np.linspace(0,4*np.pi,80)5    x = np.linspace(0,4*np.pi,80)
10    y = np.sin(x)6    y = np.sin(x)
n11    plt.plot(x,y)n7    plt.plot(x,y,'-b', )
8    plt.xlabel('x (radians)')
9    plt.ylabel('sin(x)')
10    plt.xlim([0,4*np.pi])
11    plt.ylim([-1,1])
12    plt.savefig(filename)12    plt.savefig(filename)
13if __name__=='__main__':13if __name__=='__main__':
14    make_plot('my_plot.png')14    make_plot('my_plot.png')
15    if compare_plots('my_plot.png','instructors_plot.png'):15    if compare_plots('my_plot.png','instructors_plot.png'):
16        print('Success!')16        print('Success!')
17    else:17    else:
18        print('Keep trying.')18        print('Keep trying.')
19import matplotlib.pyplot as plt19import matplotlib.pyplot as plt
20from scipy.linalg import norm20from scipy.linalg import norm
21from scipy import sum,average21from scipy import sum,average
22def compare_plots(imagefile1,imagefile2):22def compare_plots(imagefile1,imagefile2):
23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
25    if img1.size!=img2.size:25    if img1.size!=img2.size:
26        return False26        return False
27    diff = img1 - img2  27    diff = img1 - img2  
28    nm = sum(abs(diff))  28    nm = sum(abs(diff))  
29    nz = norm(diff.ravel(), 0)  29    nz = norm(diff.ravel(), 0)  
30    return nm/img1.size < 1 and nz/img1.size < 130    return nm/img1.size < 1 and nz/img1.size < 1
31def to_grayscale(arr):31def to_grayscale(arr):
32    if len(arr.shape) == 3:32    if len(arr.shape) == 3:
33        return average(arr, -1)  33        return average(arr, -1)  
34    else:34    else:
35        return arr35        return arr
36def normalize(arr):36def normalize(arr):
37    rng = arr.max()-arr.min()37    rng = arr.max()-arr.min()
38    amin = arr.min()38    amin = arr.min()
39    return (arr-amin)*255/rngimport numpy as np39    return (arr-amin)*255/rngimport numpy as np
n40cultivarIDs, scores = np.loadtxt('cultivar_test_scores.csv', unpack = True, delin40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>miter = ',')>,')
41pctl = np.percentile(scores, np.arange(0, 100, 25))41pctl = np.percentile(scores, np.arange(0,100,25))
42top_indices, = np.where(scores > pctl[-1])42best_cultivar_indices = np.where(scores >= pctl[-1])
43print(f'Cultivars with the following IDs are in the top quartile with a score of43print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
t44best = cultivarIDs[top_indices]t44best=cultivarIDs[best_cultivar_indices]
45best.sort()45best.sort()
46print(', '.join([str(int(x)) for x in best]))46print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 453, P-Value: 4.43e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
n5    xval=np.linspace(0,(np.pi)*4,80)n5    x = np.linspace(0,4*np.pi,num=80)
6    yval=np.sin(xval)6    y = np.sin(x)
7    im=plt.plot(xval,yval,'-b')7    plt.plot(x, y,'-b')
8    plt.xlim([0,4*np.pi])
9    plt.ylim([-1,1])
10    plt.xlabel('x (radians)')
8    plt.ylabel('sin(x)')11    plt.ylabel('sin(x)')
n9    plt.xlabel('x (radians)')n
10    plt.xlim([0,(np.pi)*4])
11    plt.ylim([-1,1])
12    plt.savefig(filename)12    plt.savefig(filename)
n13    return filenamen
14if __name__=='__main__':13if __name__=='__main__':
15    make_plot('my_plot.png')14    make_plot('my_plot.png')
16    if compare_plots('my_plot.png','instructors_plot.png'):15    if compare_plots('my_plot.png','instructors_plot.png'):
17        print('Success!')16        print('Success!')
18    else:17    else:
19        print('Keep trying.')18        print('Keep trying.')
20import matplotlib.pyplot as plt19import matplotlib.pyplot as plt
21from scipy.linalg import norm20from scipy.linalg import norm
22from scipy import sum,average21from scipy import sum,average
23def compare_plots(imagefile1,imagefile2):22def compare_plots(imagefile1,imagefile2):
24    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
25    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
26    if img1.size!=img2.size:25    if img1.size!=img2.size:
27        return False26        return False
28    diff = img1 - img2  27    diff = img1 - img2  
29    nm = sum(abs(diff))  28    nm = sum(abs(diff))  
30    nz = norm(diff.ravel(), 0)  29    nz = norm(diff.ravel(), 0)  
31    return nm/img1.size < 1 and nz/img1.size < 130    return nm/img1.size < 1 and nz/img1.size < 1
32def to_grayscale(arr):31def to_grayscale(arr):
33    if len(arr.shape) == 3:32    if len(arr.shape) == 3:
34        return average(arr, -1)  33        return average(arr, -1)  
35    else:34    else:
36        return arr35        return arr
37def normalize(arr):36def normalize(arr):
38    rng = arr.max()-arr.min()37    rng = arr.max()-arr.min()
39    amin = arr.min()38    amin = arr.min()
40    return (arr-amin)*255/rngimport numpy as np39    return (arr-amin)*255/rngimport numpy as np
41cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
42pctl = np.percentile(scores,np.arange(0,100,25))41pctl = np.percentile(scores,np.arange(0,100,25))
t43best_cultivar_indices, = np.where(scores>pctl[-1])t42best_cultivar_indices = np.where(scores> pctl[-1])
44print(f'Cultivars with the following IDs are in the top quartile with a score of43print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
45best=cultivarIDs[best_cultivar_indices]44best=cultivarIDs[best_cultivar_indices]
46best.sort()45best.sort()
47print(', '.join([str(int(x)) for x in best]))46print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 357, P-Value: 4.51e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
n3from math import pi, sinn3from math import pi
4from compare_plots import compare_plots4from compare_plots import compare_plots
5def make_plot(filename):5def make_plot(filename):
6    x = np.linspace(0,4 * pi,80)6    x = np.linspace(0,4 * pi,80)
7    y = np.sin(x)7    y = np.sin(x)
8    plt.plot(x,y,'-b')8    plt.plot(x,y,'-b')
9    plt.axis([0, 4 * pi, -1,1])9    plt.axis([0, 4 * pi, -1,1])
10    plt.savefig(filename)10    plt.savefig(filename)
11if __name__=='__main__':11if __name__=='__main__':
12    make_plot('my_plot.png')12    make_plot('my_plot.png')
13    if compare_plots('my_plot.png','instructors_plot.png'):13    if compare_plots('my_plot.png','instructors_plot.png'):
14        print('Success!')14        print('Success!')
15    else:15    else:
16        print('Keep trying.')16        print('Keep trying.')
17import matplotlib.pyplot as plt17import matplotlib.pyplot as plt
18from scipy.linalg import norm18from scipy.linalg import norm
19from scipy import sum,average19from scipy import sum,average
20def compare_plots(imagefile1,imagefile2):20def compare_plots(imagefile1,imagefile2):
21    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))21    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
22    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))22    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
23    if img1.size!=img2.size:23    if img1.size!=img2.size:
24        return False24        return False
25    diff = img1 - img2  25    diff = img1 - img2  
26    nm = sum(abs(diff))  26    nm = sum(abs(diff))  
27    nz = norm(diff.ravel(), 0)  27    nz = norm(diff.ravel(), 0)  
28    return nm/img1.size < 1 and nz/img1.size < 128    return nm/img1.size < 1 and nz/img1.size < 1
29def to_grayscale(arr):29def to_grayscale(arr):
30    if len(arr.shape) == 3:30    if len(arr.shape) == 3:
31        return average(arr, -1)  31        return average(arr, -1)  
32    else:32    else:
33        return arr33        return arr
34def normalize(arr):34def normalize(arr):
35    rng = arr.max()-arr.min()35    rng = arr.max()-arr.min()
36    amin = arr.min()36    amin = arr.min()
37    return (arr-amin)*255/rngimport numpy as np37    return (arr-amin)*255/rngimport numpy as np
38cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='38cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
t39q_bounds = np.percentile(scores,np.arange(0,100,25))t39pctl = np.percentile(scores, np.arange(0,100,25))
40best_indies, = np.where(scores > q_bounds[-1])40best_cultivar_indices = np.where(scores > pctl[-1])
41print(f'Cultivars with the following IDs are in the top quartile with a score of41print(f'Cultivars with the following IDs are in the top quartile with a score of
> {q_bounds[-1]} or better:')> {pctl[-1]} or better:')
42best=cultivarIDs[best_indies]42best=cultivarIDs[best_cultivar_indices]
43best.sort()43best.sort()
44print(', '.join([str(int(x)) for x in best]))44print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 473, P-Value: 4.55e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
n5    x = np.arange(0,4*np.pi,0.01)n5    x = np.linspace(0, 4*np.pi, 80)
6    f = np.sin(x)6    y = np.sin(x)
7    plt.plot(x,f)
8    plt.xlabel('x (radians)')7    plt.xlabel('x (radians)')
9    plt.ylabel('sin(x)')8    plt.ylabel('sin(x)')
tt9    plt.xlim(0, 4*np.pi)
10    plt.ylim([-1,1])10    plt.ylim(-1,1)
11    plt.xlim([0,4*np.pi])11    plt.plot(x, y, '-b')
12    plt.savefig(filename)
13    plt.savefig(filename)12    plt.savefig(filename)
14if __name__=='__main__':13if __name__=='__main__':
15    make_plot('my_plot.png')14    make_plot('my_plot.png')
16    if compare_plots('my_plot.png','instructors_plot.png'):15    if compare_plots('my_plot.png','instructors_plot.png'):
17        print('Success!')16        print('Success!')
18    else:17    else:
19        print('Keep trying.')18        print('Keep trying.')
20import matplotlib.pyplot as plt19import matplotlib.pyplot as plt
21from scipy.linalg import norm20from scipy.linalg import norm
22from scipy import sum,average21from scipy import sum,average
23def compare_plots(imagefile1,imagefile2):22def compare_plots(imagefile1,imagefile2):
24    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
25    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
26    if img1.size!=img2.size:25    if img1.size!=img2.size:
27        return False26        return False
28    diff = img1 - img2  27    diff = img1 - img2  
29    nm = sum(abs(diff))  28    nm = sum(abs(diff))  
30    nz = norm(diff.ravel(), 0)  29    nz = norm(diff.ravel(), 0)  
31    return nm/img1.size < 1 and nz/img1.size < 130    return nm/img1.size < 1 and nz/img1.size < 1
32def to_grayscale(arr):31def to_grayscale(arr):
33    if len(arr.shape) == 3:32    if len(arr.shape) == 3:
34        return average(arr, -1)  33        return average(arr, -1)  
35    else:34    else:
36        return arr35        return arr
37def normalize(arr):36def normalize(arr):
38    rng = arr.max()-arr.min()37    rng = arr.max()-arr.min()
39    amin = arr.min()38    amin = arr.min()
40    return (arr-amin)*255/rngimport numpy as np39    return (arr-amin)*255/rngimport numpy as np
41cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
42quartile_boundaries = np.percentile(scores,np.arange(0,100,25))41quartile_boundaries = np.percentile(scores,np.arange(0,100,25))
43top_indices, = np.where(scores>quartile_boundaries[-1])42top_indices, = np.where(scores>quartile_boundaries[-1])
44print(f'Cultivars with the following IDs are in the top quartile with a score of43print(f'Cultivars with the following IDs are in the top quartile with a score of
> {quartile_boundaries[-1]} or better:')> {quartile_boundaries[-1]} or better:')
45best=cultivarIDs[top_indices]44best=cultivarIDs[top_indices]
46best.sort()45best.sort()
47print(', '.join([str(int(x)) for x in best]))46print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 446, P-Value: 4.62e-01

Student (left) and Nearest Neighbor (right).


nn1import numpy as np
1import matplotlib.pyplot as plt2import matplotlib.pyplot as plt
n2import numpy as npn
3import math
4from compare_plots import compare_plots3from compare_plots import compare_plots
5def make_plot(filename):4def make_plot(filename):
n6    rad= 4*math.pin
7    x = np.linspace(0,rad,80)5    x = np.linspace(0,4*np.pi, 80)
8    y = np.sin(x)6    y = np.sin(x)
nn7    plt.ylim([-1.0,1.0])
8    plt.xlim([0,4*np.pi])
9    plt.plot(x,y,'-b')9    plt.plot(x,y, '-b')
10    plt.xlim(0,rad)
11    plt.ylim([-1.00, 1.00])
12    plt.yticks(np.arange(-1.00,1.25, step=0.25))
13    plt.xlabel('x (radians)')10    plt.xlabel('x (radians)')
14    plt.ylabel('sin(x)')11    plt.ylabel('sin(x)')
15    plt.savefig(filename)12    plt.savefig(filename)
16if __name__=='__main__':13if __name__=='__main__':
17    make_plot('my_plot.png')14    make_plot('my_plot.png')
18    if compare_plots('my_plot.png','instructors_plot.png'):15    if compare_plots('my_plot.png','instructors_plot.png'):
19        print('Success!')16        print('Success!')
20    else:17    else:
21        print('Keep trying.')18        print('Keep trying.')
22import matplotlib.pyplot as plt19import matplotlib.pyplot as plt
23from scipy.linalg import norm20from scipy.linalg import norm
24from scipy import sum,average21from scipy import sum,average
25def compare_plots(imagefile1,imagefile2):22def compare_plots(imagefile1,imagefile2):
26    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
27    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
28    if img1.size!=img2.size:25    if img1.size!=img2.size:
29        return False26        return False
30    diff = img1 - img2  27    diff = img1 - img2  
31    nm = sum(abs(diff))  28    nm = sum(abs(diff))  
32    nz = norm(diff.ravel(), 0)  29    nz = norm(diff.ravel(), 0)  
33    return nm/img1.size < 1 and nz/img1.size < 130    return nm/img1.size < 1 and nz/img1.size < 1
34def to_grayscale(arr):31def to_grayscale(arr):
35    if len(arr.shape) == 3:32    if len(arr.shape) == 3:
36        return average(arr, -1)  33        return average(arr, -1)  
37    else:34    else:
38        return arr35        return arr
39def normalize(arr):36def normalize(arr):
40    rng = arr.max()-arr.min()37    rng = arr.max()-arr.min()
41    amin = arr.min()38    amin = arr.min()
42    return (arr-amin)*255/rngimport numpy as np39    return (arr-amin)*255/rngimport numpy as np
43cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
tt41quartile_boundaries = np.percentile(scores,np.arange(0,100,25))
44pctl = np.percentile(scores,np.arange(0,100,25))42pctl = np.percentile(scores, np.arange(0,100,25))
45best_cultivar_indices, = np.where(scores>pctl[-1])43best_cultivar_indices, = np.where(scores>pctl[-1])
46print(f'Cultivars with the following IDs are in the top quartile with a score of44print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
47best=cultivarIDs[best_cultivar_indices]45best=cultivarIDs[best_cultivar_indices]
48best.sort()46best.sort()
49print(', '.join([str(int(x)) for x in best]))47print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 245, P-Value: 4.72e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3import math3import math
4from compare_plots import compare_plots4from compare_plots import compare_plots
n5from math import pin
6def make_plot(filename):5def make_plot(filename):
n7    x=np.linspace(0,4*pi,80)n6    x=np.linspace(0,12.56,80)
8    y=list(map(math.sin,x))7    y=list(map(math.sin,x))
9    plt.plot(x,y,'-b')8    plt.plot(x,y,'-b')
n10    plt.xlabel("x (radian)")n9    plt.xlabel('x (radians)')
11    plt.ylabel("sin(x)")10    plt.ylabel('sin(x)')
12    plt.ylim([-1,1])11    plt.axis([-0,12.56,-1,1])
13    plt.xlim([0,4*pi])
14    plt.savefig(filename)12    plt.savefig(filename)
15if __name__=='__main__':13if __name__=='__main__':
16    make_plot('my_plot.png')14    make_plot('my_plot.png')
17    if compare_plots('my_plot.png','instructors_plot.png'):15    if compare_plots('my_plot.png','instructors_plot.png'):
18        print('Success!')16        print('Success!')
19    else:17    else:
20        print('Keep trying.')18        print('Keep trying.')
21import matplotlib.pyplot as plt19import matplotlib.pyplot as plt
22from scipy.linalg import norm20from scipy.linalg import norm
23from scipy import sum,average21from scipy import sum,average
24def compare_plots(imagefile1,imagefile2):22def compare_plots(imagefile1,imagefile2):
25    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
26    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
27    if img1.size!=img2.size:25    if img1.size!=img2.size:
28        return False26        return False
29    diff = img1 - img2  27    diff = img1 - img2  
30    nm = sum(abs(diff))  28    nm = sum(abs(diff))  
31    nz = norm(diff.ravel(), 0)  29    nz = norm(diff.ravel(), 0)  
32    return nm/img1.size < 1 and nz/img1.size < 130    return nm/img1.size < 1 and nz/img1.size < 1
33def to_grayscale(arr):31def to_grayscale(arr):
34    if len(arr.shape) == 3:32    if len(arr.shape) == 3:
35        return average(arr, -1)  33        return average(arr, -1)  
36    else:34    else:
37        return arr35        return arr
38def normalize(arr):36def normalize(arr):
39    rng = arr.max()-arr.min()37    rng = arr.max()-arr.min()
40    amin = arr.min()38    amin = arr.min()
41    return (arr-amin)*255/rngimport numpy as np39    return (arr-amin)*255/rngimport numpy as np
42cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
t43pctl = np.percentile(scores,np.arange(0,100,25))t41pctl = np.percentile(scores, np.arange(0,100,25))
44best_cultivar_indices = np.where(scores >= pctl[-1])42best_cultivar_indices = np.where(scores >= pctl[-1])
45print(f'Cultivars with the following IDs are in the top quartile with a score of43print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
46best=cultivarIDs[best_cultivar_indices]44best=cultivarIDs[best_cultivar_indices]
47best.sort()45best.sort()
48print(', '.join([str(int(x)) for x in best]))46print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 213, P-Value: 4.74e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
4def make_plot(filename):4def make_plot(filename):
n5    A=np.linspace(0,13,100)n5    A=np.linspace(0,4*np.pi,80)
6    B=np.sin(A)6    B=np.sin(A)
n7    plt.plot(A,B, color = 'blue')n
8    plt.xlabel('x (radians)')7    plt.xlabel('x (radians)')
nn8    plt.xlim(0,4*np.pi)
9    plt.ylim(-1,1)
9    plt.ylabel('sin(x)')10    plt.ylabel('sin(x)')
n10    plt.ylim(-1.00,1.00)n11    plt.plot(A,B, color='blue')
11    plt.xlim(0.00,12.566371)
12    plt.savefig(filename)12    plt.savefig(filename)
13if __name__=='__main__':13if __name__=='__main__':
14    make_plot('my_plot.png')14    make_plot('my_plot.png')
15    if compare_plots('my_plot.png','instructors_plot.png'):15    if compare_plots('my_plot.png','instructors_plot.png'):
16        print('Success!')16        print('Success!')
17    else:17    else:
18        print('Keep trying.')18        print('Keep trying.')
19import matplotlib.pyplot as plt19import matplotlib.pyplot as plt
20from scipy.linalg import norm20from scipy.linalg import norm
21from scipy import sum,average21from scipy import sum,average
22def compare_plots(imagefile1,imagefile2):22def compare_plots(imagefile1,imagefile2):
23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
25    if img1.size!=img2.size:25    if img1.size!=img2.size:
26        return False26        return False
27    diff = img1 - img2  27    diff = img1 - img2  
28    nm = sum(abs(diff))  28    nm = sum(abs(diff))  
29    nz = norm(diff.ravel(), 0)  29    nz = norm(diff.ravel(), 0)  
30    return nm/img1.size < 1 and nz/img1.size < 130    return nm/img1.size < 1 and nz/img1.size < 1
31def to_grayscale(arr):31def to_grayscale(arr):
32    if len(arr.shape) == 3:32    if len(arr.shape) == 3:
33        return average(arr, -1)  33        return average(arr, -1)  
34    else:34    else:
35        return arr35        return arr
36def normalize(arr):36def normalize(arr):
37    rng = arr.max()-arr.min()37    rng = arr.max()-arr.min()
38    amin = arr.min()38    amin = arr.min()
39    return (arr-amin)*255/rngimport numpy as np39    return (arr-amin)*255/rngimport numpy as np
40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='40cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
t41pct = np.percentile(scores,np.arange(0,100,25))t41pctl = np.percentile(scores, np.arange(0,100,25))
42best_cultivar_indices = np.where(scores>pct[-1])42best_cultivar_indices, = np.where(scores>pctl[-1])
43print(f'Cultivars with the following IDs are in the top quartile with a score of43print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pct[-1]} or better:')> {pctl[-1]} or better:')
44best=cultivarIDs[best_cultivar_indices]44best=cultivarIDs[best_cultivar_indices]
45best.sort()45best.sort()
46print(', '.join([str(int(x)) for x in best]))46print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 284, P-Value: 4.79e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
n4import mathn
5def make_plot(filename):4def make_plot(filename):
n6    x = np.linspace(0, 4*np.pi, 80)n5    x=np.linspace(0, 4 * np.pi, 80)
7    plt.plot(x, np.sin(x), '-b')6    plt.plot(x, np.sin(x), '-b')
n8    plt.xlim(0, 4*np.pi)n7    plt.xlim(0, 4 * np.pi)
9    plt.ylim(-1, 1)8    plt.ylim(-1, 1)
n10    plt.xlabel("x (radians)")n9    plt.xlabel('x (radians)')
11    plt.ylabel("sin(x)")10    plt.ylabel('sin(x)')
12    plt.savefig(filename)11    plt.savefig(filename)
13if __name__=='__main__':12if __name__=='__main__':
14    make_plot('my_plot.png')13    make_plot('my_plot.png')
n15    if compare_plots('my_plot.png', 'instructors_plot.png'):n14    if compare_plots('my_plot.png','instructors_plot.png'):
16        print('Success!')15        print('Success!')
17    else:16    else:
18        print('Keep trying.')17        print('Keep trying.')
19import matplotlib.pyplot as plt18import matplotlib.pyplot as plt
20from scipy.linalg import norm19from scipy.linalg import norm
21from scipy import sum,average20from scipy import sum,average
22def compare_plots(imagefile1,imagefile2):21def compare_plots(imagefile1,imagefile2):
23    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))22    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
24    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))23    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
25    if img1.size!=img2.size:24    if img1.size!=img2.size:
26        return False25        return False
27    diff = img1 - img2  26    diff = img1 - img2  
28    nm = sum(abs(diff))  27    nm = sum(abs(diff))  
29    nz = norm(diff.ravel(), 0)  28    nz = norm(diff.ravel(), 0)  
30    return nm/img1.size < 1 and nz/img1.size < 129    return nm/img1.size < 1 and nz/img1.size < 1
31def to_grayscale(arr):30def to_grayscale(arr):
32    if len(arr.shape) == 3:31    if len(arr.shape) == 3:
33        return average(arr, -1)  32        return average(arr, -1)  
34    else:33    else:
35        return arr34        return arr
36def normalize(arr):35def normalize(arr):
37    rng = arr.max()-arr.min()36    rng = arr.max()-arr.min()
38    amin = arr.min()37    amin = arr.min()
39    return (arr-amin)*255/rngimport numpy as np38    return (arr-amin)*255/rngimport numpy as np
n40cultivarIDs, scores = np.loadtxt('cultivar_test_scores.csv', delimiter = ',', usn39cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>ecols = (0, 1), unpack =True)>,')
40usecols = (0, 1)
41unpack = True
41pctl = np.percentile(scores, np.arange(0, 100, 25))42pctl = np.percentile(scores, np.arange(0, 100, 25))
42best_cultivar_indices = np.where(scores >= pctl[-1])43best_cultivar_indices = np.where(scores >= pctl[-1])
43print(f'Cultivars with the following IDs are in the top quartile with a score of44print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
t44best = cultivarIDs[best_cultivar_indices]t45best=cultivarIDs[best_cultivar_indices]
45best.sort()46best.sort()
46print(', '.join([str(int(x)) for x in best]))47print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 372, P-Value: 9.83e-01

Student (left) and Nearest Neighbor (right).


n1from ast import Numn1from cmath import pi 
2import matplotlib.pyplot as plt2import matplotlib.pyplot as plt 
3import numpy as np3import numpy as np
4from compare_plots import compare_plots4from compare_plots import compare_plots
5def make_plot(filename):5def make_plot(filename):
n6    x_radians = np.linspace(0,4*np.pi,80) n6    plt.xlim([0, 4*(pi)])
7    y_sinx = np.sin(x_radians) 7    plt.ylim([-1.00, 1.00])
8    plt.plot(x_radians,y_sinx, color = 'blue') 8    plt.xticks(list(range(0, 13, 2)))
9    plt.xlabel('x (radians)') 9    plt.xlabel('x (radians)')
10    plt.ylabel('sin(x)') 10    plt.ylabel('sin(x)')
11    plt.autoscale(tight= True)11    radians = np.linspace(0, (4*pi), 80)
12    plt.yticks(np.linspace(y_sinx.min(), 1.0, 9))12    sine = np.sin(radians)
13    plt.plot(radians, sine, 'b-')
13    plt.savefig(filename)14    plt.savefig(filename)
14if __name__=='__main__':15if __name__=='__main__':
15    make_plot('my_plot.png')16    make_plot('my_plot.png')
16    if compare_plots('my_plot.png','instructors_plot.png'):17    if compare_plots('my_plot.png','instructors_plot.png'):
17        print('Success!')18        print('Success!')
18    else:19    else:
19        print('Keep trying.')20        print('Keep trying.')
20import matplotlib.pyplot as plt21import matplotlib.pyplot as plt
21from scipy.linalg import norm22from scipy.linalg import norm
22from scipy import sum,average23from scipy import sum,average
23def compare_plots(imagefile1,imagefile2):24def compare_plots(imagefile1,imagefile2):
24    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))25    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
25    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))26    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
26    if img1.size!=img2.size:27    if img1.size!=img2.size:
27        return False28        return False
28    diff = img1 - img2  29    diff = img1 - img2  
29    nm = sum(abs(diff))  30    nm = sum(abs(diff))  
30    nz = norm(diff.ravel(), 0)  31    nz = norm(diff.ravel(), 0)  
31    return nm/img1.size < 1 and nz/img1.size < 132    return nm/img1.size < 1 and nz/img1.size < 1
32def to_grayscale(arr):33def to_grayscale(arr):
33    if len(arr.shape) == 3:34    if len(arr.shape) == 3:
34        return average(arr, -1)  35        return average(arr, -1)  
35    else:36    else:
36        return arr37        return arr
37def normalize(arr):38def normalize(arr):
38    rng = arr.max()-arr.min()39    rng = arr.max()-arr.min()
39    amin = arr.min()40    amin = arr.min()
40    return (arr-amin)*255/rngimport numpy as np41    return (arr-amin)*255/rngimport numpy as np
41cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='42cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
t42scores_quartiles = np.percentile(scores, np.arange(0,100,25))t43pctl = np.percentile(scores,np.arange(0,100,25))
43best_cultivar_indices, = np.where(scores > scores_quartiles[-1])44best_cultivar_indices, = np.where(scores>pctl[-1])
44print(f'Cultivars with the following IDs are in the top quartile with a score of45print(f'Cultivars with the following IDs are in the top quartile with a score of
> {scores_quartiles[-1]} or better:')> {pctl[-1]} or better:')
45best_ID = []46best=cultivarIDs[best_cultivar_indices]
46for x in best_cultivar_indices: 
47    best=cultivarIDs[x] 
48    best_ID.append(best) 
49best_ID.sort() 47best.sort()
50print(', '.join([str(int(x)) for x in best_ID])) 48print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op




ID: 97, P-Value: 9.71e-01

Student (left) and Nearest Neighbor (right).


f1import matplotlib.pyplot as pltf1import matplotlib.pyplot as plt
2import numpy as np2import numpy as np
3from compare_plots import compare_plots3from compare_plots import compare_plots
n4from scipy.linalg import normn
5from scipy import sum,average
6from math import sin, pi
7def make_plot(filename):4def make_plot(filename):
n8    radstep=(1.0/80.0)n5    FREQUENCY = 1/(2*np.pi)
9    t1=np.arange(0.0,4*pi, radstep)6    RADIAN_STEP = 1/80.0
7    t1 = np.arange(0.0, 4*np.pi, RADIAN_STEP)
10    wave=np.sin(t1)8    wave = np.sin(t1)
11    plt.plot(t1, wave)9    plt.plot(t1, wave)
12    plt.xlabel("x (radians)")10    plt.xlabel("x (radians)")
n13    plt.ylabel("sin (x)")n11    plt.ylabel("sin(x)")
14    plt.axis([0, 4*pi, -1.00, 1.00])12    plt.axis([0, 4*np.pi, -1.00, 1.00])
13    plt.show()
15    plt.savefig(filename)14    plt.savefig(filename)
n16def compare_plots(imagefile1,imagefile2):n
17    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
18    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
19    if img1.size!=img2.size:
20        return False
21    diff = img1 - img2  
22    nm = sum(abs(diff))  
23    nz = norm(diff.ravel(), 0)  
24    return nm/img1.size < 1 and nz/img1.size < 1
25def to_grayscale(arr):
26    if len(arr.shape) == 3:
27        return average(arr, -1)  
28    else:
29        return arr
30def normalize(arr):
31    rng = arr.max()-arr.min()
32    amin = arr.min()
33    return (arr-amin)*255/rng
34if __name__=='__main__':15if __name__=='__main__':
35    make_plot('my_plot.png')16    make_plot('my_plot.png')
36    if compare_plots('my_plot.png','instructors_plot.png'):17    if compare_plots('my_plot.png','instructors_plot.png'):
37        print('Success!')18        print('Success!')
38    else:19    else:
39        print('Keep trying.')20        print('Keep trying.')
40import matplotlib.pyplot as plt21import matplotlib.pyplot as plt
41from scipy.linalg import norm22from scipy.linalg import norm
42from scipy import sum,average23from scipy import sum,average
43def compare_plots(imagefile1,imagefile2):24def compare_plots(imagefile1,imagefile2):
44    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))25    img1 = normalize(to_grayscale(plt.imread(imagefile1).astype(float)))
45    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))26    img2 = normalize(to_grayscale(plt.imread(imagefile2).astype(float)))
46    if img1.size!=img2.size:27    if img1.size!=img2.size:
47        return False28        return False
48    diff = img1 - img2  29    diff = img1 - img2  
49    nm = sum(abs(diff))  30    nm = sum(abs(diff))  
50    nz = norm(diff.ravel(), 0)  31    nz = norm(diff.ravel(), 0)  
51    return nm/img1.size < 1 and nz/img1.size < 132    return nm/img1.size < 1 and nz/img1.size < 1
52def to_grayscale(arr):33def to_grayscale(arr):
53    if len(arr.shape) == 3:34    if len(arr.shape) == 3:
54        return average(arr, -1)  35        return average(arr, -1)  
55    else:36    else:
56        return arr37        return arr
57def normalize(arr):38def normalize(arr):
58    rng = arr.max()-arr.min()39    rng = arr.max()-arr.min()
59    amin = arr.min()40    amin = arr.min()
60    return (arr-amin)*255/rngimport numpy as np41    return (arr-amin)*255/rngimport numpy as np
61cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='42cultivarIDs,scores=np.loadtxt('cultivar_test_scores.csv',unpack=True,delimiter='
>,')>,')
t62pctl=np.percentile(scores,np.arange(0,100,25))t43pctl = np.percentile(scores, np.arange(0, 100, 25))
63best_cultivar_indices = np.where(scores>pctl[-1])44best_cultivar_indices = np.where(scores>pctl[-1])
64print(f'Cultivars with the following IDs are in the top quartile with a score of45print(f'Cultivars with the following IDs are in the top quartile with a score of
> {pctl[-1]} or better:')> {pctl[-1]} or better:')
65best=cultivarIDs[best_cultivar_indices]46best=cultivarIDs[best_cultivar_indices]
66best.sort()47best.sort()
67print(', '.join([str(int(x)) for x in best]))48print(', '.join([str(int(x)) for x in best]))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op