Commit a602d513 authored by Ngocson's avatar Ngocson

correction

parent 227ce90e
......@@ -35,17 +35,18 @@ MNISTtestData = genfromtxt('DATA/MNISTtestData.csv', delimiter=',')
MNISTtestLabel = genfromtxt('DATA/MNISTtestLabel.csv', delimiter=',')
print("MNIST: loaded")
datasets = [("MNIST",MNISTtestData,MNISTtrainData,MNISTtestLabel,MNISTtrainLabel)
]
datasets = [("MNIST",MNISTtestData,MNISTtrainData,MNISTtestLabel,MNISTtrainLabel),
("Wine",WineTestData,WineTrainData,WineTestLabel,WineTrainLabel)]
transformedDatasets = []
name,testData, trainData,testLabel,trainLabel = datasets[0]
name,testData, trainData,testLabel,trainLabel = datasets[1]
print("Step 2: \nFeature reduction:")
N = 100
N = 13
te_scores = []
tr_scores = []
for n in range(2,N):
for n in range(1,N):
print(n)
ica = FastICA(n_components = n,
tol = 5e-4,
......@@ -67,9 +68,9 @@ for n in range(2,N):
tr_scores.append(tr_score)
plt.figure()
plt.plot(range(2,N),te_score,'r.-',label = "error on the test")
plt.plot(range(2,N),tr_score,'b.-',label = "error on the train")
plt.plot(range(1,N),te_scores,'r.-',label = "error on the test")
plt.plot(range(1,N),tr_scores,'b.-',label = "error on the train")
plt.title("ICA error")
plt.legend()
plt.savefig("RESULTS/ICAMNISTerror.png")
plt.savefig("RESULTS/ICA"+name+"error.png")
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment