Questions tagged [python]

Python is a programming language commonly used 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`.

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

x-axis QQ plot in python too large [closed]

My QQ plot's x-axis is showing too large of a scale. Please see the attached screenshot.[![enter image description here][1]][1] When I plotted with QQ plot a normal distribution generated, it shows ...
1
vote
0answers
28 views

Forecasting a timeserie without knowing the origine of the data

I've a set of timseries with only numbers theres no time index on it and also don't know the origin of the numbers and the nature of the series which makes the task very hard ... so can't study the ...
0
votes
0answers
11 views

Non Linear regression to obtain diminishing marginal effect / elasticity [duplicate]

I am working with some real estate data on housing units. For a given market, I have data on occupied units, rents, and control variables such as population, demographics, income levels etc. I'd like ...
1
vote
2answers
9 views

Violin plot of 2 numpy arrays with seaborn

I would like to compare the distribution of 2 numpy arrays using a violin plot made with seaborn. The maximal value in both arrays is 1. The plot suggests a higher maximum. Am I misunderstanding the ...
0
votes
0answers
10 views

Could anyone suggest a software to analyse data on trip distribution in transportation engineering? [closed]

I have a dataset that contains the attraction(A) and production(P) with time used to move from zone i to j. I have carried out ...
1
vote
0answers
26 views

MCMC methods for (Bayesian) Item Response Theory?

I'm trying to better understand Item response Theory (IRT) from a Bayesian perspective. Hypothetically, suppose I want to use a 1PL model and my data is a binary matrix ...
6
votes
0answers
47 views

Gaussian process - what am I doing wrong?

I have recently started to delve into Gaussian processes. During my review, I have found a book which states that one can interpret the mean of a Gaussian process as a combination of basis functions, ...
0
votes
1answer
11 views

Identify individual networks within dataset containing many (using SAS preferably)

I have a dataset of links/edges that looks something like the following (except significantly larger - approx. 50,000 links): ...
-1
votes
0answers
6 views

predict training model in the testing dataset at every 200 samples? [closed]

I am new to python. I want to predict the model in the testing dataset at every 200 samples. How do we do that in python? Thanks in advance. Regards, ML
-1
votes
0answers
16 views

How do I resolve Number of features error while using predict? [closed]

My sklearn code for predicting is as below: ...
0
votes
0answers
14 views

Computing Karcher means in the space of all probability densities

Suppose I have samples $X_i \sim \mu_i$, and let us for simplicity assume all the higher moments exist and the supports of probability measures $m_i$ are on some compact subset of $\mathbb{R}^n$. Let ...
0
votes
0answers
6 views

Metrics for implicit data in the recommender system

Which metrics for analysis and evaluation for implicit data in a recommender system do you use? Which ones are there? I have found some metrics, but I can't see the wood for the trees. Looking forward ...
0
votes
0answers
12 views

Visualization of a neural network [closed]

I use TensorFlow and Keras. Is there a library to visualize the neural network with the input, hidden and output layers. I've ...
0
votes
0answers
11 views

Parallel Keras model training using python mutliprocessing [closed]

I am training on a 64 core CPU workstation multiple Keras MLP models simultaneously. Therefore I am using the Python multiprocessing pool to allocate for each CPU one model being trained. For the ...
1
vote
0answers
4 views

Does TPOT support multi-label text classification?

How can I run TPOT to give me suggestions on what algorithm to use for a multi-label text classification? My data is already cleaned and divided into training and testing sets.
0
votes
0answers
6 views

Clustering DBSCAN's parameter Epsilon: How is eps related to scale of data being clustered?

How is scale of eps related to data to be clustered in DBSCAN? e.g. in image of 1024x1024, we have points as: ...
1
vote
0answers
28 views

Covariance matrix computation VECM, Lutkepohl (2005) p.287

In Lutkepohls book "New introduction to multiple time series analysis" (2005) on p.287 is outlined how to calculate your estimated parameters $[\hat \Pi,\hat \Gamma]$ sample covariance ...
0
votes
0answers
6 views

Looping over algorithms results in error (ensemble, cross-validation). The function changes the shape of the predictor value

I have a dataset that I want to test with several machine learning algorithms. The features I use have a shape of (100854, 94) and the predictor value has a shape ...
0
votes
1answer
48 views
+50

How to estimate the optimal cutpoint for a binary outcome in python?

I have a dataset of diabetic patients which has been used to train an xgboost model in several outcomes such as stroke, amputation, and more. Originally we used the continuous numeric variables as-is, ...
0
votes
0answers
11 views

Modeling resulting actions as a parameter approaches a certain value

Python newbie here, so please bear with me. I'm trying to code a simple reinforcement learning program in which an agent repeatedly chooses from two different gambles of the form: win x1 with ...
0
votes
0answers
14 views

Transforming Heterogeneous Treatment Effect Models (in EconML) into Average Treatment Effect Model (from DoWhy)

This question relates to the steps one would need to take in order to reproduce an answer from the DoWhy tutorial, using the EconML library code for heterogeneous causal effects. In DoWhy, there is ...
0
votes
0answers
17 views

Statsmodel Logit with One dichotomous variable [closed]

I have a statsmodel sm.Logit model with only binary levels y= (1,0) and X = constant , COHORT_FLAG:(1 or 0). In the SM model is the coeffient being reported the log odds of event 1 happening or event ...
0
votes
0answers
16 views

convert eigenvalues to pdf using Python [closed]

I have an array of eigenvalues and I am interested to convert to an empirical probability density function. Could someone show me how this is done in Python. Thanks
1
vote
2answers
23 views

How to combine outputs from different non-machine learning prediction models?

I have a list of cancer mutations and I have run five different bioinformatics tools that predict whether a particular mutation will lead to a more aggressive form of cancer or not (0-neutral;1-...
0
votes
0answers
7 views

How to select 'n-splits' in ShuffleSplit

How many times can I do ShuffleSplit? What is the maximum/recomemend value of 'n-splits'? If, for example, I'm comparing two classifiers, can I perform ShuffleSplit as many times as needed on each ...
0
votes
0answers
15 views

Large dataset with many missing values (90% or more) - remove columns or still do one-hot-encoding?

I have a large dataset with 500.000 rows and 54 columns. I want to predict the sale price of machines, based on historical data. Many columns are nominal categorical (with no order) and have NaN; ...
1
vote
0answers
43 views

How to get coordinates when only pairwise distances are known? [duplicate]

I have $n$ points with pairwise distances known, $d_{i,j}: 0<i,j<n$. Their coordinates, $\vec{x}_i \in \mathbb{R}^k: 0 <i<n$, are unknown. I can set up $n^2 - n$ equations to solve for ...
3
votes
1answer
35 views

Repeated Nested Cross validation

I'm aware that nested cross-validation is used for hyperparameter tuning and model selection and that repeated k-fold cross-validation is used to improve the estimated performance of the model. My ...
0
votes
0answers
27 views

LSTM predict parameters of time-series [closed]

I have a simple question. How to create a model for prediction of the parameter signal? For instancje, very simple: $$ f(x) = a sin(x) $$ where $a$ is parameters. I need to prepare a model for ...
0
votes
0answers
12 views

convert classification model into object detection model [closed]

I have created a Custom CNN for classification using ImageNet like custom Dataset(39 x 39px images) with Keras-Tf2.2.0. I have got 98% classification accuracy. how Can I use the same classifier for ...
0
votes
0answers
13 views

Label an horizontal whisker and box plot in python [closed]

I have an horizontal box plot using the following code as follows: ...
0
votes
0answers
13 views

Testing for Correlation between Google NGram Series

I have two time series extracted from Google ngrams from two different corpora, over a 15 year period. I want to check if the two series are correlated or if the first series influences the second (i....
1
vote
1answer
26 views

How to set shape parameters for Johnson SU distribution in python scipy? [closed]

The Johnson SU distribution has 4 parameters ($\delta,\gamma,\lambda,\xi$), but scipy.stats.johnsonsu only has 2 parameters ($a,b$). Why the difference. how can I ...
1
vote
0answers
64 views

Unifying scale (1 to 10) represent user’s performance to standard across 100+ features

We are building a tool to assess the risk of language disorders in children. We have 600 participants (100 in each of the 6 age categories of 4 to 4.5, 4.5 to 5, and so on). This is the training data ...
0
votes
1answer
22 views

Understanding the Q-learning loss function?

Perhaps this can be explained a little more to me. I understand what's in literature but I'm struggling to understand why this is the preferred loss. If we have an agent that can move ↑↓→← and for ...
0
votes
0answers
19 views

Dynamic Regression model in Python [closed]

Is there a Python package available for doing Dynamic Regression where the $y$ variable depends on time lagged versions of $X$?
1
vote
0answers
13 views

Are there python codes for Frailty Models? [closed]

I want to model a time-to-event data using frailty and shared frailty models but can't find any python codes to execute it. Is there any available?
0
votes
0answers
15 views

Generate binary classification data in python?

Is there a simple way to generate binary classification data in python? I'd like to specify $X$ input parameter, $[x_1,...,x_n]$, and generate a dataset such that the (overall) McFadden's pseudo $R^2$ ...
0
votes
0answers
20 views

Constraint for multioutput regression model

I have some domain knowledge I want to use in a regression problem. Problem statement is the following: The dependent variables y are continuous. The multiouput variables are the following: y1, y2, y3....
1
vote
1answer
45 views

How to make a johnson unbounded transformation to make my data more gaussian like? in python

I am a novice in stats and I would like to transform my data (house prices) using a johnson unbounded distribution to look more gaussian. I looked at pandas transform() but I can't really understand ...
0
votes
0answers
7 views

A problem with a multilabel classification and custom loss function

I'm looking for some small ideas/advice about how I could proceed with the problem I have. I'm having difficulties creating a custom loss function for the problem I'm trying to resolve. My inputs are ...
1
vote
0answers
43 views

Estimating Joint Probabilities from Marginal Probabilities

Given 2 categorical variables and their marginal probabilities of variable C. What is a good simple way of estimating the joint probabilities? Let C be a Boolean T/F survey variable. For example: ...
0
votes
0answers
22 views

Including practical significance within significance tests? [closed]

bit confused about how to include practical significance within statistical significance tests. ...
0
votes
0answers
13 views

Regression with Radial Basis Functions

I am performing regression with radial basis functions as per the implementation below. The mean value corresponding to each column (M) of X2 (the feature representation matrix) is calculated by ...
0
votes
0answers
7 views

Measuring Inverse Relationship between 2 variables

I am having trouble deciding on the best test to use to measure if there is nonmonotonic or inverse relationship, would would be best test for this? to give an example if I want to see for facebook if ...
0
votes
1answer
15 views

Visually show the grouping of things based on relation

I'd like to visually show how certain IoT device's functionality is linked together through some sort of heat map or bubble graph (whichever is appropriate). I have a list of 50 devices, and each ...
2
votes
2answers
42 views

Getting the probability or accuracy from each prediction in random forest?

I have a random forest model to predict MLB player's fantasy points. I have the MSE and R^2 score, but I would like to know the accuracy of each individual prediction as opposed to the accuracy of the ...
0
votes
0answers
22 views

LSTM good test/validation performance but poor on unseen data for binary classification

I have 30k sequences of 8 letters that needs to be classified in X or Y depending on the relative position of letters in the sequence. The features are converted to numbers via a dict mapping and ...
1
vote
1answer
31 views

Fitting a random forest classifier on a large dataset

I am currently trying to fit a binary random forest classifier on a large dataset (30+ million rows, 200+ features, in the 25 GB range) in order to variable importance analysis, but I am failing due ...
0
votes
0answers
23 views

AB testing - normalizing for a group's historic performance [duplicate]

If you split traffic on a website in order to conduct an AB test, optimizing/ monitoring conversion, and you split users by evens/ odds, and have the following information before the test is conducted:...

1
2 3 4 5
69