Category "machine-learning"

How to Vectorize python function

I have made a resume parser but to parse my resumes, I am using a for loop to run my parse function over each resume. Is there a way to vectorize this approach?

How to get rid of the KeyError: 'names'

I was trying to make a program that can make classification between runway and taxiway using mask rcnn. after importing custom dataset in json format I am getti

How to acquire tf.data.dataset's shape?

I know dataset has output_shapes, but it shows like below: data_set: DatasetV1Adapter shapes: {item_id_hist: (?, ?), tags: (?, ?), client_platform: (?,), en

Changing label names of Kmean clusters

I am doing the kmean clustering through sklearn in python. I am wondering how to change the generated label name for kmean clusters. For example: data

How to add a new row after every unique entries in pandas dataframe

I have to add a new row at the end of each person information. In the new row which we will add all the information will be same as last row like name, last_upd

How to do gradient clipping in pytorch?

What is the correct way to perform gradient clipping in pytorch? I have an exploding gradients problem.

Invocation timed out using Sagemaker to invoke endpoints with pretrained custom PyTorch model [Inference]

I have a pretrained model based on PyTorch (contextualized_topic_models) and have deployed it using AWS sagemaker script model. However, when I tried to invoke

When using padding in sequence models, is Keras validation accuracy valid/ reliable?

I have a group of non zero sequences with different lengths and I am using Keras LSTM to model these sequences. I use Keras Tokenizer to tokenize (tokens start

ImportError: No module named grid_search, learning_curve

Problem with Scikit learn l can't use learning_curve of Sklearn and sklearn.grid_search. When l do import sklearn (it works) from sklearn.cluster import biclus

How to set the parameters grids correctly when tuning the workflowset with tidymodels?

I try to use tidymodels to tune the workflow with recipe and model parameters. When tuning a single workflow there is no problem. But when tuning a workflowsets

ValueError: hist method requires numerical columns, nothing to plot

I was going through a tutorial, but as I was running the code in an IDE, an error occurred. The link to the tutorial is here: https://thecleverprogrammer.com/20

How to deal with overfitting of xgboost classifier?

I use xgboost to do a multi-class classification of spectrogram images(data link: automotive target classification). The class number is 5, training data includ

I Need Assistance to Interpret the Score as a means to decide on the best regressor for my ML model

I am working on a Model for Machine Learning and was able to generate the scores of the processes. I am not sure how to use them to make a decision on which is

Reshape the input for BatchDataset trained model

I trained my tensorflow model on images after convert it to BatchDataset IMG_size = 224 INPUT_SHAPE = [None, IMG_size, IMG_size, 3] # 4D input model.fit(

XGBoost giving a static prediction of "0.5" randomly

I am using a scikit-learn pipeline with XGBRegressor. Pipeline is working good without any error. When I am prediction with this pipeline, I am predicting the

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