Stack Exchange Network

Stack Exchange network consists of 174 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
Make your voice heard. Take the 2019 Developer Survey now

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
6 views

Daily Time Series Anomaly Detection with Seasonality Control - Python

I have data tracking occupancy over time in a pandas dataframe in the following format: The entire data set looks like this: I have data like this for hundreds of properties, and I'd like to set up ...
0
votes
0answers
6 views

Align Two Pairs of Start and End Time Series Data

Overview I have two data sets of (start,end) events: Estimated Time series event pairs Corrected Time series event pairs The start and end points are seconds from the beginning of an event. The ...
0
votes
0answers
4 views

Visualising a networkx graph with vosviewer

I am trying to export a networkx graph into a format that vosviewer can read. When I wrote my graph to gml and pajek via nx.write_gml(G, path) and nx.write_pajek(G, path), vosviewer did not accept the ...
0
votes
1answer
24 views

statsmodels logistic regression with binned variables has large coefficients and standard error for some variables

I'm fitting a logistic regression (binary) using Python's statsmodels, and here's a snippet of summary from the model: I have noticed that the large coefficients ...
0
votes
0answers
6 views

neural network doesn't fit boundaries [duplicate]

I'm new to machine learning and trying to fit a sample data set with neural networks in python using tensorflow. After having implemented the neural network in Dymola I want to compare the outputs of ...
0
votes
0answers
14 views

Clustering data with equally sized clusters

I'm looking for an algorithm that can cluster data as accurately as possible (no need to be perfect) but with equally sized clusters (+ or - 1 element). I've been reading this article where it is said ...
0
votes
0answers
9 views

How can i create an Ngram model using tensorflow? [on hold]

I want to create an Ngram model using tensorflow that reads from a file and gets the ngram of each word. example output: she 12313 he 12312 word 11111 code 10001 programming ...
2
votes
0answers
21 views

Constraints across related dependent variables

I'm working on model that uses a set of features like track_type, driver_age and some lag variables to predict the number of <...
0
votes
1answer
27 views

KNN regression: Why does my In sample RMSE look like my out of sample RMSE across K values?

I'm expecting the RMSE plot for my KNN regression model to look like the above image but I'm getting the below when running my code hosted here. Any ideas on what could cause this? I believe something ...
0
votes
0answers
12 views

Python: How to plot 2 categorical variables? [on hold]

For example, I have data like this For each data point, it has a categorical feature a in [cat1, cat2, cat3] and a categorical feature ...
0
votes
0answers
8 views

Extracting true values from an image using a colorbar [on hold]

So I've been given some JPEG images with a colorramp/colormap in a separate file. What I would like to do is extract the RGB values from the image, and their corresponding RGB values in the color bar ...
0
votes
0answers
8 views

SKlearn GBM feature importance or contributor after predictions [on hold]

I am using SKlearn GBM predictions for one of my exercises, and for understanding feature importance after fitting on train data, I can easily do it like this in python, since 'fit' method has those ...
0
votes
1answer
13 views

Normalizing value using 3 points / levels

I am using following formula to normalize number: new = ((current - low) / (high - low)) * 100 But i need middle number to be the mode of the data. So in this ...
0
votes
2answers
40 views

How to use last predicted value as feature? NLP NER mission

I'm performing NER (Named entity recognition) For example: Seq: When Donald Trump announced... Tags: O B-Person L-Person O When I'm predicting ...
0
votes
0answers
13 views

RFE-RF for non-ordinal multi-class problem using integer target variable

For a classification problem with numerical predictors and a categorical multi-class response I am trying to use Recursive Feature Elimination with Random Forests to identfy relevant features out of a ...
0
votes
0answers
16 views

Applying boundary conditions and constraints to Gaussian process regression

When using Gaussian process regression (GPR) to predict $y$ over a domain, $x$, are there method(s) to impose particular conditions on the predictions? For example, if I know the prediction $y$ must ...
0
votes
0answers
7 views

Is it mandatory to supply expected values using SARIMA in python?

I went through several examples on the internet discussing time series models. All of them take the dataset, divide it into train and test subsets, then make predictions. On those lines, I have built ...
0
votes
1answer
26 views

Supervised Learning Model in Python with Addresses [closed]

I'm having issues wrapping my head around how exactly to go about this project. I was given a list of about 5,000 addresses that were labeled as things like "factory" and "dealer". From that, I set ...
0
votes
0answers
21 views

Cannot replicate a 95% CI using: Beta ±1.96*SE [duplicate]

I am having a lot of difficulty figuring out why I cannot calculate a 95% CI by hand with one set of data; but I can using the same process with a different set of data. Drawing on OLS results; I am ...
0
votes
0answers
15 views

Statistical Model for multivariate timeseries

I'm new to timeseries prediction and I would like to try several classical methods before getting into more complicated model. Concretely, I have a multivariate timeseries of ...
0
votes
0answers
14 views

Does TF/Keras input layer need to be float32 for one-hot encoding? [closed]

I'm building a model with the input layer like this: encoder_inputs = Input(shape=(None, self.num_encoder_tokens)) and the input data is encoded like this: <...
0
votes
0answers
23 views

Unable to implement multiple hidden layers in an RNN (PyTorch) [closed]

My Pytorch RNN for name classification does not allow me to choose multiple hidden layers. If I choose more than 1 layer I get the following error message: Traceback (most recent call last): File "...
0
votes
2answers
43 views

Am I missing obvious problems with my model [on hold]

I am using Keras to train a CNN for a single label image classification. The model is being trained on synthesized data and applied to real world images. After a significant amount of trial and error ...
0
votes
0answers
11 views

Robust Regression S-estimation in python [closed]

Is there a way to implement robust regression with S-estimation in Python? Basically, I'm trying to find python equivalent of SAS PROC ROBUSTREG (method = s).
0
votes
0answers
10 views

Using R packages in Python [closed]

Is there any possibility to use R packages in python? I'm especially interested in using R's party package since it provides functions not available for python.
0
votes
1answer
14 views

apply CountVectorized to whole data before applying train_test_split

Is there any difference between the two different snips of codes. ...
0
votes
0answers
13 views

R Equivalent to sklearn/TfidfVectorizer? [closed]

I want to create a document-term-matrix with tf-idf weighting in R. So far, I use the cast_dtm() function for this. In Python / sklearn, I can use the TfidfVectorizer from sklearn the following way: ...
0
votes
2answers
39 views

How can we generate stationary and non-stationary time series data in python?

I need custom simulated stationary and non-stationary(trending) time series data for one of my python projects. I searched all the web for it but didn't find anything for python. Then I came across ...
1
vote
0answers
9 views

Control group selection

I am currently migrating some code from SAS to Python. I am trying to do the following in python: I have two groups of customers: those that were exposed to a campaign, and those that were not (the ...
0
votes
1answer
17 views

Understanding TensorFlow' conv2d for multiple output channels

I'm trying to understand the convolution process better by applying conv2d to different inputs. However I get unexpected result by transforming 3x3 matrix from 1 to ...
0
votes
0answers
27 views

ML - Text input data

I'm trying to explore an use-case in ML but stuck at a point. May i please request your advise please. Have a service desk web application for logging tickets, which is essentially a form having ...
0
votes
0answers
13 views

Distribution Comparison on Multiple Dimensions in Python

I work as an analyst at a company that is in the midst of transitioning to more cloud-friendly tools. That means we've gone from using SAS/TD SQL (from my actual analyst days) to working with Python ...
0
votes
1answer
34 views

math behind polynomial regression

I am creating a polynomial regression model with Python sci kit learn package, and I was wondering how I can use the predict features in machine learning ...
1
vote
0answers
29 views

Why my validation loss is not converging over multistream model? [closed]

I want to merge two CNNs that are trained over the different dataset. I have taken two sequential models and merged them. But when using customized fit_generator, validation loss is not converging. ...
0
votes
1answer
47 views

Quadratic model of data?

Is it possible to fit a quadratic or polynomial model with this type of data? Two inputs, input one is a temperature sensor: Input two is a valve opening on a scale from 0-100: This is a scatter ...
0
votes
0answers
12 views

LAMBDAMART model gives low training score for queries having large number of candidate documents

I am using LAMBDAMART as the learning to rank algorithm to rank relevant documents for a given query.The model performs well for the queries having lower number(300-400) of candidate documents.However ...
0
votes
0answers
17 views

build a macine learning model, using Hidden Markov Model

I have a task to predict student retention by modelling student behavior by observing observable states (such as interaction with log data that contain accessing lectures,discussion, problem and so on)...
0
votes
0answers
25 views

Ranking/Sorting Star Ratings - Bayesian Credible Interval

I recently started analyzing episode polling data from a website that uses a 1-10 rating system. I've been reading about ranking star rating systems using Bayesian Credible Interviews as explained by ...
0
votes
1answer
27 views

Is it normal for the intercept to have a 1600 Variance Inflation Factor (VIF)?

I'm using Python's module to calculate the VIF for my variables to be used in a binary logistic regression. I'm completely following this post to do this: https://etav.github.io/python/...
0
votes
0answers
23 views

Problem in creating causal model for delay analysis

knock-on" are defined as delays caused by previous late departures or arrivals. I am trying to create a model which can help predict the arrival delay of the next flights. But I don't know where to ...
0
votes
0answers
15 views

Way build a ML model with dynamic dataset have dependencies between feasuers- python or node

I need build a model has to predict for the director of a treatment institute What is the recommended treatment for a new patient according to his Personal Information and Difficulty diagnosed: the ...
0
votes
1answer
18 views

Catboost Regression. Function Extrapolation

I'm new at ML and have a problem with catboost. So, I want to predict function value (For example cos | sin etc.). I went over everything but my prediction is always straight line Is it possible and ...
1
vote
1answer
32 views

Finding the appropriate polynomial fit in Python

Is there a function or library in Python to automatically compute the best polynomial fit for a set of data points? I am not really interested in the ML use case of generalizing to a set of new data, ...
0
votes
1answer
32 views

Assign sentences to their respective topics using LDA

Is there a way to find out what sentences fall under which topic detected using Latent Dirichlet Allocation (LDA)? Assume I have already used LDA to extract topics. Now I want to determine which ...
0
votes
0answers
10 views

Does it make sense to apply recursive feature elimination on one-hot encoded features?

Does it make sense to apply recursive feature elimination on a feature set pre-processed with One-Hot Encoding? This is my code for feature selection: ...
0
votes
0answers
15 views

Determining the log-loss score for matrices that consist of three probabilities (Win/Draw/Loss)

I have a CSV-file with my own estimated probabilities for the outcome of a soccer match. There are three possible outcomes: a win, a draw and a loss. In order to determine how accurate my estimates ...
1
vote
0answers
25 views

How to sample from a multivariate uniform distribution with constrained sum [closed]

Problem description: Let say that we have the following 4 uniform distributions: $u_1$~$U_1(-1, 1), u_2$~$U_2(0, 2)$, $u_3$~$U_3(0, 0.2)$ and $u$~$U[U_1, U_2, U_3]$ subject to $u_1 + u_2 + u_3 = 1$. ...
1
vote
0answers
27 views

Scatterplot bounded by parabola

I have frequency data for several variables. Each type can take on one of two variants: ...
0
votes
0answers
23 views

Trouble replicating sklearn logistic regression outputs

I am trying to create my own logistic regression classifier using scipy.optimize but I am having trouble getting close to the output of sklearn's built in logistic regression function. I am testing it ...
0
votes
0answers
6 views

Ensemble Scalability Challenges

Are there special challenges in scalability related to having an ensemble model rather than using a single classifier?