All Questions
133 questions
1
vote
2
answers
166
views
Implementation of Perceptron algorithm, but not efficent when I run it
When the sample size is set to 10, the average number of iterations until convergence should be around 15. However, when implementing the algorithm in my code, it takes approximately 225(or more!) ...
0
votes
1
answer
50
views
Python 3 | ValueError: shapes (2040,21) and (2040,2040) not aligned: 21 (dim 1) != 2040 (dim 0)
I am working on a Neural Language Model with the below code, and encountered this error:
Traceback (most recent call last):
File "main.py", line 99, in <module>
neural_network....
1
vote
1
answer
1k
views
How to calculate Sensitivity, specificity and pos predictivity for each class in multi class classficaition
I have checked all SO question which generate confusion matrix and calculate TP, TN, FP, FN.
Scikit-learn: How to obtain True Positive, True Negative, False Positive and False Negative
Mainly it usage
...
0
votes
1
answer
156
views
Threshold does not work on numpy array for accuracy metric
I am trying to implement logistic regression from scratch using numpy. I wrote a class with the following methods to implement logistic regression for a binary classification problem and to score it ...
0
votes
1
answer
2k
views
'>=' not supported between instances of 'list' and 'float' for numpy where
I am new to coding and I'm working on my college project on which I need to make a bio-inspired algorithm teacher learning-based Algorithm, but here is some error is coming
here is my tlbo code
class ...
-1
votes
1
answer
234
views
The truth value of an array with more than one element is ambiguous error?
I am running cross validation on dataset and getting
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
error at the beginning of second ...
0
votes
1
answer
149
views
PyTable table split
I have a PyTable table like the following format:
/neg/data.cols (Cols), 5 columns
data (Column(8909, 256, 256), ('<f4', (256, 256)))
filename (Column(8909,), |S100)
id (Column(8909,), uint32)...
1
vote
1
answer
286
views
ValueError: Shape of passed values is (1027, 8), indices imply (1030, 8)
import numpy as np
import pandas as pd
df = pd.read_csv('concrete_data.csv', delimiter=',', sep=r', ')
X_raw = df.drop(['concrete_compressive_strength'], axis=1)
y_raw = df['...
-1
votes
1
answer
141
views
ML model that finds relationships across the rows
I have extracted a ball x,y coordinates from tennis match video
P.S. x,y coordinates are in the following format
coords2 = [(985.0, 325.0), (985.0, 325.0), (985.0, 325.0), (985.0, 325.0), (985.0, 325....
0
votes
2
answers
58
views
Matrix substraction in Python error or confusion
I have this code to help understand the problem
hypotesisResult = (hypotesis(dataset, theta_init))
print(dataset.T.shape)
print(hypotesisResult.shape)
print(y.shape)
print((hypotesisResult - y).shape)
...
0
votes
1
answer
10k
views
Cannot convert a symbolic Tensor (lstm/strided_slice:0) to a numpy array
I hope someone answer the below error code, I am working on supervised ML and I got an error.
My library details (As I downgraded both the above package to current package details mentioned above many ...
0
votes
1
answer
284
views
Difference between np.array(tensor_list) and (tensor).numpy()
I defined a function which returns embeddings of n dimensions for a list of strings.
The tensorflow embeddings which is a tensor are accessed by
(tensor_embeddings).numpy().tolist[0]
I would like to ...
0
votes
1
answer
88
views
How do I make a condition to execute a command once an element of numPy array achieves a certain value?
I'm creating a machine-learning program to recognize images that are shown on webcam. I've used Google Teachable Machine to generate the model and it works fine.
The matter I'm having issues with is ...
4
votes
1
answer
2k
views
How to convert a video to a numpy array? [closed]
How can I convert a video to a multiple of numpy arrays or a single one to use it for machine learning . I only found ways to do it on images.
0
votes
1
answer
726
views
I keep getting "TypeError: only integer scalar arrays can be converted to a scalar index" while using custom-defined metric in KNeighborsClassifier
I am using a custom-defined metric in SKlearn's KNeighborsClassifier. Here's my code:
def chi_squared(x,y):
return np.divide(np.square(np.subtract(x,y)), np.sum(x,y))
Above function implementation of ...