Category "machine-learning"

How can we make use of feature variables whose future values are fixed to predict target value?

With regard to time series features in a regression ML model. Suppose, we are living in a space colony. The temperature there is accurately under control, so we

Does sklearn LogisticRegressionCV use all data for final model

I was wondering how the final model (i.e. decision boundary) of LogisticRegressionCV in sklearn was calculated. So say I have some Xdata and ylabels such that

A `Concatenate` layer requires inputs with matching shapes except for the concatenation axis. Received: input_shape=[(None, 28), (None, 28, 28)]

""" Defining two sets of inputs Input_A: input from the features Input_B: input from images my train_features has (792,192) shape my train_images has (792,28,28

How to compare dates in python and find the greater one

I want to compare 2 date and predict a label true if date 1 greater than date 2 and predict false date 1 less than date 2. I have trained the model but model is

How do I load a local model with torch.hub.load?

I need to avoid downloading the model from the web (due to restrictions on the machine installed). This works, but it downloads the model from the Internet mode

How to apply StandardScaler in Pipeline in scikit-learn (sklearn)?

In the example below, pipe = Pipeline([ ('scale', StandardScaler()), ('reduce_dims', PCA(n_components=4)), ('clf', SVC(kernel = 'linear

RandomForestClassifier instance not fitted yet. Call 'fit' with appropriate arguments before using this method

I am trying to train a decision tree model, save it, and then reload it when I need it later. However, I keep getting the following error: This DecisionTre

Use multiple time-series to train model

Is there any way to use multiple time-series to train one model and use this model for predictions given a new time-series as an input? It is rather a theoretic

Plot scikit-learn (sklearn) SVM decision boundary / surface

I am currently performing multi class SVM with linear kernel using python's scikit library. The sample training data and testing data are as given below: Mode

How do I remove nonsensical or incomplete words from a corpus?

I am using some text for some NLP analyses. I have cleaned the text taking steps to remove non-alphanumeric characters, blanks, duplicate words and stopwords, a

For loop in Label encoding and one hot encoder

My Data set contains categorical variables so I am using label encoding and one hot encoder and my code is as follows can I use a loop to ensure that my cod

Pandas and scikit-learn: KeyError: [....] not in index

I do not understand why do I get the error KeyError: '[ 1351 1352 1353 ... 13500 13501 13502] not in index' when I run this code: cv = KFold(n_splits=10) fo

for printing image the following error is hapening

CODE import numpy as np import cv2 from google.colab.patches import cv2_imshow img=cv2.imread('/gdrive/My Drive/Colab Notebooks/merlin_190860876_3e2e2660-237f-4

Saving the weights of a Pytorch .pth model into a .txt or .json

I am trying to save the the weights of a pytorch model into a .txt or .json. When writing it to a .txt, #import torch model = torch.load("model_path") string =

True Positive Rate and False Positive Rate (TPR, FPR) for Multi-Class Data in python [duplicate]

How do you compute the true- and false- positive rates of a multi-class classification problem? Say, y_true = [1, -1, 0, 0, 1, -1, 1, 0,

True Positive Rate and False Positive Rate (TPR, FPR) for Multi-Class Data in python [duplicate]

How do you compute the true- and false- positive rates of a multi-class classification problem? Say, y_true = [1, -1, 0, 0, 1, -1, 1, 0,

Accumulate 1 and Reset to 0 once condition is met

Currently I have a dataset below and I try to accumulate the value if ColA is 0 while reset the value to 0 (restart counting again) if the ColA is 1 again. Col

How i can extracte x_train and y_train from train_generator?

In my CNN model I want to extract X_train and y_train from train_generator. I want to use ensemble learning, bagging and boosting to evaluate the model. the mai

How to use the output of a CNN as the input of another in an autonomous vehicle

I am developing a mini autonomous car using 3 CNNs and a camera sensor using this approach. One of the CNNs detects lanes on the images and outputs images wit

ValueError: Please initialize `TimeDistributed` layer with a `Layer` instance

I'm trying to build a model which can be trained on both audio and video samples but I get this error ValueError: Please initialize `TimeDistributed` layer with