People who code: we want your input. Take the Survey

Questions tagged [python]

Use for data science questions related to the programming language Python. Not intended for general coding questions (-> stackoverflow).

Filter by
Sorted by
Tagged with
0
votes
0answers
4 views

Influence of label names on the classfierier perfromance

I am building a text classifier, the labels in my training data are not just short names like "Dog" or "Cat", they are more of lengthy sentences that range from 2 words to around ...
0
votes
0answers
3 views

How to apply gaussian kernel in relevance vector regressor with prml package implemented by ctgk

When looking at the ctgk's example of RVM for regression, I'm confused about how to apply guassian kernel in relevance vector regressor implemented in ctgk's prml package. According to ctgk's RBF ...
0
votes
0answers
8 views

When is SGD involved in a neural network?

After reading this snippet about neural networks and sgd in a federated learning setting, I was trying to implement the code. However, I'm confused as to where is stochastic gradient descent involved ...
0
votes
1answer
11 views

What type of visualization is this and what are my options to produce something like it?

I am looking to reproduce the bottom part of the visualization below. What is this type of visualization called? What are my options to reproduce it? Preferably using Python or R, but I'm open to ...
0
votes
1answer
11 views

AttributeError: 'DataFrame' object has no attribute 'data' [closed]

I am working with the iris dataset and I got the following error: AttributeError: 'DataFrame' object has no attribute 'data'. I'm working with iris dataset I would ...
0
votes
0answers
9 views

Call keras model in a C# desktop Application

I have a keras model for image classification saved in a .h5 file or Json file, and then I created a C# desktop app ( in visual studio 2019) which contains two buttons one to load an image and an ...
0
votes
0answers
12 views

Python 3.9 - EEG Signal Classification for P300 Speller BCI - Validation loss not reducing below 40%

I am working with a classic P300 Speller BCI. I am trying to create a classification model for classifying EEG signal epochs into two categories, "Target" and "Non-Target". The ...
0
votes
0answers
17 views

Why am I getting good validation scores, but poor test scores in Kaggle competition

I am participating in a Kaggle multiclass classification competition. The submissions will be scored based on the 'logloss' score. I am using Keras and Scikit libraries and a deep learning network ...
1
vote
0answers
11 views

Clustering on binary data

I am working on clustering on binary data which has 25 features, sample Feature 1 Feature 2 Feature 3 ...... Feature 25 1 1 0 0 011101 1 2 0 1 0 010011 0 3 1 0 1 101001 1 and I have used the ...
0
votes
1answer
8 views

How can I processing subgroup data [closed]

I am new to the Python, I have a data processing questions, I have a data frame like this: So as you could see there are 4 groups based on the group ID. What I want is in each group, in the last ...
0
votes
0answers
4 views

Values for data frame are all shifted to the right [closed]

I am importing the wine data csv and trying to look at the data frame. However, when I put the code in, all the values are shifted to the right. I am wondering what I'm doing wrong!
0
votes
1answer
17 views

How to convert a dataframe into a single dictionary that is not nested?

I have a dataframe as below: ...
0
votes
1answer
30 views

How should I implement machine learning for multi-tenant website?

The company I work for has a website for personal use to track leads and opportunities. I implemented a linear regression algorithm to predict a score for opportunities which is trained on the ...
0
votes
0answers
10 views

Why does model CNN with high accuracy but give low prediction on handwriting input images?

I'm trying to train the CNN model with the MNIST dataset expand with my own images handwriting, so I have merged them together, ...
0
votes
0answers
20 views

How to convert my OpenCV project to web application?

I've created an OpenCV project using Python in Jupyter Notebook. I have basic knowledge of HTML/CSS and Javascript, however I'm feeling pretty overwhelmed by the amount of data online regarding AI web-...
0
votes
0answers
15 views

How to adjust the unadjusted charts in Pandas

I would like to adjust the unadjusted charts in Pandas. Suppose I have a data frame of the price of a stock symbol that there is a price gap between two candlesticks due to a capital increase. Sites ...
1
vote
1answer
10 views

An universal sentence encoder for a specific language?

I am making a model that uses encoded articles (multiple sentences). I have found the Universal Sentence Encoder by Tensorflow, but it says it is only for English. Specifically, I am looking for an ...
0
votes
0answers
15 views

Is it right method to remove instances that are hard to predict before train test split?

In a binary classification problem, I have a slightly unbalanced medical dataset with class distribution: 0:5600, 1:1500 0 without a problem and 1 with a problem. I tried many pipelines, automls, and ...
2
votes
2answers
25 views

Generation of medical institution names: training corpora?

My question is quite similar to this one: Generation of institution names. I need to be able to produce 'fake' names of medical institutions, specifically to create data for unit tests. Unfortunately, ...
0
votes
0answers
10 views

encoding 100,000s of sparse, binary features at each time step of RNN

I’m looking for some pointers on efficiency. I have potentially 100,000s of binary variables that i wish to encode in each time step of an RNN for binary classification of the entire sequence, but I ...
0
votes
0answers
6 views

Tensorflow Training Crashing

I have created a GCP VM with Tesla K80 GPU attached to it. I have installed Nvidia 465 drivers for Ubuntu 20.04 along with Cuda 11. I am trying to use tensorflow on the GCP machine and each time when ...
1
vote
0answers
10 views

Data Pipeline Best Practices

I am looking more for concepts or pointed in the right direction for best practices for a project I am working on. I am currently playing around with Luigi for a data pipeline. I followed the tutorial ...
1
vote
0answers
33 views

Implementing a weighted support vector machine in python

I have the following problem. The minimization problem of the SVM that I want to solve is: $$ \min_{w, b} \frac{1}{2}w^{T}w + \sum^{m}_{i=1}C_{i}xi_{i} $$ Subject to: $$ y_{i}(w^{T}x_{i} - b) \geq 1 - ...
1
vote
0answers
9 views

find a tab or sub section on any website [closed]

Is it somehow possible to use web scraping with scrapy or BeautifulSoup to check if a website has a particular section, sub section or tab or not? For example, here https://www.christiani.de/ on of ...
0
votes
0answers
8 views

Pymc3 - Mean changing for every data point

I have the following model im pymc3. ...
0
votes
0answers
19 views

Data preprocessing - Time Series data resets its values - Detection & Correction

1. Summarize the problem I currently trying to work with time series data from sensors which has some problems regarding resetting it values. For example some cumulative values gets reset and don't ...
0
votes
0answers
15 views

snake reinfocement learning does not learn

I’m new to reinf learning, and I’m trying this code, but the snake always goes right without learning, I can’t find the bug, could you help me? THE SNAKE CLASS ...
1
vote
1answer
24 views

CNN: visualize a model using its description

i created a Resnet model, which i want to show in a presentation, but i don't know how to visualize what i have done? Is there a tool or something to get a graphic from the description of my model. ...
0
votes
1answer
28 views

CNN: training accuracy vs. validation accuracy

I just finished training two models, while the one is pretrained and the other trained from scratch and created two diagrams afterward with their data, but as I am very new to machine learning, I don'...
0
votes
2answers
38 views

How do I find pairwise maximum of multiple rows in a column using python?

I have a column with float values. The column has 300 rows. I want to get pairwise max of each row with the row below it. For example: if my column as 2, 25, 1, 24 as row values, I want to fins max of ...
0
votes
1answer
7 views

Why is the type of pytorch MSELoss class 'type'?

I tried the following code with Pytorch MSELoss class(torch.nn.MSELoss)- type(MSELoss) the output of this was 'type'. Can you please explain to me why that is ...
0
votes
0answers
11 views

Integrate image classification models into a web application which uses C#

I created two image classificatoin models using Python (CNN) to identify car parts, and now I want to integrate them into the website of the company, they have a web application which uses C#. Does ...
0
votes
1answer
40 views

Is there an automatic way to see if 2 data columns represent the same kind of information?

I have 2 datasets that represent overlapping information. For example: **Dataset 1 : ** | ID | Reg Date | Category | |------|---------| --------| | P123 | 23/2/2019 | 3 | | P345 | 24/6/...
1
vote
0answers
23 views

How to compare two one hot encoded data frames based on column names?

I have two datasets with shapes (329, 159) and (26,24). Both of them are one-hot encoded. The columns in the smaller dataset are present in the larger dataset. The smaller dataset has scores that I ...
0
votes
0answers
10 views

predicting average time with regression

I have a trip duration dataset that looks like this: I want to use other parameters to predict the waiting time (wait_sec). The waiting time refers to the time the vehicle is stuck in traffic or so. ...
0
votes
0answers
19 views

Input 0 of layer bidirectional_14 is incompatible with the layer: expected ndim=3, found ndim=4. Full shape received: (None, 120, 1024, 1024)

I am trying for named entity recognition and here are the details of my x_train and x_test: Shape X_train: (3555, 120, 1024) Shape X_test: (887, 120, 1024) ...
0
votes
0answers
12 views

Best way to generate random ocean depths on grid in Python?

I'm trying to create a realistic ocean on a grid of 69 x 25 grid that's stored within a list. I also would like to store depths of water as the value in those lists to simulate a body of water like ...
0
votes
0answers
11 views

Reinforcement Learning End Effector Moving To Camera and Stops Learning

I am working on training a 3 finger Jaw gripper. The environment I setup is this: UR10 3 finger robot Pybullet for Simulation Stable baselines and DDPG Observation space is RGB image stacked with ...
0
votes
0answers
9 views

Generate UML diagrams after analyzing given text requirement using NLP

I want to generate UML diagrams (use-case,activity,sequence,class) from a given text requirement that look like this. And I want to use python NLP library such as Spacy to identify actors, actions, ...
0
votes
0answers
14 views

Estimating the (normal?) distribution of the grayscale values of a region in camera footage

The problem: Given a small ($25\times25$) region on a $1080$p image extracted from camera footage of a railway system, I am trying to detect whether there is a train present or not. I proceed to take ...
-1
votes
0answers
8 views

Object detection model not showing bounding box on images [closed]

I have trained my detection model and I want to see prediction but I get the usual image without boxes(but the image in Tensor Board looks good) Link to my code : Link
-2
votes
0answers
16 views

How to reformat the python code according to pep 8? [closed]

I want to reformat my python code according to pep 8 on colab notebook . Example if I write some variable in notebook as shown below. ...
1
vote
2answers
37 views

Correlation/Pattern Recognition in Lists

I am looking for algorithms to find pattern or more precise correlations in lists compared to an Output. Let us assume I have a Database like this: Input: [A,C,D,E...], Output: Positive Input: [A,B,C,...
3
votes
0answers
19 views

Struggling to understand/implement Transformer Decoder

I'm struggling to understand the decoder in a Transformer model, specifically with regards to some aspects of its architecture as well as how it actually handles the data during training. What I have ...
0
votes
0answers
10 views

Interpreting LSTM Univariate Time Series model

I have built a Deep Learning Sequential Model using LSTM to forecast a variable. How to interpret this model? I want to know which day/hour/season is driving the predictions.
0
votes
0answers
7 views

Is there any guide line to set hidden_layer_sizes values for MLPClassifier to make get a better accuracy value?

I am wondering if there is any guidance about setting the layer numbers and node number for MLPClassifier setting the 'hidden_layer_sizes' parameter. Evaluating all the combination in a loop is the ...
0
votes
0answers
25 views

Automate downloading datasets via Colab

My desktop computer recently broke, and I'm currently working on a small laptop with barely 500mb of space left. I need to download about 100gb of files from the DFAUST dataset. I was wondering if ...
0
votes
0answers
15 views

Tertiary regression trees

Is there a prepackaged python or R set of functions which have ternary (three branches) decision trees? All of the out of the boxes I can find are for binary decision trees. A wiki can be found here.
0
votes
0answers
20 views

Autoencoder: good loss values while fitting, but the actual performance is bad

I'm implementing a 1D convolutional autoencoder to reduce the dimensionality of an array. Here is my architecture: ...
0
votes
0answers
12 views

list index out of range (animation pygame RL) [closed]

I am trying a simulation of a similar game snake rl, when I start the simulations immediately after a while, generates me error "list index out of range " and I don’t understand why it gives ...

1
2 3 4 5
109