Category "python"

How to set AUC as scoring method while searching for hyperparameters?

I want to perform a random search, in classification problem, where the scoring method will be chosen as AUC instead of accuracy score. Have a look at my code f

AssertionError: Duplicate registrations for type 'experimentalOptimizer' when converting ssd model to tflite format

I was trying to convert my trained ssd model to tflite format. But I always face to this below error. error I faced Here is my code: //-------------------------

Why does Tensorflow Function perform retracing for different integer inputs to the function?

I am following the Tensorflow guide on Functions here, and based on my understanding, TF will trace and create one graph for each call to a function with a dist

Crop colour image according to OTSU threshold

I have a colour image which I have sucessfully applied the OTSU thresholding method on its greyscale form to obtain the outline of the biscuit: Original Colour

resampling raises ValueError: Values falls before first bin

I don't understand when and why this error is raised. From my understanding, resample should create as many bins as needed in order to bin all the timestamps of

Upload large csv file to cloud storage using Python

Hi I am trying to upload a large csv file but I am getting the below error: HTTPSConnectionPool(host='storage.googleapis.com', port=443): Max retries exceeded w

Install talib on docker

FROM python:3 USER root RUN apt-get update RUN apt-get -y install locales && \ localedef -f UTF-8 -i ja_JP ja_JP.UTF-8 RUN wget http://prdownloads

Tkinter closing immediatly after plot

I am creating an interface using Tkinter to plot signals from a database. I am using Python 3.8 and PyCharm 2021.2.1. The interface is supposed to open another

How do I install `python39-rpm-macros` for Fedora 35?

How do I select the Python version when building a RPM from a .spec file on Fedora 35? The CentOS/RHEL documentation says Configure the particular Python 3 ver

DQN doesn't learn

I'm trying to implement a DQN in CarPole environment using Pytorch. I don't know why, but no matter how long I've tried to train the agent, even though the scor

How to import other Python files

I have this file, abc.py: def asb(): print("Hello, ") def xyz(): print("World!") In my main.py file, from abc import asb from abc import xyz I want

Need help printing execution details when I manually place a trade using IBKR API (Interactive Brokers)

I am trying to print execution details when an order is filled. I got this working in code using the execDetails method, however it only prints the execution de

Batch Kronecker product of tensors

I have two tensors that are batches of matrices: x = torch.randn(100,10,10) y = torch.randn(100,2,2) I want to parallelize the kronecker on each matrix, not d

Assigning Topic Probabilities to each Document in Anchored Topic Model using Python

I was interested in to run Anchored Topic Model (a.k.a. Corex Topic Model) and successfully ran it using my data set. But when I assigned topic probabilities to

django don't show form in template

django dont show my form in my template where is the problem? forms.py from django import forms class QuestionForm(forms.Form): massage = forms.CharField(w

Telegram Message Listener - RuntimeError: Event Loop is closed

I want to receive new messages from Telegram via a python script. I filter the message and then put out the result. But there is something wrong with the loop s

Kronecker product of 3 matrices using Python

Suppose that we have 2 2X2 numpy arrays: X=np.array([[0,1],[1,0]]) and I=np.array([[1,0],[0,1]]) Consider the Kronecker product XX=X^X where I have let the s

Setting up boundary conditions to solve PDEs using method of lines

Objective: To add boundary/initial conditions (BCs/ICs) to a system of ODEs I have used the method of lines to convert a system of PDEs into a system of ODEs. T

How to append two cell values located in the same dataframe column?

Disclosure Source 35 36 37 38 39 202-1 GRI 202: Market Presence 40 2016 41 42 43 The Source Co

Select a column without "losing" a dimension

Suppose I execute the following code W = tf.random.uniform(shape = (100,1), minval = 0, maxval = 1) Z = tf.random.uniform(shape = (100,1), minval = 0, maxval =