New answers tagged python
0
votes
Find missing object(s) in image with a priori knowledge about the missing object(s) (w.r.t base image)
To use any sort of learning algorithm, you need to turn this into a learning problem. One option is to turn this into a classification problem. There may be better learning formulations to this ...
- 1
0
votes
Confusion Matrix - Get Items FP/FN/TP/TN - Python
Classification Task: Anamoly detection; (y=1 -> anamoly, y=0 -> not an anamoly)
𝑡𝑝 is the number of true positives: the ground truth label says it’s an anomaly and our algorithm correctly ...
- 101
0
votes
Is it possible to modify YOLOv8 to use it as a feature extractor for other tasks?
just some idea recommendation for wrapper:
...
0
votes
Is there any solution for modified t-test in python for spatial data?
You can use the following which is a port of the implementation from R's SpatialPack:
https://github.com/sadaszewski/modified-ttest
0
votes
Accepted
Python Tensorflow - Predict human vs horses images always same value
I solved the issue. I was dividing by 255 both the training and validation generators, but not the images that I was loading from the computer.
I changed this line
...
0
votes
How to order a python dataframe by adding the row values?
Another way would be to take the sum, sort it and then use the index to reorder the original dataframe
df.loc[df.sum(axis=1).sort_values().index]
- 101
0
votes
How to automatically save images from colab to gdrive in seperate folders whose name are as same as the labels of the respective images?
It looks like you have already mounted your google drive. The savefig function can take the path and image name as input argument.
...
0
votes
Sparse matrix after vectorization giving size = 1
You can convert the train_x to a list and pass that to your tfidf.fit_transform.
Approach 1
The updated code is:
...
0
votes
Reference implementation of q-learning in Python
Here are three slightly different implementations of Q-learning in Python:
From Shangtong Zhang's implementation of Sutton & Barto's book Reinforcement Learning: An Introduction (2nd Edition): ...
- 1
0
votes
Filling na values with condition from other column
You can use df.apply to make a series containing the substitution values, then use df.fillna with the new series. Here's an ...
- 2,574
1
vote
Accepted
Are some weight gradients equal?
The problem was that $\frac{∂y'}{∂w_{111}} \neq \frac{∂z_{a1}}{∂w_{111}}$, but $\frac{∂y'}{∂w_{111}} = \frac{∂z_{b}}{∂w_{111}}$, where $z_b$ is the sum of the products of all the z-vectors of the last ...
- 148
0
votes
How to add noise to supervised (binary-classifier)?
Based on the comments and responses, it is unclear if noise is to be added to the features (some of which are categorical) or to the output preds.
In case it is the former, I would strongly advice ...
- 808
0
votes
Difficulty in Coding research papers
I suggest you try with papers that have been already reproduced by others. You may find good candidates among the past editions of the ICLR reproducibility challenge.
- 19.3k
0
votes
NLP to calculate similarity ratio between sentences of max 5-6 words
For calculating similarity scores between 2 short sentences "Fuzz" would work good.
String Similarity
The simplest way to compare two strings is with a measurement of edit distance.
For ...
1
vote
Why custom training a Spacy model runs only the Initializing pipeline but the Training pipeline is not running?
Same issue here.
My output ends at
[INFO] Added vectors: en_core_web_lg
And then the cell stops executing.
I do not even get Finished initializing or anything. ...
- 11
1
vote
Accepted
How to split a single feature vector into a layer of 2 neurons
Your idea sounds good to me. By initializing the split variable with a random number between 0 and 1, and then splitting each sample into two neurons using that split value, you'll be randomly ...
1
vote
Accepted
Silhouette score for optimal k value (k prototype in python)
May be it's too late, but I found a good resource for your question - silhouette score for k-prototype
0
votes
99% accuracy in train and 96% in test is too much overfitting?
A significantly higher accuracy on the training set than the test set is generally an indication of overfitting. In your case, the difference in accuracy between the train and test sets is relatively ...
- 2,371
0
votes
Python 3.11 | How to have Python collect the values of a certain cell in a readable Excel file IF the cell's row has a certain value in another column
You can use groupby for this:
...
- 523
1
vote
Accepted
How to read colon in python?
x = a[1, :] > a[0, :] takes the value array([False, True, True]) as it finds columns for which, the values in the second ...
- 449
0
votes
Accepted
Force network to weigh specific variables during learning
After gaining better understanding of the problem at hand, here is my solution to deep encode my species categories so that the network can learn from them.
...
- 53
1
vote
How to Manipulate a Dataset
From this dataset, you should prepare new variables namely, X and y; where X = feature matrix...
- 111
0
votes
How to implement SVM from scratch?
If you consider the Lagrarian expression acting as your loss function for svm. Then use optimization ml techniques to find the best parameter.
Here your alpha is the parameter. So, find the best value ...
1
vote
Accepted
Group rows partially [Python] [Pandas]
You can do this by making use of shift to create different groups based on consecutive values of the states column, after which ...
- 6,862
0
votes
Group rows partially [Python] [Pandas]
It's not the problem about grouping the elements, it is the problem related to consecutive elements. The approach should be of using consecutive iterations.
Here I've saved all the results in a list. ...
-2
votes
ValueError: Input contains NaN, infinity or a value too large for dtype('float32')
Once Check X and y types. Both should be of the same kind.
- 1
Top 50 recent answers are included
Related Tags
python × 6588machine-learning × 1819
scikit-learn × 996
pandas × 860
keras × 742
tensorflow × 574
deep-learning × 569
neural-network × 486
classification × 422
nlp × 420
time-series × 337
regression × 237
clustering × 237
dataframe × 212
numpy × 211
dataset × 184
lstm × 170
cnn × 161
r × 160
random-forest × 159
visualization × 158
data-cleaning × 156
pytorch × 152
data-science-model × 139
statistics × 138