machine-learning

RandomForest project

RandomForest project Question: I am very new and fresh to machine learning and this is my first project I am working on as part of a college course. I chose UK football (soccer) matches. I have chosen to use a Random Forest. Using different sources I have managed to get 20 years worth of data …

Total answers: 2

Can ARIMA take input sequence in Python?

Can ARIMA take input sequence in Python? Question: In Python, when you train LSTM model you can train the model on part of the data. Then at inference you can give it whatever input you like for example 10 recent timesteps that is not part of the training set. It will produce the output. Now …

Total answers: 2

Keras Reshape Layer Error: Total Size of New Array Must Be Unchanged

Keras Reshape Layer Error: Total Size of New Array Must Be Unchanged Question: This is my model import torch import os import cv2 import numpy as np import tensorflow as tf from tensorflow.keras.preprocessing.image import ImageDataGenerator import mediapipe as mp from sklearn.metrics import multilabel_confusion_matrix, accuracy_score # Define the path to your training and testing data directories …

Total answers: 1

shape of my dataframe(#rows) and that of final embeddings array doesn't match

shape of my dataframe(#rows) and that of final embeddings array doesn't match Question: I generated the word embeddings for my corpus(2-D List) then tried to generate the Average Word2Vec embeddings for each of the individual word list(that is for each comment which have been converted into a list though split() method) inside my corpus but …

Total answers: 1

How to plot a confusion matrix

How to plot a confusion matrix Question: I am trying to evaluate my renet50 model with a confusion matrix, but the confusion matrix looks like this: matrix = confusion_matrix(y_test, y_pred, normalize="pred") print(matrix) # output array([[1, 0], [1, 2]], dtype=int64) I am using scikit-learn for generating the confusion matrix and tf keras for making the model …

Total answers: 2

Multiclass confusion matrix in python

Multiclass confusion matrix in python Question: I’m trying to create a single multiclass confusion matrix in Python. df_true = pd.DataFrame({ "y_true": [0,0,1,1,0,2] }) df_pred = pd.DataFrame({ "y_pred": [0,1,2,0,1,2] }) And I want a single confusion matrix that tells me the actual and predict value for each case. Like this: Asked By: juanmac || Source Answers: …

Total answers: 1

Tensorflow model.trainable_variables doesn't update after setting layer.trainable

Tensorflow model.trainable_variables doesn't update after setting layer.trainable Question: Context I’m creating a script which randomly modifies some parameters in a Tensorflow model. It aims to "encrypt" the model by recording the modifications made so that the modifications can be undone by authorised users only. To enable this script, I want to freeze all model layers …

Total answers: 1

Analyze image similarity

Analyze image similarity Question: I am trying to check the similarity of n images I saved in an array (composed of 1797 samples, each of which is represented by 64 bits). My goal is to save the L1 distance of each pair of images in an array of size 1797×1797 (note that the method to …

Total answers: 1

model.parameters() alternative for TransUNet from transunet python library

model.parameters() alternative for TransUNet from transunet python library Question: I am trying to implement TransUNet for breakhis dataset I was making the optimizer like this optimizer = torch.optim.Adam(model.parameters(), lr=1e-4) my model is from transunet import TransUNet model = TransUNet(image_size=224, pretrain=True) But the parameter() function does not work with TransUNet This is the library I am …

Total answers: 1