Questions tagged [python]

Use for data science questions related to the programming language Python. Not intended for general coding questions (which should be asked on Stack Overflow).

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

Inquiry on Point Cloud Processing for Robot Navigation Simulation

I am working on a project aimed at utilizing point clouds for creating a simulated environment for robot navigation. The process I am employing is delineated below, and I would greatly appreciate your ...
Wednesday's user avatar
0 votes
0 answers
36 views

Avoid killing learnable parameters when transforming input into intervals

I'm trying to make a model using Pytorch which is training and transforming a set of coordinates, and then is downsampled using the model below. However, when I'm making the input coordinates into ...
An alien's user avatar
0 votes
1 answer
29 views

For some reason getting an odd error when hyper tuning my model

I was hoping to hypertune my decisiontree model , however I keep running into this error: TypeError: DecisionTreeClassifier() got an unexpected keyword argument 'criterion' here what I tried: ...
John Adams's user avatar
1 vote
2 answers
179 views

Why do we need hyperparameter tuning in Scikit learn? Doesn't sk learn models by default give best model?

When I have the option to build a classifier like this directly clf = RandomForestClassifier() why do we perform tuning by restricting the parameters like this <...
Hola's user avatar
  • 13
0 votes
0 answers
13 views

Databricks Extracting features out of Big Files like Step and PDF

So i dont know if this is the right community to ask this question, but lets see. So we are using databricks in our company and we extract Features out of big binary files like PDF and STEP. We trying ...
muhmuhhum's user avatar
2 votes
0 answers
45 views

Detecting upside down numbers in the MNIST dataset

I'm trying to predict numbers using the MNIST dataset. Since I don't know whether the numbers that I'm trying to predict are rotated (most of the time upside down, but can also be 90 or 270 degrees), ...
user1195883's user avatar
0 votes
0 answers
26 views

divide a large group of people into subgroups based on two parameter

note in advance: I'm new to data-analysis and although my major civil engineering taught me about statistics, I did not apply it the way I would have encountered in real life, or in this field of work....
Abdulrahman Sheikho's user avatar
0 votes
0 answers
30 views

Calculate the curve of a list and apply that to calculate the values of a larger list

I have a list of ~125 sorted ascending values and I am converting those to percentages of total so that they add up to 100% (shortened example would be: 0%, 0%, 15%, 15%, 30%, 40% with the total of ...
Disz's user avatar
  • 1
1 vote
1 answer
57 views

Bivariate Outlier Detection

I'm trying to find outliers in a bivariate data set. One of the input variables is the amount of time that it takes a user to do a task in our system in seconds (rounded to integer). Most interactions ...
skustes's user avatar
  • 13
0 votes
1 answer
36 views

How to assign sample weight for regression problem

I'm trying to model a forecasting problem where I'm trying to forecast for the following month. I am using LightGBM Regressor class for it and it giving me a decent ...
Krishnang K Dalal's user avatar
0 votes
1 answer
26 views

Optimization problem of find a pair of values (x, y) such that they produce an output z

Problem I am trying to create a process that determines the rent and purchase price of a home that gives me a capitalization rate of 0.08 for instance. Background Normally I calculate the ...
Olek's user avatar
  • 11
0 votes
0 answers
28 views

SMOTE-NC not working, Error: Pandas output does not support sparse data

I want to get my SMOTENC to work, but i've been failing successfully ...
user155410's user avatar
0 votes
1 answer
60 views

how to define a linear function WX+b in pytorch?

I am practicing pytorch. I want to define a linear function Y=WX+B for inputs shape as (3,32,32) and output, the same shape i.e. (3, 32, 32). I defined m network as: ...
Ali.A's user avatar
  • 57
0 votes
0 answers
30 views

How to use Bertweet model for topic modeling

The problem is implementation of Bertweet in a topic-modeling project with understandable output like BERTopic, i want to use it on a relatively large (20k tweets) unlabelled dataset to segment it ...
Rossin's user avatar
  • 1
0 votes
0 answers
22 views

Proper metric for measuring the similarity between two images

I want to calculate the similarity between these two images: and These are brain topography maps and colors inside the circles represent the area being activated while watching TV. Thus I am looking ...
tail's user avatar
  • 117
0 votes
0 answers
45 views

K nearest neighbor with varying feature length

I'm trying to build a tool which predicts the elemental composition of some light source using its emission spectrum with the k nearest neighbor algorithm (I'm using the KNeighborsClassifier from ...
oodani's user avatar
  • 1
0 votes
0 answers
44 views

2060 Illegal instruction (core dumped) when importing Tensorflow in Python 3.8.18

I am attempting to run the experiments found here: https://github.com/risingfbk/p4ddle/tree/main/p4-ddos/p4ddle However when I run the line: ./experiment_**.sh I ...
The Radiant's user avatar
0 votes
0 answers
225 views

How to read CSV File into Vector Store

I have a CSV file, and I am using langchain to read it into the vector store FAISS. My question is, since I have a CSV file, is RecursiveTextSplitter required? Put differently, consider the following ...
Karl 17302's user avatar
0 votes
0 answers
15 views

Should I use an intercept even if my regression model's r-squared value reduces by a lot?

I'm using Python to create a good linear regression model and am having trouble getting good results for my r-squared value. A quick rundown of what the data is: – Sales: This dependent variable ...
Python Student's user avatar
1 vote
0 answers
10 views

NameError (solidity, brownie, python)

I'm writing a deploy script in Python (below) to deploy a smart contract using Brownie. When I compile I get an error that MockV3Aggregator is not defined. I have already created a file called ...
auditorchick's user avatar
0 votes
0 answers
57 views

Value Error: One of the dimensions in the output is <= 0 due to downsampling in conv1d_9

i am trying to implement classification model on my dataset, which has 3 columns and 651 rows Displacement Time Labels 0.000245879 0.01 Undamage 0.001954869 0.02 Damage 0.006545664 0.03 Undamage 0....
Shagufta's user avatar
0 votes
0 answers
22 views

Model Performance not improving

I am currently working with a GNN (a Graph attention Model) based model and the main task is to do Graph prediction. My model doesnot improve its performance when I change the number of heads or the ...
Susan's user avatar
  • 1
0 votes
0 answers
30 views

problems trying to install PIP

Ugh I'm so frustrated. I'm trying to install pip for vscode so I can get py-solc-x. I downloaded python (it shows that I'm on python 3.10.12 when i run python --version). But when I run install ...
auditorchick's user avatar
0 votes
0 answers
17 views

RNN model for predicting sequences based on sequences of different lengths with Keras

I have data that are sequences of repeated values of different lengths. The value is categorical and can take values from 1 to 184. I used padded with 0 and masking: ...
meyer's user avatar
  • 1
0 votes
0 answers
7 views

how to convert these string columns so that i can put the data to the regressor

https://drive.google.com/file/d/1yQR1xJvzWd2UGgGQS2bHhdywZEE_Nu0J/view?usp=sharing I have to change the name of the columns: city, batting_team, bowling_team, batsman, non_striker, bowler. These ...
gaurav najpande's user avatar
0 votes
0 answers
45 views

Alternative to ELU and Leaky ReLU?

I was talking with a friend about different activation functions (we are still new to ML). One thing that I didn't like about ELU was the vanishing gradient, and about Leaky ReLU that it's not ...
Nasa's user avatar
  • 1
0 votes
1 answer
26 views

Very basic python question [closed]

I am doing the free interactive learn python tutorial, and I am on the first conditions lesson. The task was to make it so that every statement in the following code resolved true. The code below was ...
auditorchick's user avatar
0 votes
1 answer
60 views

Is this considered a good visualization of clustered data?

I have used sckit-learn to cluster data using K-means (3 clusters). I have an issue with considering the plot as "readable" since clusters are overlapping (even when encircling them) Any ...
SSSOF's user avatar
  • 17
0 votes
0 answers
43 views

how to implement federated transfer learning?

I'm exploring the concept of Federated Learning and Transfer Learning and am interested in combining both to implement Federated Transfer Learning. I understand that Federated Learning allows model ...
Rezuana Haque's user avatar
0 votes
1 answer
184 views

why I got TypeError: linear(): argument 'input' (position 1) must be Tensor, not int in NN?

I am writing a NN in pytorch. I have a list of tensors as input i.e. I created a list Y by appending 1000 tensor vectors(linear tensors) of size 3072. So, each Y[i] is a linear tensor of size 3072. ...
Ali.A's user avatar
  • 57
0 votes
0 answers
17 views

How to define a DataLoader or Loss for a e.g. multivariable functions?

I am trying to write a NN for estimating a f:R^n --> R^m. My problem is how to train network. I mean if I want to define a dataloader, how to attach X \in R^n to its related Y \in R^m ? Because ...
Ali.A's user avatar
  • 57
0 votes
0 answers
50 views

Batch processing for a dictionary of dictionaries Python

I have a very large dictionary of the form vf = {key1:{...}, key2:{...}, key3:{...}, ...}, which is stored as an npz file. Trying to load it at once causes a memory error, so I tried to load it in ...
Andrew's user avatar
  • 103
0 votes
1 answer
59 views

Remove outlier from image array in Python

Could someone please suggest me what would be the best way to remove such huge number of outlier data from the image. The regular clipping between data range in numpy array would simply reduce the ...
hillsonghimire's user avatar
0 votes
1 answer
49 views

why np.cos returns erroneous values?

I'm debugging my python program. I have np.cos(param_t_10[0]) returns 5.9168e-06 where ...
dsb's user avatar
  • 103
0 votes
1 answer
17 views

Locating base.py when working on Colab

I have faced an error while working with langchain on colab. There is a post on github which recommends changing some configurations in ...
IwillLearn's user avatar
0 votes
0 answers
24 views

Forecasting using LSTM Model

I have a dataset with 12 variables (x1, x2, ..., x12) and one target variable (y). Is it possible to perform a forecasting for the target variable (y) over a certain period of time ahead without ...
Kayla's user avatar
  • 1
0 votes
2 answers
135 views

What is the state-of-the-art in prediction\classification missing labels in partially labeled data?

Overview Let's say I have the following data: ...
Mario's user avatar
  • 364
0 votes
1 answer
44 views

Which Python lib to use for classify data without training any model?

I want to classify data without training any model (nor using neural networks?), Should I use scikit-learn or scipy? There are also others like pytorch or keras that also have the classify method. ...
SSSOF's user avatar
  • 17
0 votes
0 answers
32 views

Detecting cropped features/objects in an image

I hope someone can point me in the right direction. (Cross posting from the main SO flow page) I have some images and I'm trying to write something in Python to detect if the objects in the image have ...
borncamp's user avatar
  • 101
0 votes
1 answer
33 views

Different accuracy scores with sklearn roc_auc_score on same model using sklearn.metrics

Why do these below lines give different outputs while the input is the same? I need to report these results in paper, but I am unsure which is better and why. ...
Adnan Ali's user avatar
  • 101
0 votes
0 answers
17 views

How to autosave a mode parameters during training neural network?

I am still new to python and NN. As NNs trainings is done for example 500 epochs, how I can auto-save the model so that if my connection gets lost or ran out of google GPU, next time I do not start ...
Ali.A's user avatar
  • 57
0 votes
0 answers
43 views

Can we show only results of some epochs in tqdm?

I am training a NN and use tqdm for showing the results. However, the bad thing is that it shows the results for every epoch. This is too many as I want to train NN for atleast 500 epochs. Is there ...
Ali.A's user avatar
  • 57
0 votes
0 answers
22 views

How to Fix Dimension Issues of features and classes from a Multilabel Classification dataset in getting the Out-of-Bag Error of a Random Forest?

I have created a multilabel classification dataset using make_multilabel_classification from scikit learn: ...
Ralph Henry's user avatar
0 votes
0 answers
17 views

Good candidate time series models for 70-100 monthly data points, also incorporate past and future exogenous covariates

Per title, we're trying to identify a good time series modeling technique for: 70-100 variables of monthly sales or volume data (2015 or 2018 to present) Ability to forecast not only using trend and ...
Vaslo's user avatar
  • 101
0 votes
0 answers
70 views

Store and retrieve multiple documents in free vector stores based on critria

I am new to vector stores, and so far experimented with storing 1 file in Faiss and Pinecone. I am looking for tutorials that teach me how to save multiple files in free versions of any vector store, ...
IwillLearn's user avatar
0 votes
0 answers
50 views

Specifying arguments of HuggingFaceHub

In this tutorial, when specifying llm = HuggingFaceHub( repo_id=repo_id, model_kwargs={"temperature": 0.5, "max_length": 64}) only ...
Karl 17302's user avatar
0 votes
0 answers
17 views

Expanding torch dataLoader by repeating elements (or something equivlent)

I have a pytorch classifier with stochastic elements. For each MNIST minibatch, I would like to feed it in K times (from the same starting state), and then average the resulting weight updates in ...
Ari Herman's user avatar
0 votes
1 answer
96 views

What is source_column argument in csv loader?

In this tutorial, what is the purpose of source_column argument? Does it act like a primary key in Databases? Thanks in advance. ...
Karl 17302's user avatar
0 votes
0 answers
12 views

Why do my tf-idf values not appear consistent?

I have a series of tweets that I've converted to tokens. Among them are the following: geraldkutney happen realize happen conveniently rename catch yet emergency post fact come government ...
Daniel V's user avatar
  • 101
0 votes
0 answers
16 views

2 regression models giving same performance

I have 2 regression models (1 is deeplearning based) and another is SVR both trained on the embeddings obtained from the last FC layer of ResNet50. Output variables are min-max normalized to get in ...
codingbugs's user avatar