Skip to content
Advertisement

Tag: tensorflow

Unable to convert tensorflow.python.framework.ops.Tensor object to numpy array for passoing it in sklearn.metrics.cohen_kappa_score function

I thought of implementing kappaScore metrics using sklearn.metrics.cohen_kappa_score Error I get when I try to run this code: Here the type of y_true and y_pred requires to be in list or numpy array But the type of y_true and y_pred are, When directly try to print it (i.e, without type() function), it shows like this: Unable to use y_true.numpy() (Convert

Fitting LSTM model

I am trying to fit LSTM model, but it gave me an error with the shape. my dataset has 218 rows and 16 features including the targeted one. I split the data, %80 for training and %20 for testing, after compiling the model and run it, i got this error: Variable definitions: batch_size = 160 epochs = 20 timesteps =

How to use tf.repeat() to replicate a specific column/row/slice?

this thread explains well the use of tf.repeat() as a tensorflow alternative to np.repeat(). one functionality which I was unable to figure out, in np.repeat(), a specific column/row/slice can be replicated by supplying the index. e.g. is there any tensorflow alternative to this functionality of np.repeat()? Answer You could use the repeats parameter of tf.repeat: where you get the first

trying to callibrate keras model

I’m trying to calibrate my CNN model by Sklearn implementation CalibratedClassifierCV, tried to wrap it as KerasClassifier and to override the predict function but without success. someone could say me what I did wrong? this is the model code: this is me trying to calibrate it : the output : valX_cnn and val_y_cnn are of type np.array. tried even to

Advertisement