Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options questions only not deleted user 92493

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

10 votes
1 answer
15k views

Why are all Lasso coefficients in model 0.0?

I'm using from sklearn.linear_model import Lasso in Python 2.7.6 I wrote a script that I've used for doing a Lasso regression for my Features (X) and my Targets (y) . …
O.rka's user avatar
  • 1,502
13 votes
1 answer
75k views

How to correctly compute mutual information (Python Example)? [closed]

def shannon_entropy(A, mode="auto", verbose=False): """ https://stackoverflow.com/questions/42683287/python-numpy-shannon-entropy-array """ A = np.asarray(A) # Determine distribution …
O.rka's user avatar
  • 1,502
2 votes
0 answers
2k views

How does Principal Coordinate Analysis (PCoA) work, as compared to PCA? [duplicate]

Here's some Python 3 code I made to do PCA. …
O.rka's user avatar
  • 1,502
8 votes
1 answer
13k views

When should I use `scipy.stats.wilcoxon` instead of `scipy.stats.ranksums`? [duplicate]

I've been using http://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.wilcoxon.html but then I realized that there is http://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.ranksums …
O.rka's user avatar
  • 1,502
5 votes
1 answer
2k views

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

I thought the best way to understand this would be to code it myself using the datasets in scikit-learn (Python 3.5.1). …
O.rka's user avatar
  • 1,502
6 votes
2 answers
4k 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. …
O.rka's user avatar
  • 1,502
0 votes
2 answers
854 views

Reversing "mean-centered" parameters in a multiple linear regression

I'm reading "Bayesian Analysis with Python" by Osvaldo Martin (great read btw) and in his hierarchical linear models section he often mean-centers the data and the reverses it. … The author implements it in Python 3.5 using a module that is up and coming called pymc3. Here is the code excerpt below: alpha_tmp is the alpha when X is mean centered. …
O.rka's user avatar
  • 1,502
2 votes
1 answer
166 views

How to structure this problem in a bayesian paradigm? (Updating the posterior?)

label=i) legend_kws = {'bbox_to_anchor': (1, 0.5), 'edgecolor': 'black', 'facecolor': 'white', 'fontsize': 10, 'frameon': True, 'loc': 'center left'} ax.legend(**legend_kws) Versions: Python
O.rka's user avatar
  • 1,502