Beispiel #1
0
def ica(data,data2,output,y):

    j=[]
    for i in range(1,13):
        ica = FastICA(n_components=i)
        ica.data = ica.fit_transform(data)
        j.append(error(ica.data,y))
    plt.figure(figsize=(8, 8))

    plt.xlabel('the number of independent component', fontsize=16)
    plt.ylabel('error rate', fontsize=16)
    plt.title(f'ICA: {data2}', fontsize=20)
    plt.savefig(output)
Beispiel #2
0
        j.append(error(ica.data,y))
    plt.figure(figsize=(8, 8))

    plt.xlabel('the number of independent component', fontsize=16)
    plt.ylabel('error rate', fontsize=16)
    plt.title(f'ICA: {data2}', fontsize=20)
    plt.savefig(output)




ica(x_cancer,"Breast Cancer","ICAcancer.png",y_cancer)
ica(x_diabetes,"Diabetes","ICA.diab.png", y_diabetes)

ica = FastICA(10)
ica.data = ica.fit_transform(x_diabetes)

elbow(20,ica.data,"diaelbow.ica.png","Diabete Fit ICA")

EM(ica.data,"Diabites fit ICA","ICADIabetesicaEM.png")
ica = FastICA(4)
ica.data = ica.fit_transform(x_cancer)

elbow(10,ica.data,"cancerICAfit.png","Cancer Fit ICA")

EM(ica.data,"cancerfit ICA","ica4cancerem.png")


def rca(data,data2,output,y):
    plt.figure(figsize=(8, 8))
    for round in range(1,20):