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

2
votes
0answers
14 views

Scikit-learn's SGDClassifier code question

I have a question regarding the code of function SGDClassifier, from library scikit-learn, which implements linear ...
1
vote
0answers
14 views

CCA: compute estimated (x,y)-coefficients from the output of sklearn.cross_decomposition.CCA [migrated]

Consider this token CCA (canonical correlations) example in R: ...
0
votes
0answers
21 views

Unexpected result when determining polynomial degree

I'm trying to determinate the best polynomial degree fits my dataset so I coded the follow script using LinearRegression with sklearn ...
0
votes
0answers
14 views

kNN bad performance for iris data set

I've implemented kNN algorithm in Python and now I'am testing it on iris data set. I have two questions. The performance seems to be bad: if I run the program 100 times and then calculate the ...
0
votes
1answer
39 views

Using Linear Regression on text data

Im trying to create a model that predicts an authors age. Im using (Nguyen et al,2011) as my basis. Using a Bag of Words Model I count the occurences of words per Document (which are Posts from ...
0
votes
1answer
17 views

how to classify short text sentences?

I have a very large dataset that looks like ...
0
votes
0answers
4 views

What does quantile parameter represent in estimate_bandwidth during Mean Shift Clustering?

I was doing Mean Shift clustering in a set of data with Python Scikit learn.We need to estimate bandwidth during Mean shift clustering.But what does the parameter quantile in the function ...
0
votes
0answers
20 views

Jensen Shannon Distance Bounds

I am calculating and graphing various distances between probability distributions. I am really confused about the bounds of the Jensen-Shannon Distance. I read somewhere that the Jensen-Shannon ...
3
votes
2answers
86 views

Optimize starting parameters for Bayesian Linear Regression?

I'm using PyMC3 in Python 3 and I'm not sure exactly how to optimize my starting parameters. The example uses the regression ...
0
votes
0answers
12 views

Neural Network - Learning accuracy drops heavily after a couple of epochs

I designed a neural network to classify some images into 28 classes. Here are the parameters : Weight Decay : 0.005 Momentum : 0.01 Learning Rate : 0.001 and 0.005 Learning Decay : 1 Input : 100x100 ...
0
votes
0answers
11 views

Critical point in time series and pattern comparison

I have some data from a recent experiment. Two factors, each had 2 levels, resulting in 4 conditions. In each condition there were 12 participants, so 48 participants in total. Each participant ...
1
vote
3answers
16 views

What statistical method should I use to filter out the correct point?

My project is in the field of image processing. The output of a certain program would print the x and y coordinates in the image. I calculate the arithmetic mean of the points to get the mean ...
0
votes
1answer
23 views

How to proper evaluate the PDF of a Beta Distribution?

On page 40 of "Think Bayes - Bayesian Statistics Made Simple", Allen evaluates the PDF of the Beta distribution as ...
0
votes
0answers
12 views

Non-linear least square minimization using for three-dimensional data [closed]

I have a 3D data and I would like to fit a non-linear model to the data using lmfit. This is the code I have written but it doesn't work. ...
0
votes
0answers
15 views

Example usage (in Python) of Kalman Filter as it pertains to BASKET trading

I've found plenty of examples in Python of the Kalman Filter as it pertains to PAIRS trading, but what I'm really interested in are examples of how it can be applied to BASKET trading. Without a ...
0
votes
0answers
32 views

Scaling the data in a decision tree changed my results?

I know that a decision tree doesn't get affected by scaling the data but when I scale the data within my decision tree it gives me a bad performance (bad recall, precision and accuracy) But when I ...
0
votes
1answer
18 views

SOM based on a not euclidean distance

Suppose one has trained a SOM on a certain number of data. Without explaining all the procedure, one can say that the SOM algorithm produces a certain number of prototypes and the new elements coming ...
-1
votes
0answers
10 views

Implementation of Meila's VI criterion in Python? [closed]

I am doing some clustering experiments and came across this paper by Marina Meilă in the Journal of Multivar Statistics, where she presents a very interesting metric for evaluating clusterings called ...
0
votes
0answers
13 views

Calculating the likehood from the coeficients of logistical regression

I am doing a logistical regression and need to calculate the likehood from the null model and from each feature model and to after that get the p-value.The problem states: a) Create a model that ...
0
votes
0answers
7 views

XGBoost on Python: Plot performance

following the instructions from https://xgboost.readthedocs.io/en/latest/python/python_intro.html after building my model, i tried on Jupyter (using Mac OS X, Chrome browser) ...
0
votes
0answers
4 views

Why does this LexRank algorithm take so long? [migrated]

I want to classify a corpus of jazz music, in MIDI format. For each song, I have a csv file with note length and pitch information. I represented this data in $n$-gram format ($n=3$). Next, for each ...
0
votes
0answers
6 views

how to convert to a list in python [migrated]

I am trying to convert a set to a list in Python I'm using this syntax: maxi=np.max(A) #maxi=np.ndarray.max(s) print("max number of s is ", maxi ," .") index=np.argwhere(A==maxi) However, I get ...
0
votes
0answers
6 views

Cross validation of dataset separated on files [migrated]

The dataset that I have is separated on different files grouped on samples that know each other, i.e., they were created on similar conditions on a similar time. The balance of the train-test dataset ...
0
votes
1answer
18 views

XGBoost on Python

Hi could someone explain what the num_round parameter is for ? it is not well explained in the official doc http://xgboost.readthedocs.io/en/latest/python/python_intro.html on that page, a (typical ...
0
votes
0answers
9 views

Swift Client with DecisionTreeRegressor

I am working with bluemix object storage container, What i want to do that i want to store my "RandomForestRegressor" into a pkl file with joblib. But when i run the code with the Swift client i ...
0
votes
0answers
22 views

Generating training data for face recognition

I'm in the process of learning Machine Learning and like to do some hands-on experiments. I thought I'd take photos of friends and colleagues to see if I can create a face recognition model from ...
0
votes
1answer
30 views

How to deal with Features having high cardinality

I am building a simple classification model, the classification model is used for identifying negative or positive feedback on a ticketing system. The tickets have alot of categorical data with high ...
-1
votes
0answers
16 views

Implementing Breusch-Pagan using stats plm [on hold]

I'm working on implementing a Breusch-Pagan test: ...
2
votes
1answer
127 views

PyMC3; create simple Linear Regression model with real-world datasets

The Linear Model I understand the concepts of Bayesian Inference in that the observed data, $x$, is fixed, and the parameters, $\theta$, are the random variables that follow a particular ...
0
votes
0answers
28 views

Probabilistic Graphical Model - Modelling a Bayesian Network on Real Life Data

Recently, I have started studying about Probabilistic Graphical Models (PGMs). While the examples provided in the textbook essentially convey the message of what and how things are happening, I am ...
0
votes
0answers
10 views

Approximating KL-Divergence for 2-D Random Variables with Scatter Plots

I have lots of experience computing KL divergences for straightforward discrete distributions where I have access to complete probability tables, etc. But I'm a little concerned about my current ...
1
vote
0answers
16 views

Simulation and visualization libraries for reinforcement learning in python?

I am aware of keras, block n a few others Python libraries for nn which do RL among others. But is there a library than can make the task of visualizations easy? In terms of 3D model of ...
0
votes
0answers
10 views

Powerlaw fitting with zeroes. Is this not the case?

As a result of a computation process which I cannot describe due to lack of time, I have obtained two datasets that I will simply call X and ...
1
vote
1answer
106 views

AlexNet implementation in Tensorflow not converging, huge loss

I implemented the AlexNet Oxford 17 Flowers example from the tensorflow API tflearn using the CIFAR10 source code from TensorFlow. Like described in the paper of Alex Krizhevsky ("ImageNet ...
4
votes
2answers
302 views

Replicating a linear regression example from Hastie, Tibshirani and Friedman

One of the standing examples in the book The Elements of Statistical Learning by Hastie, Tibshirani and Friedman (hereafter referred to as HTF) uses prostate cancer data (available here and described ...
0
votes
1answer
17 views

Increase sample size via algorithm [closed]

If I have a normally distributed dataset with a sample size of 100, what algorithms/procedures can I implement to increase the sample size to 1000?
0
votes
1answer
40 views

I need someone to check my conditional probability calculation function

I am following the book "Think Stats. Probability and Statistics for Programmers" and doing the exercises using numpy + pandas. Currently I am on exercise 2.7 on conditional probability: Exercise ...
0
votes
1answer
103 views

Keras, how does SGD learning rate decay work?

If you look at the documentation http://keras.io/optimizers/ there is a parameter in the SGD for decay. I know this reduces the learning rate over time. However, I can not figure out how it works ...
0
votes
0answers
19 views

Need new strategy for single class classifier

I am attempting to create a single class classifier where the classes are fairly close to balanced (+/- 25). My dataset has ~2,800 samples and ~1,100 features. All of the features are binary except ...
0
votes
0answers
24 views

Random Forest: Strange Feature Importance Results for Constant Variables

I've been using the RandomForestClassifier in python's Sklearn package to assess the importance of the features in a large dataset with features that are both binary and continuous. I've done quite a ...
0
votes
0answers
13 views

Eliminating normal values from a data list

I have such data: The range of data is between 1-350000. When I plot the data within the range 1-1000; I have such a graph. Basically, I want to eliminate the values which are normal, like ...
0
votes
1answer
38 views

Neural network can only follow increasing function

I am trying to program a simple neural network using python. For some reason my code is only working on functions which are increasing. The network I am using has 1 input, 1 output, and 2 layers of ...
0
votes
1answer
67 views

How to interpret hausman test results?

I'm trying to do 2 stage least squares regression in python using the statsmodels library. ...
0
votes
0answers
9 views

How to parallel SGD procedure?

I am doing some machine learning works with SGD to optimization the score function. I found that in each epoch, the task of each mini-batch is independent . We can save the grad of the parameter in ...
0
votes
1answer
32 views

Sample from a Normal-Inverse-Chi-Squared distribution

Is there a way to draw samples from the following distribution in Python? Unfortunately I wasn't able to find helpful information in the scipy help.
0
votes
0answers
5 views

Fuzzy matching to reference table

I am trying to match non-standard medical diagnosis description to ICD10 reference table description to get ICD10 code. The will be fuzzy matching. for example, I would like to match "TRANSIENT ...
0
votes
1answer
49 views

Random Forest model good train and test performance but bad “real world” performance

I am working on a classification problem where I need to classify objects based on a visual data. There are a couple hundred different classifications to be made and I have around a million plus ...
6
votes
1answer
150 views

Is PCA a non-linear transform?

In the article Relative Information Loss in the PCA, the authors make, at some point (in the introductory section), the following statement: In case the orthogonal matrix is not known a priori, ...
0
votes
0answers
17 views

Categorical mixture model in PyMC2

I am currently trying to implement a simple categorical mixture model in PyMC2. However, I am not able to get it to run after trying some possible solutions. Here is my current attempt: ...