Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [python]

Python is a general purpose programming language designed for ease of use. It is a commonly used platform for machine learning. Use this tag for any *on-topic* question that (a) involves `Python` either as a critical part of the question or expected answer, & (b) is not *just* about how to use `Python`.

0
votes
0answers
15 views

Why would one use gradient boosting over neural networks?

I'm referring to a specific Kaggle set: https://www.kaggle.com/c/petfinder-adoption-prediction There are a lot of columns, and I'm (for now) ignoring the images / videos. I'm training a standard ...
0
votes
0answers
6 views

Errant log-likelihood via scikit-learn's Gaussian process regression

Here is an example code of Gaussian process regression on a set of sample data where the inputs (X) are 2-dimensional and the output (...
0
votes
0answers
14 views

Numerical approximation of sandwich estimator

I have found the MLE of a model using scipy.optimize.minimize with the BFGS algorithm. As is commonly done, I intend to estimate the variance from $$ Var(\theta_0) ...
0
votes
0answers
13 views

Appropriate way to deal with missing value in both training and test data

In the medical data, it's normal that there are lots of missing value. Now I am dealing with the data with tens of numerical features and many of them have lots of missing value for sure. The ...
0
votes
0answers
21 views

Dendrogram y-axis labeling confusion

I have a large (106x106) correlation matrix in pandas with the following structure: ...
0
votes
0answers
18 views

What is “A” in output of Fit_Transform()? [on hold]

I am working with CountVectorizer and while using the fit_transform() method, I find there is a strange "A" being used (referencing in some blog/tutorial). Couldn't ...
0
votes
1answer
48 views

Bad Linear regression results

I have a dataset, and i have to predict the flow of users at a certain city given some information like the day of the week, the month, the distance of the city of origin ecc.. First i decided to ...
0
votes
0answers
30 views

Why not use (nested) cross-validation to update weights when building final model?

I have been trying to find an answer to this question for some time. I understand that cross-validation is primarily used for model selection, i.e. to tune parameters/hyperparameters, but I don’t ...
0
votes
0answers
9 views

NLTK BigramAssocMeasures.pmi is give same score for all bigrams

I am trying to use BigramAssocMeasures PMI to find the most import bigrams however it's giving all Bigrams the same score, so I end up with a list in alphabetical order when I use ...
0
votes
0answers
9 views

Is it possible to create LSTM with attention mechanism for many-to-one problems?

I'm interested in numerical inputs (scalars) and output (scalar) in particular and would greatly appreciate a Python implementation (PyTorch preferably). The topic I'm looking at is a time series ...
0
votes
0answers
12 views

Comparing two NNLS models

I have two NNLS models: y=$\beta_1x_1 + \beta_2x_2$ y=$\beta_1x_1$ I want to compare these two models using ANOVA, but not sure how to apply it. I first tried to fit the models using python (...
0
votes
1answer
36 views

how to draw 100 numbers following exponential distribution (erlang) in python by having k and CV and mean exponential distribution?

how to draw erlang distribution (two parameters k and cv? (k=1,5,10, cv=100%-45%-32%) ) in python by having k and CV and mean exponential distribution=1? I know numpy.random.exponential(scale=1.0, ...
0
votes
0answers
19 views

A hierarchical Bayesian model in pymc3

Suppose we have the following model: $X$ unobserved $Y$ such that $Y|X \sim \mathcal{N}(X,\sigma^2)$, observed $Z$ such that $Z|X \sim \mathcal{B}(1,X)$, observed and suppose, given observed data $...
0
votes
0answers
9 views

LDA: find percentage / number of documents per topic

I'm using LDA to find topics in a corpus. Everything works fine (I have the topics). But I would like to have the percentage / number of documents in each topic. It's possible? I looked at scikit-...
0
votes
0answers
46 views

Machine-learning using an aggregation function

I am looking for a machine-learning algorithm (ANN, random forest,...) that is able to account for an aggregation function during the learning step. I want to estimate variable Y from variables X1,X2,...
0
votes
0answers
46 views

Which machine learning technique suits this use case?

I have two different zones say for ex. IN and OUT and each zone with two features i.e., A & B. Now I have a target with the same two features and with the help of this, I need to identify, to ...
1
vote
1answer
14 views

Higher value of strides in conv1d

I am using Conv1d for time-series data and I have create a model as follows, ...
0
votes
1answer
15 views

Cause and Effect of one variable on another in python

I have a blog data set, which has essentially many columns such as: ...
1
vote
0answers
10 views

mlbench synthetic datasets for python [closed]

Is there any implementation of the synthetic datasets from mlbench in python? I am looking for these implementations in particular. I've found sklearn.datasets for synthetic examples, but they do not ...
0
votes
0answers
7 views

Marketing Funnel Percentage Calculations

I implement a marketing funnel in python and I have an issue around the topic that I can't solve neither in statistical level. Lets say that we have the funnel A which contains ...
0
votes
0answers
14 views

Keras LSTM for timeseries forecasting help with error messages [closed]

I am trying to understand how to use keras for supply chain forecasting and i keep getting errors that i can't find help for elsewhere. I've tried to do similar tutorials; sunspot forecasting ...
0
votes
2answers
38 views

How can one interpret a heat map plot

I am doing a stats assignment in python and during my preliminary data analysis I created a heatmap plot and would like to be able to explain the correlation among the variables. However, I don't ...
0
votes
0answers
8 views

How to draw a random matrix from Wishart distribution in Python? [migrated]

I am interested in drawing a random matrix from Wishart, and I wonder if there is anything in numpy/scipy for it. Google returns this for R, but haven't found anything for python.
0
votes
1answer
55 views

How are p-values computed from t-values when doing regressions?

I'm performing a regression analysis using the statsmodels module in Python. The regression gives both t-values and p-values for each coefficient, but I'd like to understand exactly which test is ...
0
votes
0answers
17 views

Sklearn BaggingRegressor does not work with LightGBMRegressor & MAE objective

I'm trying to use BaggingRegressor from scikit-learn together with LightGBMRegressor and Mean Absolute Error objective and I'm receiving nan outputs. I reproduced ...
0
votes
0answers
9 views

GridSearchCV with one-hot y: prediction yields 1-dim array

I run a classification by means of a neural network, thus my y-values are converted to a one-hot matrix: ...
4
votes
0answers
23 views

Method to forecast correlate univariate time-series (with trend, seasonality) via regression

I have two univariate time-series with seasonality and trend--dt1 and dt2. I believe that dt1 and dt2 are strongly correlated, both through a few statistical test (see below) and that in my field dt2 ...
1
vote
1answer
30 views

Test for equivalence after sampling into test groups

I want to test the effects of different versions of treatment across multiple test groups of a given population. In order to do that, I want to randomly sample my population into, let's say, 4 groups ...
1
vote
1answer
22 views

Why is cross_val_score substantially lower than .score or roc_auc_score?

I have a trained model, a GradientBoostingClassifier. My dataset is 60 thousand something rows of data that I've split into 66/33 train/test sets. Scoring the model via the ...
2
votes
0answers
30 views

How to fill NaN values that exist because there are no measures of certain features?

I'm currently doing a ML project (the goal is simply to clean the data set and apply some of the models we learned , like Random Forests, Ensemble learning, etc, and test the results) for a class and ...
4
votes
0answers
41 views

How to find out seasonality in Time Series Data without looking at the graph?

I've a data which has multiple time series. I want to find the seasonality in the data based on a number as it won't be feasible to check the seasonality by checking the plot. There are around 2505 ...
0
votes
1answer
17 views
0
votes
0answers
21 views

How to compute 95% confidence interval bars and prediction interval bars of uniform data?

I need to compute the confidence and prediction interval of uniform dataset. import numpy as np Data= s = np.random.uniform(-10,10,1000) print(Data)
1
vote
2answers
64 views

How to extrapolate training metrics to test dataset?

i have split my training data 30/70 and trained models, my models are performing really well on the training set but i have a large unlabelled dataset where i want to do inference, how could i measure ...
0
votes
0answers
11 views
1
vote
0answers
20 views

can you help me figure out this smart f1 function? [closed]

Hi all this is a function being used to evaluate ML results y_true is the ground truth and y_pred are the predicted values from the machine learning model. This smart F1 function calculates the right ...
0
votes
0answers
8 views

Can haar cascades work for hand recognition with multiple hand shapes?

I am researching about using haar cascades for hand recognition. There are examples on the internet (some from OpenCV) for detecting a fist or an open hand with haar cascades (at a time). My question ...
2
votes
0answers
35 views

Interpreting Jenks Natural breaks results

I do not come from a strong math background at all, so even basic concepts confuse me, if this sounds too "basic" sorry. I was going through a book in bioinformatics about finding positions (...
0
votes
2answers
62 views

StatsModel Logistic Regression

I am running a fairly simple Logistic Regression model y= (1[Positive Savings] ,0]) X = (1[Treated Group],0) I got a coefficient of Treated -.64 and OR of .52. My question is how to interpret the ...
0
votes
0answers
16 views

Bayesian network with continuous variable data set in python

I am looking to predict continuous target lets say Sales with KPIs like price distribution using Bayesian network. I have got it done with BNlearn in R but still ...
0
votes
0answers
8 views

Is it possible to have a constent accuracy for my tensorflow network whatever is the iterations?

I am runing my tf NN composed by one input, one hidden and one output layers the number of hidden nodes if the half of total features number I have got the next table considering different learning ...
0
votes
1answer
17 views

How to train XGBoost Classifier with soft output distribution

Please correct me if I am wrong. Is it possible to train XGBoost Classifier on soft output? Usually, the output of the model is (N, 1) in dimension which ...
1
vote
0answers
9 views

How to create dataset for speech recognition using librosa [closed]

I loaded the audio using librosa and extracted mfcc feature of the audio. I now have array of shape (20,N). How do I feed this as input to LSTM to predict?
1
vote
0answers
19 views

Discussion on building logic for Churn for monthly renewal [closed]

I have a subscription based business dataset which looks like this: ...
0
votes
0answers
9 views

Determine input array that approximates a target output array from complex numerical simulation?

I believe the following problem is ideally suited to a machine intelligence approach, but am unsure where to start. I've used scikit-learn previously with downloaded datasets, but the following seems ...
0
votes
1answer
31 views

Compare multiple (n) binomial distributions [on hold]

I have a variable number of sets of samples (at the time of each testing that is determined by the results we get back). I need to compare the performance of these separate samples to determine which ...
0
votes
0answers
16 views

Simple Logistic regression with keras from 4 features

I am trying to create a simple NN using keras, i have data in this form: which contains rows of 4 numbers ranging from 0 to 100, based on these values i am trying to predict the outcome as 0 or 1 ...
2
votes
0answers
27 views

Implausible variable importance for GBM survival: constant difference in importance [closed]

I have a question about a GBM survival analysis. I'm trying to quantify variable importances for my variables (n=453), in a data set of 3614 individuals. The resulting graph wi th variable importances ...
1
vote
1answer
34 views

Training r-squared decreases after adding higher degree polynomial terms to regression model

I was playing around with some examples to get some experience using the PolyFeatures tool from Scikit-Learn, and I ran into something strange. I iteratively added ...