text_plain_output_2.png text_plain_output_1.png
from sklearn.decomposition import FastICA
reducer = FastICA(n_components=5, random_state=0, whiten='unit-variance')
r = reducer.fit_transform(X)
n_x_subplots = 2
c = 0
cc = 0
for i, j in [(0, 1), (0, 2), (1, 2), (2, 3), (2, 4), (3, 4)]:
    if c % n_x_subplots == 0:
        if c > 0:
            plt.show()
        fig = plt.figure(figsize=(20, 5))
        c = 0
        plt.suptitle(str_data_inf + ' n_samples=' + str(len(r)), fontsize=20)
    c += 1
    fig.add_subplot(1, n_x_subplots, c)
    ax = sns.scatterplot(x=r[:, i], y=r[:, j], hue=v4color, palette=palette1, marker=marker1, alpha=alpha1)
    if 1:
        plt.setp(ax.get_legend().get_texts(), fontsize=12)
        plt.setp(ax.get_legend().get_title(), fontsize=12)
    plt.title('ICA ' + str(i) + ' ' + str(j), fontsize=20)
    if c == 1:
        plt.setp(ax.get_legend().get_texts(), fontsize=12)
        plt.setp(ax.get_legend().get_title(), fontsize=12)
        plt.legend(bbox_to_anchor=(1.15, 1.0), loc='upper right')
    else:
        plt.legend('')
plt.show()