A message from our CEO about the future of Stack Overflow and Stack Exchange. Read now.

# Questions tagged [scipy]

The tag has no usage guidance.

52 questions
Filter by
Sorted by
Tagged with
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 ...
18 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 ...
15 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 ...
32 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(...
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 ...
24 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: ...
13 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: <...
90 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 ...
22 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 ...
55 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 ...
9 views

...
75 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 ...
22 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 &...
18 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 ...
34 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 ...
94 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 ...
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 ...
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 ...
95 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 ...
115 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 ...
357 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 ...
217 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 ...
47 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 ...
57 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: ...
115 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 ...
861 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 ...
32 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 ...
31 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 ...
818 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 ...
124 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 ...
989 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). ...
584 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....
677 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 ...
21 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?
125 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)
604 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 ...
600 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 ...
27 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 ...
111 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. ...
23 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 ...
63 views

### Faster 3D Matrix Operation - Python

I am working with 3D matrix in Python, for example, given matrix like this with size of 2x3x4: ...
18 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 ...
77 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 ...
484 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 ...
6k views

### Using Machine Learning to Predict Temperature [closed]

I am a beginner in ML and I want to create a smart thermostat, that after collecting enough data from the interaction with the user, it will start to set the home temperature by itself. What I got so ...
129 views

### Are Hadoop and Python SciPy used for the same? [closed]

Right now I've been doing a bit of research because I'm quite new to Big Data world. Among several other tools or frameworks, I've read about Apache Hadoop and Python for data analysis. Specifically,...
3k views

### Understanding scipy sparse matrix types

I am trying to select the best scipy sparse matrix type to use in my algorithm. In that, I should initialize data in a vij way, then I should use it to perform matrix vector multiplication. Eventually ...
144 views

### Need lesser memory consumption than doing sklearn.decomposition.TruncatedSVD on 99999 variables

Need lesser memory consumption than doing sklearn.decomposition.TruncatedSVD on 99999 variables. So I know that I can use TruncatedSVD to do the dimensionality reduction. However, my problem is about ...