Questions tagged [scipy]

The tag has no usage guidance.

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

averaging non-aligned vectors or lists of numbers

I have two lists of vectors: x, and y. Each x,y vector forms a function that can be plotted (see figure). The values in x do not all match, which you can see from the plot. Also, each x vector may ...
0
votes
0answers
9 views

Parallelization of a MIMO linear filter

I would like to implement a Multi Input Multi Output filtering operation, acting as fast as possible on batches of data. Here is my current implementation: ...
0
votes
0answers
15 views

Calculate the correlation coefficient without one-hot encoding the category variable

I just read about Cramers V statistic to calculate the correlation coefficient without one-hot encoding the category variable. I'm trying to use it for finding the correlation coefficient of my target ...
1
vote
1answer
24 views

Differential Evolution optimal tolerance parameter

I am trying to optimize the parameters of a global optimization system for my set of data, because I will have a bunch of similar data to process so I need to fine tune the global optimizator so that ...
0
votes
1answer
27 views

Why i am getting t statistics different

import scipy.stats as st st.t.ppf(0.95, df=9) Output: 1.8331129326536335 As per this, I should get 2.262 with dof = 9.
1
vote
0answers
10 views

Should the weights be rotated when using SciPy full convolution?

I use SciPy's single.convolve2d in "full" mode to compute gradient w.r.t to convolution layer inputs. In my current implementation, I don't rotate filters as suggested by this article because I assume ...
1
vote
0answers
8 views

Scipy.optimize getting back x0 for optimization of input to recurrent neural network

I need help with this optimization problem which is either not getting solved at all or is taking a copious amount of time. I am trying to find optimized input to an RNN (GRU) model of a process ...
1
vote
0answers
32 views

Scipy Sparse vstack memory error

I have a bunch of scipy matrices (of the same #columns) loaded from disk. I want to combine them into one scipy sparse matrix. I am using scipy sparse vstack method. I am able to load the ...
0
votes
0answers
64 views

Is cdf inclusive and sf exclusive in scipy.stat Python library? (cumulative distribution function)

enter code hereWiki description of cdf Cumulative distribution function: " F(x)= P(X <= x) The cumulative distribution function of a real-valued random ...
2
votes
1answer
40 views

Which is the best algorithm for entity extraction for unstructured document

I have unstructured documents from which I have to extract the information like let buyer name, seller name, expiry date, buying date etc. I had planned to use spacy(Custom entity recolonization(...
2
votes
1answer
23 views

optimizing a linear optimization function with linear constarints and binary variables

I am new to optimizations and trying to solve a problem, which I feel falls in the umbrella of optimization. I have an ojective function that needs to be maximized ...
1
vote
1answer
38 views

How to perform convolution with kernel bigger than image?

In this question I've seen an example of convolution by the kernel with the shape bigger than initial image's one: ...
2
votes
0answers
22 views

Error when drawing random numbers from a custom continuous distribution using scipy.rv_continuous

I am trying to generate a sample of random numbers from a custom distribution $$ p(x) = x^{n}e^{-xtn}. $$ After reading the tutorial on scipy's website, I wrote a subclass which I called kbayes: <...
1
vote
1answer
174 views

Fastest batch perspective transform for image augmentation

I need to do some augmentation for my training images for a neural networks. The problem is that even when loading batches in parallel, the augmentation is taking longer to perform than the network ...
3
votes
2answers
35 views

How to interpret ANOVA results?

I am trying to identify what attributes are not relevant in my dataset to remove them before fitting a classifier. The target is a categorical variable with three different values. I also have a lot ...
1
vote
1answer
130 views

How do I force specified coefficients in a Linear Regression model to be positive?

Looking for a way to do this in Python. scipy.optimize.nnls forces all coefficients to be positive. Some additional context: I have a data frame with a some explanatory variables and a response ...
0
votes
0answers
9 views

From stationary value to original value

...
1
vote
0answers
149 views

Two different results from seaborn and matplotlib for a kde plot. What's the reason?

I'm plotting kde plots for a set of data with seaborn and scipy.stats.gaussian_kde: My understanding is that under the hood, seaborn uses scipy (see here). It also seems as though the bandwidth ...
0
votes
1answer
25 views

Probabilities of a Poisson distribution not making sense

I am trying to find probabilities of orders a restaurant gets on Sunday's. For last 6 months average orders are 1000 without any big anomalies like 700 or 1300. This is a case of poisson distribution &...
0
votes
0answers
20 views

How to use skimage.feature.hog to calculate hog of training data where examples are stacked vertically

I have a $n*1024$ dimensional $2D$ array where n is number of examples which contain n images($32*32$) stacked vertically. I would like to calculate the hog of these images ...
5
votes
0answers
43 views

Influence of trend on (supposedly) correlated time series

TL;DR: What is the impact of a linear trend on the correlation between time series that are (most likely) not spuriously correlated? I'm currently trying to reconstruct/cross-validate an analysis ...
1
vote
2answers
185 views

Fitting a distribution to data

I have a large data set of property values at two points in time. I have calculated the change in value between those two points. I want to assess which distribution most closely matches the variation ...
0
votes
0answers
18 views

KDTree classified as AI /ML?

We are currently using a KDTree to find similar documents based on keywords identified via TF-IDF. After the tree is built, we are querying the tree to find nearest points. Would this fall in the ...
0
votes
0answers
14 views

Distributed optimization with a common variable among individual agents

I am new to optimization techniques and have a doubt in my approach. Consider I have an agent which tries to optimize on 3 variables C1,x11,x12 to minimize power. I have 60 such agents which ...
1
vote
0answers
150 views

Can I use scipy.optimize module with PyTorch?

I need to use scipy.optimize module after encoding some data with pytorch. However, scipy.optimize does not take torch.tensor as its input. How can I use scipy.optimize module with data with gradient ...
2
votes
1answer
398 views

Which method to use to remove trend from time series?

From what I understand, differencing is necessary to remove the trend and seasonality of a time series. So I assumed it basically does the same thing as signal.detrend from the scipy library. But I ...
1
vote
1answer
557 views

scipy.optimize.minimize(method=’trust-constr’) doesn't terminate on xtol condition

I have set up an optimization problem with linear equality constraints as follows ...
1
vote
1answer
400 views

Scipy curve_fit and method “dogbox”

I am trying to duplicate this papers feature engineering for user activity. They take 14 days of accumulated user activity and keep the parameters (2 parameters) that fit a sigmoid to it. I would like ...
0
votes
0answers
72 views

How to perform a 1-way ANOVA right after One-Hot-Encoding

I am at the phase of dimensionality reduction. I am trying to figure out which categorical columns I should keep for my model and which I should discard. Because some of my categorical columns have ...
0
votes
1answer
103 views

How to measure the correlation between categorical variables and a continuous variable

I have the following list of the names of the categorical variables in my dataset: ...
2
votes
0answers
132 views

Orange3 / python script / scipy interpn

I tried to create a learner using the Orange canvas script from the Python script widget, but I have not been able to find an effective example. What I would like to do is: 1) Create a learner based ...
0
votes
1answer
1k views

Python: multiplication of sparse matrices slower in csr_matrix than numpy

I am trying to multiply a sparse matrix with itself using numpy and scipy.sparse.csr_matrix. The size of matrix is 128x256. Its 93% values are 0. Ironically the multiplication using numpy is faster ...
1
vote
0answers
33 views

Area Under Curve 5 Year Prediction

I have a dataset that includes a ratio(y-axis) and tenure(x-axis). My goal is to take the training set and establish a learning curve by tenure (1 to 15 years) which looks like this: Actual Group ...
1
vote
0answers
34 views

Semantic Segmentation using Scipy or Scikit-image

Many days ago I saw a user using scipy function to get region of interest (RoI) in an image using different colors. I believe it was some sort of filter. Now I'm trying to do the same but I'm not able ...
0
votes
2answers
1k views

How do I properly write scipy.stats.binom.cdf() details

I need to calculate the probability of my random variable being $\le 0$. It's a binomial distribution, $10000$ trials, probability of success is $\frac{10}{19}$ (roughly $0.53$). How do I properly ...
6
votes
3answers
127 views

What is the best algorithm/solution for predicting the following?

I have a dataset that comprises 76 countries, and 6 columns of distinct quantitative variables, which are the mean values of that variable relative to each country: If I were to take a random sample ...
2
votes
0answers
1k views

How to make scipy.optimize.basinhopping find the global optimal point

Question Try to find the global optimal point of the function (reading Python for finance 2nd edition - Chapter 11. Mathematical Tools). ...
1
vote
1answer
786 views

How to understand the return values of scipy.interpolate.splrep

Background Continuation of Spline interpolation - why cube with 2nd derivative as following Cubic Spline Interpolation in youtube. The example in the youtube is below. Implemented using scipy....
1
vote
1answer
859 views

What does sklearn's pairwise_distances with metric='correlation' do?

I've put different values into this function and observed the output. But I can't find a predictable pattern in what is being outputed. Then I tried digging through the function itself, but its ...
1
vote
0answers
22 views

How can I transform (pre-process) pure count data for PCA analysis?

If 12 covariates of data are all count data (looks like a Poisson dist with the highest peak at 0), what are reasonable pre-processing methods that might make PCA more effective?
0
votes
0answers
152 views

B-spline interpolation for image

I am looking B-spline image interpolation implementation using python library. Like: bicubic_interpolation = cv2.resize(image, (512, 512), interpolation = cv2.INTER_CUBIC)
0
votes
1answer
794 views

Machine learning with sklearn vs. scipy stats

I've created 50 random x and y points (with slope of y = 2x-1). First, I used Linear Regression from sklearn to fit the model onto my dataset where I got a slope of ...
1
vote
1answer
795 views

t - table and degrees of freedom

I am interested if someone can review this process and give me some tips. (I don't have any data science coworkers or friends to collaborate with...) When the script (.py file) below runs, it will ...
1
vote
0answers
29 views

Bayes posteriograms

My main objective is to predict the posterior probability of an individual belonging to one of the classes, using Bayes theorem. The information I have is: value of the data point mean and stdev of ...
1
vote
0answers
134 views

Two-sample K–S test Kolmogorov–Smirnov test in Python

For my evaluation, I have three different time-series data of the following format with different characterstics where the first column is timestamp and the second column is the value. ...
2
votes
1answer
24 views

Normally distribute occurence or counts

I am creating a mock of sales data. One of the columns is salesperson_id where each id can occur more than once (a salesperson can have multiple sales). I want to ...
1
vote
1answer
81 views

Faster 3D Matrix Operation - Python

I am working with 3D matrix in Python, for example, given matrix like this with size of 2x3x4: ...
0
votes
1answer
21 views

Restricting a weight vector (optimization parameter) to be in a certain domain using python ML library linear regression model

Sorry if the title is a bit long, but basically I'm trying to predict values $$ \hat{y}_i \in [-1,1]$$ using a simple model i.e. something like OLS or ridge regression, I'd like to know if anyone ...
1
vote
0answers
98 views

python calculating degree days

I am trying to write a program in python to calculate growing degree-day for a specific insect out of average hourly temperature. The way you calculate growing degree day from hourly temperature is by ...
1
vote
0answers
528 views

Optimizing an averaged perceptron algorithm using numpy and scipy instead of dictionaries

So I'm trying to write an averaged perceptron algorithm (page 48 here for the equation) in python. Instead of storing the historical weights, I simply accumulate the weights and then multiply ...