We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When I am trying to use Kernel cPCA, it is throwing the following error “NameError: name 'cpca_alpha' is not defined”.
The code snippet is similar to that is used for cPCA and looks like this:
import numpy as np from contrastive import Kernel_CPCA
N = 400; D = 30; gap=3
B = np.zeros((N, D)) B[:,0:10] = np.random.normal(0,10,(N,10)) B[:,10:20] = np.random.normal(0,3,(N,10)) B[:,20:30] = np.random.normal(0,1,(N,10))
A = np.zeros((N, D)) A[:,0:10] = np.random.normal(0,10,(N,10))
A[0:100, 10:20] = np.random.normal(0,1,(100,10)) A[0:100, 20:30] = np.random.normal(0,1,(100,10))
A[100:200, 10:20] = np.random.normal(0,1,(100,10)) A[100:200, 20:30] = np.random.normal(gap,1,(100,10))
A[200:300, 10:20] = np.random.normal(2*gap,1,(100,10)) A[200:300, 20:30] = np.random.normal(0,1,(100,10))
A[300:400, 10:20] = np.random.normal(2*gap,1,(100,10)) A[300:400, 20:30] = np.random.normal(gap,1,(100,10)) A_labels = [0]*100+[1]*100+[2]*100+[3]*100
cpca = Kernel_CPCA(standardize=False) cpca.fit_transform(A, B, plot=False, active_labels=A_labels)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
When I am trying to use Kernel cPCA, it is throwing the following error “NameError: name 'cpca_alpha' is not defined”.
The code snippet is similar to that is used for cPCA and looks like this:
import numpy as np
from contrastive import Kernel_CPCA
N = 400; D = 30; gap=3
In B, all the data pts are from the same distribution, which has different variances in three subspaces.
B = np.zeros((N, D))
B[:,0:10] = np.random.normal(0,10,(N,10))
B[:,10:20] = np.random.normal(0,3,(N,10))
B[:,20:30] = np.random.normal(0,1,(N,10))
In A there are four clusters.
A = np.zeros((N, D))
A[:,0:10] = np.random.normal(0,10,(N,10))
group 1
A[0:100, 10:20] = np.random.normal(0,1,(100,10))
A[0:100, 20:30] = np.random.normal(0,1,(100,10))
group 2
A[100:200, 10:20] = np.random.normal(0,1,(100,10))
A[100:200, 20:30] = np.random.normal(gap,1,(100,10))
group 3
A[200:300, 10:20] = np.random.normal(2*gap,1,(100,10))
A[200:300, 20:30] = np.random.normal(0,1,(100,10))
group 4
A[300:400, 10:20] = np.random.normal(2*gap,1,(100,10))
A[300:400, 20:30] = np.random.normal(gap,1,(100,10))
A_labels = [0]*100+[1]*100+[2]*100+[3]*100
cpca = Kernel_CPCA(standardize=False)
cpca.fit_transform(A, B, plot=False, active_labels=A_labels)
The text was updated successfully, but these errors were encountered: