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 ...

learn more… | top users | synonyms

0
votes
0answers
8 views

How do I have select features which are influential for prediction?

I have a dataset which has dependent variable(label) as possible destinations and independent variable(features) as age,language, gender and many other categorical variables. How do i find which are ...
0
votes
0answers
21 views

Inverse PCA Whitening - get the data back into its original space

I'm currently performing the following PCA-whitening in Python: ...
0
votes
0answers
12 views

How to deal with the missing data in stan? [on hold]

I am a newbie to stan and I am implementing the probabilistic matrix factorization model. Given a user-item rating matrix: ...
0
votes
0answers
11 views

Average conditional variance

Related to Explanatory power of variable. Given a data for 1d variable $Y$ and multidimensional variable $X$, what is the best way to compute average conditional variance of $Y$ given $X$: $$ \Bbb ...
1
vote
1answer
19 views

Random forest low score on testing data (scikit-learn)

I am trying to train my model using Scikit-learn's Random forest (Regression) and have tried to use GridSearch with Cross-validation (CV=5) to tune hyperparameters. I fixed ...
0
votes
0answers
8 views

Correlation of data with varying trends

So I have a set of data that is not necessarily constantly increasing/decreasing relative to a parameter, but can show wave-like pattern, and even chaotic behaviours. Here are to examples, one ...
1
vote
0answers
35 views

linear regression after rotation

I have a set of 2 dimensional points [x,y], with a barycenter in 0,0 and I'm rotating it. I'm wondering why the linear regression of this set of points is not rotating of the same amplitude. Below ...
0
votes
0answers
19 views

Version of Python to use for a new analysis framework? [closed]

I'm working on a new project where I'll be building a framework for data analysis, and I'd like to use python for some of it. It's been a while since I've used python, as I've been using R for the ...
0
votes
0answers
23 views

Struggling to train a MLP using Keras (Python)

I've been interested in NNs for a while, just started playing with them. I liked the look of Keras, so I got started with some toycode to do some regression. I tried the simplest set up I could: ...
1
vote
2answers
46 views

Is decision tree output a prediction or class probabilities?

A Random Forest works by aggregating the results of many decision trees. Recently, I was reading about how the RandomForest aggregates the results, and it made me question whether the results from ...
0
votes
0answers
26 views

Distribution with known mean and bounds, but unknown standard deviation

Let's say I wanted to construct a distribution where based on more anecdotal evidence then actual given data sets. For example. lets say I think that I think the value $K$ is anywhere between 9% and ...
-1
votes
0answers
17 views

Automatic mail classification

I'm building a mail classifier in Python 3. I've successfully built classifier to classify spam/ham using SVM (LinearSVC to be precise) using scikit-learn. But the next challenge is to auto bucket the ...
1
vote
0answers
25 views

Advice for Modeling a Rare Response (y)

My Question 1: Is it possible to create a "good" predictive model with only 40/100,000 rows of data containing a "y" (response) value greater than or equal to 1? My Question 2: Is it a better idea ...
0
votes
1answer
18 views

Logistic regression using ANOVA kernel in SKLearn?

In RapidMiner, you can run a logistic regression classifier with multiple kernel types. I see no options in sklearn.linear_models.LogisticRegression. Does anybody ...
0
votes
0answers
20 views

Online weighted covariance

I'm trying to calculate a covariance matrix using weighted data in a single pass, and I'm not sure that I'm doing it correctly. I found a wikipedia article which gave the following python* code: ...
1
vote
2answers
56 views

Weighting time series data for prediction

I am building a simple random forest to predict soccer results in sckit. I simply train the model to predict each teams score based on various features. However I am trying to think how I can weight ...
1
vote
1answer
29 views

Mutual info via binning gives non-zero results for independent variables

I'm trying to calculate mutual information in Python, using numpy. My implementation so far is: ...
1
vote
0answers
16 views

Conditional distribution/expectation shape

Let's say I have two arrays $X$ and $Y$ of the same length, and suppose that $Y$ has binary data, that is $y \in \{0, 1\}$ for ever $y\in Y$. I would like to plot probability of $y = 1$ given $x \in ...
0
votes
0answers
22 views

Calculate Confidence (Error) Bands for Chi Square fit with errors using Iminuit

I want to fit some data with errors to a polynomial, say $y(x)=a+bx$. I made a $\chi^2$-fit using Iminuit but now I want to calculate the error bands ( 68,3% Confidence Bands). What is the fastest way ...
0
votes
0answers
17 views

Why isn't this auto encoder working?

I am trying to write an autoencoder using Python and Theano. I am using synthetic 1 dimensional data. There are 2 classes of data. The first class contains increasing data points plus noise. The ...
0
votes
0answers
25 views

Out of Sample Cross Validation - Accuracy and Confusion Results

I have a scenario where I validate a trained model on an out of sample set - such that I begin by splitting the entire data set to train/test set. X_train, y_train, X_test, y_test. Then use ...
0
votes
1answer
43 views

Outlier filtering in 2D data in python

I have following data given: My curve fits it acceptable for my needs. I use here 4th degree polynomial. (data is limited to 0-100 percent range for both axis!) What I want to try now is to filter ...
0
votes
0answers
17 views

Apply PCA on classification data, category wise or on complete dataset?

I have a classification related image data with 15 different classes and each class has five feature sets. Those five feature sets comprise of colour features, sift features etc.. upto 5 different ...
1
vote
0answers
34 views

Relationship between CLT for estimator of sample and number of combinations for subsample?

What is the relationship between the Central Limit Theorem as applied to the expected value of an estimator of a parent sample and the number of possible combinations of a subsample used to calculate ...
0
votes
0answers
20 views

Why SVR kernels other than 'linear' don't work for this toy dataset!

I'm a little new with modeling techniques and I'm trying to compare SVR and Linear Regression. I've used f(x) = 5x+10 linear function to generate training and test data set. Here we've discussed why ...
0
votes
0answers
8 views

Numerical POS tag training in nltk (python)

This is a follow-up question to my previous question posted here. To create a natural language calculator, I tried TrigramTagger from nltk. For training, I want to tag multiplication and 2 numbers. ...
0
votes
0answers
10 views

How do I mine text data for a list of “unspecified keywords” from a bunch of documents?

I need analytics on "skills" from a bunch of documents. The straightforward way for me is to first create a dictionary of "skills keywords" and then get descriptive analytics from the documents i.e. ...
1
vote
1answer
52 views

Variance of a portfolio

In this blog post the author mentions the following: [... Given several arrays holding returns for a portfolio], one should calculate the standard deviation via the following function call: (1) ...
0
votes
0answers
43 views

find outlier in 1D array

I have a satellite images, which have none values (which are not all equal to 0) on right and left side of an image and it is not a strait line. I would liked to write a program, which finds the ...
1
vote
1answer
28 views

Which 1D graphical pattern recognition algorithm can I use to find similar, fuzzy patterns?

I have data in form of a grayscale bitmaps. The x axis represents different instances and the y axis represents time. For example each pixel's gray value could represent the number of bytes ...
1
vote
1answer
121 views

minimizing total travel time [closed]

Green circles are salesman and A-B-C are destination points. I need to move green circles so that total travelled time should be minimum and each salesman should go to a different point. So ideal ...
0
votes
0answers
25 views

Recommendation System in Python - weighted average with negative factors

I am building a recommendation system in python on the 100k movielens dataset. My code build a movie/user matrix where the (x,y) element is the rate that the user y gave to the movie x. Since i want ...
1
vote
0answers
38 views

Convert latex mathematics equations directly to Python/Matlab Code? [closed]

I am wondering if there is any technique to convert latex mathematics equations directly to code, like Python(numpy,scipy), Matlab? Thanks! I have this problem since I find I sometimes make mistakes ...
0
votes
0answers
28 views

Ensembling with VotingClassifier

I am using VotingClassifier from sklearn.ensemble however i am puzzled with the results. Consider following algorithms: ...
0
votes
0answers
42 views

Curve Fit with logarithmic Regression in Python

I need to find a model which best fits my data. It's look like this: So I thought about logarithmic regression. But when I try to make a simple fit in python I get the following result: My code ...
1
vote
1answer
48 views

How to Illustrate correlation in binary classification

I ran a correlation in a binary classification problem between one variable and the prediction to determine whether a linear correlation exists. The code: ...
1
vote
1answer
58 views

Cross-validation vs random sampling for classification test

I usually have used cross-validation for testing classification performance. However, I read about the article that random sampling (bootstrapping) works better in many cases. I am not sure which one ...
0
votes
1answer
18 views

Prediction of unknown triples for relational learning tasks using RESCAL

Background: I am focusing on a relational learning task, where links between entities are predicted across several relations. An example of a relation in this task is if two entities have the same ...
1
vote
1answer
49 views

two ways of predicting a categorical variable?

I'm working on a machine learning problem where I have to predict a categorical variable that has 12 different values, lets say A, B, C and so on.. (one thing I should mention is that one of the ...
5
votes
1answer
64 views

how does multicollinearity affect feature importances in random forest classifier?

I have a random forest binary classifier, but the results from the feature importances are somewhat erratic. Here's what I want to know: Does multicollinearity ...
0
votes
0answers
16 views

how to write down dynamical state space models with deterministic variables in PyMC?

is it possible to write down this simple dynamical system in pymc? $R_0 \sim Normal(\mu_r, \sigma_r)$ $Z_0 \sim Normal(\mu_z, \sigma_z)$ $R_t \sim Normal(R_{t-1}, \sigma_r)$ $Z_t = Z_{t-1} + ...
0
votes
1answer
41 views

K-fold in grid-search for linear svm C parameter giving same value?

So every time I do a GridSearchCV with KFold, stratified or not, I get the same accuracy score and STDev for values of C=1,C=10, and C=100. I then did a special ...
0
votes
0answers
48 views

Natural language calculator using machine learning

What machine learning algorithm should I use here (python)? I wish to create a natural language maths calculator. To start, I will focus only on multiplication of 2 numbers. For example: for all ...
2
votes
0answers
23 views

Can I replace traditional DSP with statistical methods

I work a lot with noisy time traces with usually 2.5e6 data points and sampling frequency ~ MHz. I usually apply some "traditional" digital signal processing utilities like low/high-pass filters to ...
1
vote
0answers
38 views

Single CV yields higer prediction error estimate compared to nested CV

I'm trying to calculate an unbiased prediction error estimate for a regression problem with random forest. Dataset dimension is ~25100x13. So, as a first step, I used a nested 10/10-fold CV loop ...
1
vote
1answer
45 views

What do fsolve in this machine learning task? [closed]

I am reading this book Building Machine Learning Systems with Python and can not understand what function "fsolve" do in eample. In example I have test data data and I built the model. My model is ...
3
votes
0answers
61 views

Gaussian-Process (scikit-learn) Prediction Confidence Interval Oddities - Stats Question

I'm doing some particle physics analysis and was hoping someone out there could give me some insight on a Gaussian-Process fit I'm trying to use to extrapolate some data. I have data with ...
1
vote
2answers
67 views

Clustering with categorical and numeric data [duplicate]

I frequently come across data sets that have both categorical and numeric data. I think this is just a fact of life where the data is not all in one category. I'm basically trying to find some ...
2
votes
1answer
24 views

How do the elements of a covariance matrix differ from individual covariances?

In particular, I get this when I use numpy: ...
1
vote
0answers
11 views

How do you factor covariates into your hidden markov model?

I am currently implementing a Hidden Markov Model in Python and would like to add covariates to my model. There are 2 categorical covariates each covariate can take up to 4 values. For each ...