How can I plot a dendrogram right on top of a matrix of values, reordered appropriately to reflect the clustering, in Python? An example is the following figure:
https://publishing-cdn.elifesciences.org/07103/elife-07103-fig6-figsupp1-v2.jpg
I use scip...

Asked By user248237

How can I plot a dendrogram right on top of a matrix of values, reordered appropriately to reflect the clustering, in Python? An example is the following figure:
https://publishing-cdn.elifesciences.org/07103/elife-07103-fig6-figsupp1-v2.jpg
I use scip...

Asked By user248237

I have a multi class classification problem and my dataset is skewed, I have 100 instances of a particular class and say 10 of some different class, so I want to split my dataset keeping ratio between classes, if I have 100 instances of a particular class...

Asked By JackNova

I have some data I'm trying to organize into a DataFrame in Pandas. I was trying to make each row a Series and append it to the DataFrame. I found a way to do it by appending the Series to an empty list and then converting the list of Series to a DataFr...

Asked By O.rka

I have some data I'm trying to organize into a DataFrame in Pandas. I was trying to make each row a Series and append it to the DataFrame. I found a way to do it by appending the Series to an empty list and then converting the list of Series to a DataFr...

Asked By O.rka

I tried this but couldn't get it to work for my data:
Use Scikit Learn to do linear regression on a time series pandas data frame
My data consists of 2 DataFrames. DataFrame_1.shape = (40,5000) and DataFrame_2.shape = (40,74). I'm trying to do some typ...

Asked By O.rka

TensorFlow MNIST example not running with fully_connected_feed.py
I checked this out and realized that input_data was not built-in. So I downloaded the whole folder from here. How can I start the tutorial:
import input_data
mnist = input_data.read_data...

Asked By O.rka

TensorFlow MNIST example not running with fully_connected_feed.py
I checked this out and realized that input_data was not built-in. So I downloaded the whole folder from here. How can I start the tutorial:
import input_data
mnist = input_data.read_data...

Asked By O.rka

Let's say I have a 1d numpy array
a = array([1,0,3])
I would like to encode this as a 2d 1-hot array
b = array([[0,1,0,0], [1,0,0,0], [0,0,0,1]])
Is there a quick way to do this? Quicker than just looping over a to set elements of b, that is.

Asked By James Atwood

I am very new to matplotlib and am working on simple projects to get acquainted with it. I was wondering how I might plot the decision boundary which is the weight vector of the form [w1,w2], which basically separates the two classes lets say C1 and C2, u...

Asked By anonuser0428

Does tensorflow have something similar to scikit learn's one hot encoder for processing categorical data? Would using a placeholder of tf.string behave as categorical data?
I realize I can manually pre-process the data before sending it to tensorflow, b...

Asked By Robert Graves

How do you calculate a best fit line in python, and then plot it on a scatterplot in matplotlib?
I was I calculate the linear best-fit line using Ordinary Least Squares Regression as follows:
from sklearn import linear_model
clf = linear_model.LinearRe...

Asked By Zach

How do you calculate a best fit line in python, and then plot it on a scatterplot in matplotlib?
I was I calculate the linear best-fit line using Ordinary Least Squares Regression as follows:
from sklearn import linear_model
clf = linear_model.LinearRe...

Asked By Zach

I am trying to evaluate a multiple linear regression model. I have a data set like this :
This data set has 157 rows * 54 columns.
I need to predict ground_truth value from articles. I will add my multiple linear model 7 articles between en_Amantadin...

Asked By Batuhan Bardak

I was wondering if there are classifiers that handle nan/null values in scikit-learn. I thought random forest regressor handles this but I got an error when I call predict.
X_train = np.array([[1, np.nan, 3],[np.nan, 5, 6]])
y_train = np.array([1, 2])
c...

Asked By anthonybell

Possible Duplicate:
Text Classification into Categories
I am currently working on a solution to get the type of food served in a database with 10k restaurants based on their description. I'm using lists of keywords to decide which kind of food ...

Asked By Dieter

Possible Duplicate:
Text Classification into Categories
I am currently working on a solution to get the type of food served in a database with 10k restaurants based on their description. I'm using lists of keywords to decide which kind of food ...

Asked By Dieter

Can anybody explain why is loc used in python pandas with examples like shown below?
for i in range(0, 2):
for j in range(0, 3):
df.loc[(df.Age.isnull()) & (df.Gender == i) & (df.Pclass == j+1),
'AgeFill'] = median_ages[i,j]

Asked By kenway

I'm getting a few errors here but I think it's due to pandas not importing as it's greyed out. If that is the problem, how would I fix this?
C:\Anaconda\python.exe
C:/Users/nickd/Documents/SKLEARN-STOCKS/stock-mach.py Traceback (most
recent call l...

Asked By Nick Duddy

I would like to plot the ROC curve for the multiclass case for my own dataset. By the documentation I read that the labels must been binary(I have 5 labels from 1 to 5), so I followed the example provided in the documentation:
print(__doc__)
import nump...

Asked By john doe