Questions tagged [machine-learning]

Implementation questions about machine learning algorithms. General questions about machine learning (concepts, theory, methodology, terminology, etc.) should be posted to their specific communities.

machine-learning
Filter by
Sorted by
Tagged with
1 vote
0 answers
42 views

ValueError: setting an array element with a sequence. Fitting NB

I am trying to fit an NB classifier onto some data of the form: label = [[0,0,0,0,1,0,0,1,0...,0],[0,1,1,0,1,0,...,1],...] features = [(['0.02','0.03','0.05','0.04','0.015']),([...])] len(label[n]) ...
Taco22's user avatar
  • 123
1 vote
1 answer
2k views

How do I fix the error after first epoch on tensorflow?

Python 3.7.3 Tensorflow 2.0.0-alpha0 I'm trying the imdb classifier in tensorflow, I am sticking by the code in https://www.coursera.org/learn/natural-language-processing-tensorflow/lecture/Q1Ln5/...
Vruksha Nikam's user avatar
0 votes
1 answer
50 views

I get an error when I enter new input into the middle layer with keras

I want to know how to obtain the output when the new input is input from the middle layer for the model that has been learned. def encoder(input_): d1 = Dense(3, activation='relu', name='...
nerson's user avatar
  • 1
2 votes
3 answers
823 views

h2o Flow UI: Build Model but no ROC CURVE or AUC for multiclass?

Reference to https://dzone.com/articles/machine-learning-with-h2o-hands-on-guide-for-data I was able to follow the example and plotted the ROC and AUC curve but when I did the same thing with my data,...
user1342124's user avatar
2 votes
1 answer
2k views

category_encoders: TargetEncoder error "TypeError: Categorical cannot perform the operation mean"

I'm getting the below error when I try to target encode a categorical column. "TypeError: Categorical cannot perform the operation mean" When I try to run similar code through Jupyter Notebook it ...
KVR's user avatar
  • 21
0 votes
0 answers
124 views

Force deep auto encoder to overfit training data

I have a conditional auto encoder (python, tensorflow) trained on numerical data with a small number of samples (16), with 100 features. I am trying to force my auto encoder to greatly overfit my ...
Kasyap Raguram Chakravadhanula's user avatar
0 votes
0 answers
152 views

Why does my Keras Neural Network have zero accuracy?

I am attempting to train a neural network to do simple mapping i.e. X to Y. In this case I am attempting to map a value to its respective error. Both X and Y are arrays of size 1077. The data has a ...
ashune's user avatar
  • 11
1 vote
0 answers
503 views

ValueError: Classification metrics can't handle a mix of multiclass-multioutput and multilabel-indicator targets

A Noob to Deep Learning in general. I am trying to train my model on an image data set by using the command learn.fit_one_cycle(4,max_lr = 1e-2) and it trains for 4 epochs and fails at the end with ...
Sri Harsha's user avatar
0 votes
1 answer
241 views

Convert salary value given in string to numeric while ensuring all values are in same unit in a database using python

I have a dataset which has values of players given as a string. Values of few players are in millions while others are in thousands. I want to convert all these into float from string with values in ...
Ayush Kumar's user avatar
4 votes
2 answers
11k views

Google Colab taking too much time to train a classifier. How to fix this?

I want to train a classifier in google colab using Keras to classify if the image represents a dog or a cat. There are 8000 training samples and 2000 testing samples. The time taken for 1 epoch is ...
Atharva Joshi's user avatar
1 vote
0 answers
402 views

REINFORCE with continuous actions diverging

I'm trying to implement the REINFORCE algorithm for continuous action space. I've created a toy, one-state MDP where the reward is the negative of the absolute difference between the action chosen and ...
asdf4567's user avatar
0 votes
1 answer
132 views

What is the best approach to build an SVM model using sklearn, on a dateframe with features containing multiple values?

I am reading multiple csv files into a dataframe. Each file contains several columns and rows of data, from which I am trying to build a model to classify each file as target label '1' or target label ...
BeginnerMLCoder's user avatar
-4 votes
2 answers
922 views

How to calculate readibility scores easily or how can i write a function for that?

I have to calculate readability score of a text document. Is there a package or inbuilt function. Everything on internet seems too complex. Can any one help me with that or how to write my own ...
rylynn_mcbos's user avatar
0 votes
0 answers
498 views

Understanding linear layer in sequence labeling with pytorch lstm

I'm trying to get a grip on LSTM and pytorch. Given are sequences of varying length. Every datapoint in a sequence is composed of 8 features, and every datapoint belongs to one of 6 classes (0-5). I ...
dakiniishi's user avatar
1 vote
1 answer
231 views

TensorFlow - Multiple Possible Labels

I'm creating a Tic Tac Toe engine as my first Machine Learning project. It's job is to predict the best move on each position. The thing is, in some positions, there might be several "best-moves". So ...
Hatchi Roku's user avatar
-3 votes
1 answer
45 views

Logistic regression and machine learning how are they related

We were in a meeting discussing hiring a consultant we trust to do machine learning. On colleague piped up that it was just logistic regression and that he would do it What is machine learning and ...
R.Merritt's user avatar
  • 477
0 votes
0 answers
540 views

Error in y * weights : non-numeric argument to binary operator

I am trying to build a continuation ratio model on a large dataset that has many categorical variables using glmnetcr package. I'm trying to fit this model: fit3=glmnetcr(x=trainElective2[,1:26],y=...
Connor's user avatar
  • 3
1 vote
1 answer
529 views

How to give one hot Encoding for Categorical Values for Labels in Estimator Classification in Tensorflow

I have a Dataset in which I have String Values in Labels for Classification. I have Loaded the Dataset in Tensorflow and have Defined the Feature Columns for Different Features. Since I also have ...
Prashant Mathur's user avatar
0 votes
1 answer
1k views

How to convert Pytorch model parameters to long datatype?

I was able to convert pytorch model parameters to float or double but not to long. model = model.long() gives error, while model = model.float() runs. The error I get is: 'Net' object has no ...
Anubhav Natani's user avatar
0 votes
0 answers
171 views

Find Matrix Closest to Another in Numpy/Scipy

I have a simple problem. I have two matrices A and B, and I want to find a transformation AX that makes AX closest to B in the least squares sense. i.e. find X such that X = argmin ||AX -B|| under ...
Rafael's user avatar
  • 661
0 votes
1 answer
4k views

Viewing the coefficients/weights of a pickled trained model in scikit-learn

I have trained a SVM in Scikit-learn a few months back: # Create standardizer standardizer = StandardScaler() # Create logistic regression lsvc = SVC(C=0.1, cache_size=200, class_weight=None, coef0=...
chmscrbbrfck's user avatar
-1 votes
1 answer
1k views

How to feed a Neural Network with two inputs of different sizes?

I want to feed a Neural Network with two inputs. The first dataset (elements) will have a fixed shape of (20, 1), which means that it will be the same for both the training and the test phase (it ...
mateobruno's user avatar
0 votes
1 answer
715 views

Custom score function in GridSearchCV: Access to unscaled features, not in the model

I am using the GridSearchCV package from sklearn in Python and I would like to use it with a custom scoring function. The custom scoring function would need to access variables that are not in the ...
damsc69's user avatar
0 votes
1 answer
311 views

How to make one class classifier to predict probability of belonging to this class?

I have a dataset where each line corresponds to the onset of some event A and features here are some parameters that were fixed at this event. It is necessary to build a model that will take the ...
Ilya Busov's user avatar
0 votes
0 answers
29 views

Does it make sense to perform PCA on dataset after SVD first?

I have a data set of size (4700, 10000). First I performed SVD on this data and obtained 100 SVD components, so my data set is now (4700, 100). Then I performed PCA on such reduced data and obtained 4 ...
hemanta's user avatar
  • 1,450
2 votes
0 answers
35 views

How to find the Nearest Neighbor in sentences (names)?

I have a Table like this one bellow: <table><tbody><tr><th>CHILD </th><th>FATHER </th><th>MOTHER</th></tr><tr><td>Jhon ...
AlissonL's user avatar
2 votes
1 answer
74 views

Machine Learning - Overfitting The Dataset On Purpose

I learned Machine Learning recently, and I'm developing a Tic Tac Toe engine that predicts the best move in a given Tic Tac Toe position (or board state) as my first project. I used brute force to ...
Hatchi Roku's user avatar
4 votes
0 answers
801 views

What label do you assign an object that is both occluded and truncated?

Assume you have an image as shown below and you wish to label each object in the frame. How would you classify the blue prism, for example? It is truncated by the green sphere and occluded by the red ...
eurieka's user avatar
  • 181
2 votes
1 answer
5k views

Need dataset for bank transaction

I want to make graph using bank transaction dataset between credit vs debit. Amount debited and credited but not getting proper dataset! Can anyone provide me dataset for the same?
S Rathi's user avatar
  • 75
0 votes
2 answers
1k views

How to fix 'ValueError: Found input variables with inconsistent numbers of samples: [32979, 21602]'?

I am making a Logistic Regression model to do sentiment analysis. This is the problem - ValueError: Found input variables with inconsistent numbers of samples: [32979, 21602] This occurs when I try to ...
Deb Prakash Chatterjee's user avatar
1 vote
2 answers
3k views

how to view tf-idf score against each word

I was trying to know the tf-idf scores of each word in my document. However, it only returns values in the matrix but I see a specific type of representation of tf-idf scores against each word. I ...
shibangi barua's user avatar
6 votes
1 answer
3k views

How do I fetch the names of the classes scanned by .flow_from_directory function of ImageDataGenerator in Keras?

I want to make a user friendly GUI image classifier where the user would just need to point to the directory of the data set to get the model trained and then they can give any image to the program ...
Neeraj Kumar's user avatar
0 votes
0 answers
179 views

OpenCV doesn't recognize correctly using hog and svm

I'm trying to implement a mechanism to detect the free parking spaces. I have some images for test. I cropped some images from them, with the size 45x90 for both positive and negative images. Using ...
Sirbu Laurentiu's user avatar
1 vote
0 answers
928 views

High val_acc, and low val_loss, still wrong predictions with Keras

I have a set of 300.000+ images, with 38 categories. When I train the images I have a low val_loss and high val_acc, but when I try to predict one of the images (from the training set even), it will ...
Dennis Ponne's user avatar
3 votes
1 answer
2k views

Why is XGBoost fit slow, even with very small dataset?

As a complete newbie to Python machine learning, I'm trying to train an XGBoost model to predict iris dataset (https://www.kaggle.com/uciml/iris). I'm currently focusing on XGBoost, trying to gain ...
Mattiag's user avatar
  • 118
3 votes
2 answers
10k views

why we use kmeans.fit function in kmeans clustering method?

I am using kmeans clustering technique from a video but i do not understand why we use .fit method in kmeans clustering? kmeans = KMeans(n_clusters=5, random_state=0) kmeans.fit(X) //why we use this ...
Khan Hasnat's user avatar
1 vote
1 answer
2k views

Which layer of VGG19 should I use to extract feature

Now, I want feature of image to compute their similarity. We can get feature using pre-trained VGG19 model in tensorflow easily. But VGG19 model has many layers, and I don't know which layer should I ...
riya-kondo's user avatar
1 vote
0 answers
34 views

Applying PCA as a preprocessing step

Is it a good idea to apply Principal Components Analysis as a preprocessing step in difficult image classification tasks? It might be expensive I think, but I want to know if it affects classification ...
Mercury's user avatar
  • 3,477
1 vote
1 answer
79 views

ValueError: Error when checking input: expected cu_dnnlstm_22_input to have 3 dimensions, but got array with shape (2101, 17)

I am new to machine learning. I am having trouble getting my data into my network. This is the error that I am receiving: ValueError: Error when checking input: expected cu_dnnlstm_22_input to have ...
Ryan's user avatar
  • 31
0 votes
1 answer
1k views

How can I properly input features with multiple values in machine learning using models for classification?

I am reading multiple csv files and loading their information into pandas dataframe. I am trying to classify each file as being label 0 or label 1 from the target column, and each file has features ...
BeginnerMLCoder's user avatar
1 vote
1 answer
196 views

Having trouble implementing a vectorized + regularized version of logistic regressions gradient descent

So the formula looks like this And my implementation looks like this grad[0] = ((utils.sigmoid(X.dot(theta))-y).dot(X[:,0])).sum() grad[1:] = ((utils.sigmoid(X.dot(theta))-y).dot(X[:,1:])).sum() ...
Hello Mellow's user avatar
0 votes
1 answer
231 views

Component meaning of ranger.forest

I'm working with ranger, a fast implementation of Random Forests. The problem is I have no idea how to interpret the $forest component of the result. The document simply says forest: Saved forest (...
nalzok's user avatar
  • 15.6k
0 votes
1 answer
574 views

Best way to encode categorical data(URLs) in large dataset in Machine Learning?

I have a large dataset where one of the feature is categorical(nominal) named URL which conatins different URLs. For example, www.google.com, www.facebook.com, www.youtube.com, www.yahoo.com, www....
Mustafa Bandukwala's user avatar
3 votes
8 answers
10k views

How to fix numpy TypeError: unsupported operand type(s) for -: 'str' and 'str'

I have been trying to implement the polynomial regression model in python on spyder IDE , everything works good and at the end when I try to add the arrange function from numpy it gives me the ...
haroon khan's user avatar
4 votes
2 answers
2k views

Is there a way to use decision trees with categorical variables without one-hot encoding?

I have a dataset with 200+ categorical variables (non-ordinal) and just a few continuous variables. I have tried to use one-hot encoding but that increases the dimensions by a lot and results in a ...
welo121's user avatar
  • 47
0 votes
1 answer
898 views

Clustering on categorical data in ml.net

I am struggling with clustering of categorical data in ML.NET. var predictor = mlContext.Model.CreatePredictionEngine(model) line fails with exception "System.InvalidOperationException: '...
Sergiy Kostenko's user avatar
1 vote
1 answer
192 views

Feature selection/extraction in an ANN model for regression

I am trying to fit an ANN model for regression with 15 input parameters. Some of these parameters are related to each other and the relationship is not linear. Say, one of the input parameters can be ...
chink's user avatar
  • 1,555
24 votes
1 answer
12k views

Difference between OpenAI Gym environments 'CartPole-v0' and 'CartPole-v1'

I can't find an exact description of the differences between the OpenAI Gym environments 'CartPole-v0' and 'CartPole-v1'. Both environments have seperate official websites dedicated to them at (see 1 ...
Paul Pauls's user avatar
1 vote
1 answer
442 views

Stock prediction + news sentiment with SVM in R?

I would like to predict the stock prices and news sentiment score together with SVM in R, in order to see whether news have an impact on stock price and their prediction. I read that support vector ...
james_ricky's user avatar
-2 votes
1 answer
646 views

NA/NaN/Inf in foreign function call (arg 6) in KNN Algorithm

I am trying to predict category based on knn alog. but I don't know why I am getting above error like "NA/NaN/Inf in foreign function call (arg 6)" I already removed NA values using na.omit(A) ...
Juned Ansari's user avatar
  • 5,185

1
513 514
515
516 517
1117