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

Unsupervised deep learning image clustering

I'm interested in trying to apply my (very) limited understanding of neural networks to a problem of image clustering. I realise that NN's are mainly used for regression or classification problems ...
0
votes
0answers
16 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 ...
-3
votes
0answers
5 views

invoke pipeline functions in sklearn [on hold]

i want to invoke sklearn pipeline with a function to transform the sparse matrix output from feature extraction process to the guassianNB() classifier ...
-1
votes
0answers
5 views

Adaptive Linear Neurons (ADALINES) Algorithm Not Printing Graphs [on hold]

I am working on an ADALINE algorithm in python, and I am printing the graphs in the code, but when I run the program the graphs do not print. Any help with that or suggestions to improve the algorithm ...
0
votes
0answers
37 views

To call an api every minute from a URL, is R practically doable? Or would I need to do it in Python? [on hold]

I'm wondering if R is practical enough to call an api from a URL every minute and update the set of data. Would it be better use of my time to do learn and do it on Python instead of R? Thanks
0
votes
0answers
15 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
10 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
33 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
23 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
6 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 ...
-3
votes
0answers
93 views

I am learning advanced machine learning and would to build a machine learning library in python.Please help(For learning purposes only) [closed]

Need some resources like books,blogs etc. Like something on the lines of scikit learn.I just want build an ml lib to dig deeper into ml.Not trying "reinvent the wheel" Background about me:Have read ...
0
votes
0answers
29 views

tensorflow: How to feed numpy.ndarray? [closed]

I hope this is the right community to ask in. I decoded a JPEG image and have it in the shape n_samples x n_features as a two-dimensional numpy.ndarray. I feed this to tensorflow as following: ...
0
votes
1answer
22 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
4 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
0answers
3 views

forward wrapper feature selection method on python [migrated]

I've coded a decision tree for my dataset. I'm using the semeion.data which is found at https://archive.ics.uci.edu/ml/datasets/Semeion+Handwritten+Digit. Now I need to find out how to use ...
0
votes
1answer
34 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
141 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
11 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: ...
0
votes
0answers
22 views

Decomposing covariance matrix into row- and column- covariance, in python

Let's suppose I have a 3x3 matrix of means, mu, and a 3x3 covariance matrix, sigma. I'd like to draw samples from a matrix normal distribution, something like ...
0
votes
1answer
26 views

Neural Net Matrix Multiplication

I'm trying to figure out the matrix multiplications for the implementation of a single hidden layer neural net for MNIST digit recognition in Python. Like the following: ...
2
votes
1answer
36 views

Ensemble models perform worse than single one

In my model testing, I tried to use model ensembling (blending in this case) to get better results. However the ensemble cannot beat single RandomForrestClassifier. In first layer, I train ...
0
votes
0answers
56 views

Problem Training an LSTM network in Lasagne for simple task (determining parity of bit sequence)

I have been trying to gain some familiarity with the Lasagne libraries for machine learning, specifically LSTMs so I set up the following toy problem to determine the parity of a sequence of bits ...
2
votes
1answer
44 views

Making sense of Binominal GLM model

I have binominal data: For each of $x_i = 1,\ldots,49999$, I have the number of successes $s_i$, out of $n_i$ experiments. It so happens that $n_i = 50000-i$. Here is a plot of $s_i$: And here is a ...
2
votes
1answer
53 views

Logistic regression with binomial data in Python

This is probably trivial but I couldn't figure it out. I want to fit a logistic regression model, where my dependent variable is not a Bernoulli variable, but a binomial count. Namely, for each $X_i$, ...
1
vote
0answers
77 views

Generate code for sklearn's GradientBoostingClassifier

I want to generate code (Python for now, but ultimately C) from a trained gradient boosted classifier (from sklearn). As far as I understand it, the model takes an initial predictor, and then adds ...
0
votes
0answers
13 views

Order of input data gives different results

The background I am predicting binary target, class 1 is undersampled in ratio 5% to 95%. I have about 120 dimensions. So first I took all samples of class 1 and then roughly same number of class 0 ...
1
vote
0answers
19 views

Selecting correct settings for the order of Minkowski distance

I am looking to compute the distance between vectors of word frequencies (and I am new to this). I am trying out the Minkowski distance as implemented in Scipy. The documentation asks me to specify a ...
0
votes
0answers
32 views

Why doesn't my neural network learn on non linear relationships?

I've been trying to recreate and rework this this article that goes over creating a very basic neural network using a few techniques I've been learning from other sources and am hitting a bit of a ...
0
votes
1answer
25 views

Calculate Gini coefficient - Python

given a distribution of $\sigma^2$ ($y \sim LogN(\mu, \sigma^2$) I want to calculate the posterior distribution of the Gini coefficient which is given by: $G = 2\Phi(\frac{\sigma}{\sqrt{2}})-1$ ...
1
vote
1answer
49 views

GridSearchCV and KFold

I noticed that in some cases, a GridSearchCV is applied on the output of KFold. For example, like in the code below. Why is it needed? I thought that something equivalent to KFold is already applied ...
0
votes
0answers
12 views

Do you need to scale Vectorizers in sklearn?

I have a set of custom features and a set of features created with Vectorizers, in this case TfidfVectorizer. All of my custom features are simple np.arrays (e.g. [0, 5, 4, 22, 1]). I am using ...
0
votes
0answers
13 views

Genetic algorithm for solving the un-certain dimension problem

Introduction Last week, I have learned basic genetic programming using Python to solve a simple problem. I introduce it here: There is a city need for air quality monitoring network. The ...
0
votes
1answer
56 views

Python machine learning brute force [closed]

I have a dataset from which I try to predict one value. I tried linear regression, but it doesn't work. Is there an algorithm in Python which will compute a good statistical model (neural network) in ...
3
votes
0answers
61 views

“maximizing” logistic regression

Suppose I have some simple data for when someone buys or not buys something at a certain price, looking something like this: ...
0
votes
0answers
33 views

eval_set on XGBClassifier

can someone explain what does the eval_set parameter do on the XGBClassifier? I thought that by using eval_set, the algorithm would do some sort of grid search and find the best model to fit on train ...
0
votes
0answers
22 views

How to conduct experiment for binomial confidence interval?

I'm learning confidence intervals and want to prove that they work using experiments. For example to test confidence interval for the mean I've constructed the following function in python: ...
1
vote
1answer
37 views

Mixing exponential and linear regression with multiple predictors

This is the data set I am working on, trying to predict count (last column) : ...
0
votes
1answer
38 views

matched pairs in Python (Propensity score matching)

Is there a function in python to create a matched pairs dataset? e.g. ...
0
votes
0answers
76 views

Neural Network for Reverberation Decay Rate Prediction (Keras)

I'm not sure if this is the right place to post this question, sorry if it's not. Essentialy I’m trying to use a neural network to predict decay rate from a reverberant audio sample. I have taken a ...
1
vote
0answers
15 views

How to store a large graph? [closed]

When I try to develop a spelling collector, I realize if I can include the word background (etc:before and after word) into the bayes calculation, may be could increase this spelling collector ...
0
votes
1answer
28 views

How to output as unclassified object in svm multiclass classifier?

I am developing an image classifier using opencv,python.I am using svm from opencv. The image classifier classifies Animals,vehicles and Humans.It works fine.But when i give the image of 'nature ...
1
vote
1answer
29 views

Parameters setting in genetic programming to avoid locally optimum

I'm fresh on genetic algorithm. Now, I wrote an python program based on genetic algorithm. The programming contain: Set the population and individuals(For my case, each individual is a list ...
0
votes
0answers
28 views

Predicting of revenue. Penalized regression (Ridge regression)

I have data of sales. I've selected one point of sales to check a possibility of predicting revenue using regression method (I don't know what can I use in this task). First of all I've tried to find ...
0
votes
0answers
25 views

How to provide input to TSNE

I am using TSNE for the first time for dimension reduction. I have around 12 million records with 5000 distinct values. I want to perform dimension reduction (DR) so that I visualized those distinct ...
0
votes
1answer
39 views

Software for survival regression with interval censoring and frailty

I'm conducting regression analysis on sleeping time data. The data is survey data and the answer possibilities are of type "less than 4 h", "5 h", "6 h", etc. so they can be thought to be interval ...
1
vote
0answers
31 views

Modelling house energy production using month as a variable

I'm attempting to model the energy production of a set of houses for which data on temperature and daylight over 22 months is available. The data is arranged such as such: ...
1
vote
0answers
37 views

Gradient descent using Newtons method

I am implementing gradient descent for regression using newtons method as explained in the 8.3 section of the Machine Learning A Probabilistic Perspective (Murphy) book. I am working with two ...
0
votes
0answers
35 views

How to standardise linear regression

I have a set of death rates (that range from about 0.1 to 0.5), a set of body weights (that range from about 2 to 80), and I want to calculate standardised residuals for the death rates after ...
1
vote
0answers
34 views

How do I add cross validation for a random forest regression?

The error percentage of regression changes with change in the train and test data which I am deciding randomly. Cross validation can overcome this but how do I apply it for my regression model?
1
vote
0answers
11 views

How to find slope of time series variable [migrated]

I have a time series data similar to this ...