TF icon indicating copy to clipboard operation
TF copied to clipboard

non integer value for feature

Open litpuvn opened this issue 7 years ago • 1 comments

def read_data(file_name):
	'''
	X: index 
	Y: rating values
	'''
	X = np.loadtxt(file_name, dtype=float, delimiter=',')
	ndims = X.shape[1]-1
	Y = X.T[ndims] # rating values
	X = np.delete(X, ndims, 1).astype(int) # index values
	dims = [X.T[i].max()+1 for i in range(ndims)]
	return [X, Y], dims

In the code, i saw you force the value of X to be integer. Why do you need this?

litpuvn avatar Jul 10 '18 23:07 litpuvn

If I remember correctly, Tensor Factorization only allows categorical features (which are integer). You can read the reference for more details. Thanks!

VincentLiu3 avatar Jul 30 '18 15:07 VincentLiu3