Category "python"

Model accuracy not improving in CNN for image classification

I am using ResNext architecture for classification. the training dataset contains approximately 31000 images distributed among 61 classes. And validation datase

ImportError: "flask_sqlalchemy" could not be resolved

i'm unable to import flask_sqlalchemy even after installing flask-sqlachemy from flask import Flask, render_template from flask_sqlalchemy import SQLAlchemy #

Is it possible to average the output of multiple classification models using pipeline in sklearn?

As an example, suppose there is a random forest and a logistic regression model that accept the same input data, and I want the inference result to be the avera

Confusion in Python Pyomo Components (Parameter and Variable)

I am learning Pyomo Abstract Modeling from a Book. I have an example that has an objective functionEquation is here to minimize the cost of establishing a wareh

AttributeError: 'NoneType' object has no attribute '_with_attr' - Python running tests with pytest

My environment is : Python 3.9.9 Pytest 6.2.5 Brownie 1.17.1 I'm working on the test_fund_me.py from Patrick Collins' Smart Contract tutorial on Youtube; at thi

Normal-gamma distribution in Python

Is there an implementation of the Normal-Gamma distribution for Python? I have looked over the internet, including scipy, and could not find it.

Why do we use __init__ in Python classes?

I am having trouble understanding the Initialization of classes. What's the point of them and how do we know what to include in them? Does writing in classes r

AttributeError: 'int' object has no attribute 'split' pandas

Please, I know there are several issues related to this error of mine, but I'm learning, I don't understand almost anything, so please, if it's not asking too m

`generator` yielded an element of shape (8, 0) where an element of shape (None,) was expected. Traceback (most recent call last):

I was training a network and I decided to add more data for training. my data set is selected from another data but both have (460,620,3) and Uint8 type. but wh

How to check if an element is not displayed in selenium python

How could I check to see if an element is not displayed. I would think it looks something like this. if(element.is_not_displayed): doSomething() else do

Python: install investpy in pycharm on anaconda 3 (python 3.6) interpreter

Based on my question here I want to install the package investpy into pycharm with interpreter anaconda (python 3.6). For some reason the installation itself is

How to override python package version constraint during pip install

We have an organization level constraint file to specify what versions of python packages can be installed. This is configured in pip.conf For one of the projec

Ideally maintaining the same structure, how can I parameterize this batching function to control the batch sizes?

I have hard-coded the following algorithm to achieve a task I am wishing to accomplish, in this case returning 5 consecutive values at a time for each time step

Got Error while installing mysqlclient in django project on cPanel

Requirements.txt contains: asgiref==3.4.1 Django==3.2.9 django-isbn-field==0.5.3 mysql-connector-python mysqlclient phonenumberslite==8.12.42 Pillow==9.0.1 pyth

Issue fitting a SGD Classifier

I'm following the book Hands-on Machichine Learning by Aurelien Geron, more specifically, where it begins to go into classifiers. I'm following the code from th

How to loop through folders in Azure Blob Containers

I have the following code which is written in Visual Studio Code. Now I want to run this in Azure Databricks. I have uploaded the entire folder to my Azure Blob

Generate a GMM Dataset by using multivariate_normal from scipy.stats

How can I use from scipy.stats import multivariate_normal to generate data? In specific, I want to create a GMM data that contains 3 columns (features) and a la

Python in C DLL

I just created a DLL in C with Python in it. When I export my function with python functions in it, I can't call it in my Python code But when I export a classi

How can I filter rows out if their start date is within 90 days from today and place them out until the 1st of the following month in R?

I am having difficulty finding the words to describe what I am searching for but will try. I would like to solve the following using R or Python (but preferably

How to render user profile (actual image) instead of filename in a Django form which basically update user-account

I am following a Django course on youtube, and I need a small change in my Django form. The form looks like: Rendering the form fields in 'edit-user.html' temp