New answers tagged

0

The Jaccard index or score is often used for bounding boxes or semantic segmentation in machine learning, i.e. in computer vision problems. Your problem is a classification problem using tabular data, and therefore this metric is not really applicable for this type of problem. Accuracy (and maybe even more so precision and recall) are more valuable metrics ...


0

For TensorFlow, you need numpy arrays, or tensors as input. Here is the documentation for it and there are bunch of options when it comes to arguments for the fit method and it has to be an array, tensor at the most basic level or some generator that returns an object of a similar type.


0

I have checked the colab example. There seems to be not enough memory to train a Ridge model with your humongous dataset whose shape is (982644, 1169). The notebook crashes when attempting to execute the said line, rr.fit(X_train, Y_train) So I tried decreasing the size of the dataset, and everything worked fine. xt = X_train.loc[:200000].copy() yt = ...


0

If you are just dropping the columns like X_train = train1.drop(['Sales', 'Date', 'Customers'], axis = 1) will give a dataframe, when you use .values at the end then the result type will be numpy array. So please remove the .values also the reshape line won't be required. Thanks


1

Try this, def max_is_greater_than_half(*args): df = pd.DataFrame(dict({'col_'+str(i+1): val for i, val in enumerate(args)})) max_val = df.apply(max, axis=1) df = df.apply(lambda x: (x > 0.5) & (max_val == x), axis=0).astype(int) return [np.array(df[col].values) for col in df.columns] out1, out2 = max_is_greater_than_half(in_1, ...


Top 50 recent answers are included