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

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
1answer
13 views

Supervised Learning Model in Python with Addresses

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
20 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
13 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
11 views

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

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

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

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
1answer
18 views

Am I missing obvious problems with my model

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

Robust Regression S-estimation in python [on hold]

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 [on hold]

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
13 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
12 views

R Equivalent to sklearn/TfidfVectorizer? [on hold]

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
37 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
7 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
13 views

How to perform polynomial regression for specific regressors only using scikit-learn? [on hold]

I am trying to perform polynomial regression on the scikit-learn on the Auto dataset in ISLR. Specifically, I am performing regression between mpg and [horsepower, displacement and weight]. Now if I ...
0
votes
0answers
8 views

How to implement Shapiro–Wilk test to my data using Python? [on hold]

I have a 5000-sized data, I generated my data("vals") 1)generate 5 random numbers between(0,1) 2)find the mean 3)run the loop 5000 times 4)vals= these 5000 means My questions are: 1) Firstly I want ...
0
votes
1answer
15 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 ...
-1
votes
0answers
17 views

Replace characters in CSV files in Python [on hold]

I'm trying to write a code in python (Sypder) where in a given CSV file I replace the commas for semicolons. I also have to be aware of the decimal point, and so I first have to replace the commas for ...
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
10 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 ...
0
votes
0answers
34 views

Python Scikit-learn polynomial regression - coefficients [closed]

I have a small csv dataset (link to raw Git) of a control valve and a temperature sensor, and I am attempting to learn how to extract the features/weights of a 3rd order polynomial model of the data. ...
1
vote
0answers
27 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
0answers
17 views

What is an intuitive way of explaining how to set Hyperparameters for Regularization? [closed]

What is an intuitive way of explaining how to set Hyperparameters for Regularization? How would these hyperparameters change for L1 or L2 Regularization? In Python I have seen np.logspace() used to ...
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
16 views

How to use mahalanobis distance for classification [closed]

I would like to know the steps for using mahalanobis distance for classification and prediction. So My thoughts are get the vector of distances, sort them, get the major 4. Is that right ?
0
votes
0answers
10 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
15 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
23 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
26 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
20 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
13 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
26 views

What is an intuitive way of explaining C-space for Hyperparameter tuning for Logistic Regression? [closed]

What is an intuitive way of explaining how to set Hyperparameters for Regularization? I walked through an online course on regularization in ski-kit learn, however the C-space was pre-filled. Can ...
0
votes
1answer
16 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
24 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
30 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
21 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?
0
votes
0answers
11 views

LocalOutlierFactor scikit-learn

My goal is to use the LocalOutlierFactor class from scikit-learn to do real-time Novelty Detection. This can be achieved by setting novelty=True in the constructor, ...
1
vote
0answers
26 views

Reducing Bias from a Random Forest - Feature Importance

I'm currently looking to show which of three variables is more important in classifying something as True or False. Everyone agrees that all three variables are important, but not all agreeing on what ...
0
votes
0answers
15 views

Python: Simulate data correlated with a given array

Although there are some existing methods (e.g. np.random.multivariate_normal) for simulating random correlated variables for given mean, corr and assumed distribution, I couldn't find a way to ...
0
votes
0answers
21 views

How can I improve my sklearn linear regression?

I'm carrying out a regression problem where I am trying to predict quality based on other attributes of wine. (The quality data is the result of the median of 3 wine tasting experts rating each wine ...
1
vote
0answers
44 views

Logistic Regression Just Predicts 1

I am a 10th grade student working on a science fair project that involves making predictions about adherence given patient data. I have separated the week into 21 time slots, three for each time of ...
2
votes
1answer
43 views

Removing Variance in Time Series After Applying Log Transformation

I'm trying to look at natural gas prices from 2003-2018. The issue is after applying log transformation and then diffrencing data by 1, I still seem to get an increase in variance from mid 2014-2018. ...
0
votes
1answer
32 views

Adjusting probability threshold for sklearn's logistic regression model

I am a 10th grade student working on a binary classification problem and I have decided to use the logistic regression model from Scikit-Learn. I am looking to predict patient adherence given the time ...
1
vote
1answer
43 views

looking for idea how organize data for machine learning model

I need help with planning and ideas on how to build an data table for a machine learning model in sklearn. The model is supposed to help the clinic manager decide which treatment method and therapist ...
0
votes
1answer
12 views

In-sample evaluation with different classifiers

I've tested in-sample evaluation with different classifiers (Decision trees, Random Forests, Gaussian Naive Bayes) within sklearn and Iris datasets. ...
1
vote
0answers
16 views

How to infer the number of states in a Hidden Markov Model with Gaussian mixture emissions

I have a time series made up of an unknown number of hidden states. Each state contains a set of values unique to that state. I am trying to use a GMM HMM (as implemented in Python's ...