Machine learning framework for Python.

learn more… | top users | synonyms

0
votes
0answers
7 views

Python Scikit-learn CountVectorizer throwing ValueError: empty vocabulary

I'm trying to extract features from a text document. Here is my code: import sklearn from sklearn.datasets import load_files ...
0
votes
0answers
8 views

scikit learn gaussian mixture conditional distribution

I am using scikit-learn to fit a Gaussian Mixture Model to a dataset. However, I now need to find the distribution conditional on one or more variables and I have not found a way to do that. Can ...
0
votes
0answers
20 views

RandomForest Classifier With Very High Success Rate

I'm having a weird problem that may suprise you all. My classification rate is too high on my test set. I'm using scikit-learn packages, and I'm very suspicious of these classification rates, as they ...
1
vote
2answers
51 views

Ensemble of different kinds of regressors using scikit-learn (or any other python framework)

I am trying to solve the regression task. I found out that 3 models are working nicely for different subsets of data: LassoLARS, SVR and Gradient Tree Boosting. I noticed that when I make predictions ...
0
votes
1answer
18 views

Does mahalanobis() function in covariance estimators (scikit) really assumed centered observations?

I want to test the various covariance estimators implemented in scikit-learn (for outlier detection). Each of these methods implement a mahalanobis(observations) function. The doc says: ...
0
votes
0answers
16 views

Is this a correct way to do document classification using topic modeling?

I am using LDA to extract topics. I want to do topic modelling and use the topics as features to do document classification. I am proposing the below approaches using scikit-learn. I want to know ...
0
votes
0answers
7 views

What is the fastest way to get the document term matrix in scikit learn?

I am using scikit learn CountVectorizer on top of ~11K documents, each of size ~5000 words. It takes ~ 1 hour to generate the tdm (document term matrix). Is there a much faster way to generate the ...
0
votes
0answers
14 views

sklearn - Multinomial Naive Bayes (data too big???!!!)

I wanted to really understand the rationale behind the following code as written in python sklearn's manual partial_fit(X, y, classes=None, sample_weight=None) when the data is too big to fit in ...
1
vote
0answers
34 views

Classifying classifiers

Is there a way of exploring similarities among classifiers that have been trained on datasets that have different features? For example: I train several linear SVMs (though it could be any ...
0
votes
0answers
27 views

Why does Support Vector Regression slow down after several iterations?

TLDR: Why does SVR slow down on my machine after multiple runs in IPython/sklearn? I'm trying to grid-search to optimize some parameters in Support Vector Regression with a problem that has 2 ...
0
votes
0answers
15 views

Obatining PCA residusals in Python's scikit-learn [migrated]

I'm using scikit-learn to conduct PCA on a large dataset with the goal of removing large, common sources of variance from a matrix X. Thus, I'd like to produce a ...
0
votes
0answers
14 views

Regression: Predicting values over orders of magnitudes - what metric(s) to use?

What is a good metric to use for predicting values over several orders of magnitude? I can use R^2 but other measures like mean absolute error or mean squared error are pretty meaningless. In my case ...
0
votes
0answers
12 views

How to find the probalities of a,b,c (mutually exclusive events) when i turn the problem into three binary classification problems?

I am using scikits linear logisitc regression to classify three events a,b and c. it works better (score) when i convert them into a binary classification model. such as: 1. M1 classifies a or b 2. ...
1
vote
0answers
13 views

Getting probability of each new observation being an outlier when using scikit-learn OneClassSVM

I'm new to scikit-learn, and SVM methods in general. I've got my data set working well with scikit-learn OneClassSVM in order to detect outliers; I train the OneClassSVM using observation all of which ...
0
votes
0answers
21 views

SVM for an unbalanced textual dataset?

I have a text classification task, currently I can classify the data with very poor precision. This are the scores: ...
0
votes
0answers
4 views

Prepare data for scikit-learn [migrated]

I am working on a small NLP project of authorship attribution: I have some texts from two authors and I want to say who wrote them. I have some pre-processed text (tokenized, pos-tagged, ect.) and I ...
0
votes
1answer
59 views

Implementation of nested cross-validation

I'm trying to figure out if my understanding of nested cross-validation is correct, therefore I wrote this toy example to see if I'm right: ...
1
vote
0answers
27 views

Feature space reduction for tag prediction

[x-post] from stackoverflow. I am writing a ML module (python) to predict tags for a stackoverflow question (tag + body). My corpus is of around 5 million questions with title, body and tags for ...
0
votes
0answers
12 views

Apply Cross Validation to a prediction linear regression model

Hello I am slightly confused on how to apply a k-fold cross validation to a prediction linear regression model. Also how can i look at the data that the prediction model outputs before i apply cross ...
0
votes
1answer
33 views

Weekly data normalization - Python

I have a weekly dataset and I have to normalize this data. Data is something like this : ...
0
votes
1answer
44 views

Questions about weather prediction in scikit learn

Hello I am a high school student doing research on weather. I have a dataset that has four columns each labeled with time, pressure, and lat/long. I am confused on the cross validation process. What ...
0
votes
0answers
30 views

How to do ranking with scikit-learn random forest model

I have a training dataset that I've developed, that has the following format: ------------------------------ | User ID | Item | Label | ------------------------------ | 001 | umbrella | 0 ...
-1
votes
1answer
60 views

Prediction on multiple regression - Python

I have 3 list of value and 1 ground truth data. They all belongs to the same time series. My purpose is with 3 list try to forecast the ground truth data. For example : ...
0
votes
4answers
78 views

In practice, why do we convert categorical class labels to integers for classification

This might be a naive question, but I am wondering why we (or maybe it's just me) are converting categorical class labels to integers before we feed them to a classifier in a software package such as ...
0
votes
1answer
31 views

Regression with a kernel

I have a fixed kernel and a set of points. I do SVC with the flavor of SVM classification i'm working on (assume it's just a regular SVM) and i obtain a classifier represented by an explicit vector of ...
0
votes
0answers
31 views

PCA and cross-validation [duplicate]

I am fairly new to the machine learning, and I have been going over all the great posts about cross-validation today and I have a question regarding PCA and cross-validation, I don't have enough ...
0
votes
0answers
32 views

Can you add the probabilities of a classifier to better predict an outcome? [duplicate]

Say I am interested in predicting the TOTAL number of people that survive the titanic disaster, NOT each individual who died. Is it possible to run a probabilistic classifier on the data getting a ...
1
vote
1answer
81 views

Is a negative OOB score possible?

I'm currently implementing scikit-learn's RandomForestRegressor in Python and am scratching my head over why I have occasionally wound up with negative out-of-bag scores from it. As far as I can tell ...
0
votes
1answer
15 views

Anomaly classification probability on Machine Learning

I am using features to predict a dataset classification. I have use the Gradient Boosting Classifier of scikit-learn for the prediction and tune it to reduce the error classification. The error ...
0
votes
0answers
21 views

Normalization of Naive Bayes output

In Scikit-learn documentation it is possible to see that the MultinomialNB estimator has a method called predict-proba in which it has the following description: "Returns the probability of the ...
1
vote
0answers
22 views

A paper that proves using the latent features of RBM as input to logistic regression?

I'm looking for a paper that includes a proof that simply training a Restricted Boltzmann Machine and then using the latent features as input to a logistic regression classifier is a correct thing and ...
1
vote
0answers
24 views

RandomForest - why isn't it predicting well with manually-selected test sets?

I am using python sklearn.ensemble to do a RandomForestClassifier on about 800K rows of data, coupled with sklearn.cross_validation to generate the train/test sets. When it completes, it says on the ...
3
votes
1answer
71 views

Is it possible to seed RANSAC with a given line?

I am analyzing a stream of data and I want to seed every new instance with the best guess output (line) of the previous, so as to eventually converge. Given that Scikit Learn - RANSAC is an iterative ...
0
votes
1answer
27 views

sklearn.tree.export_graphviz values do not add up to samples

When I run tree.export_graphviz() after training a sklearn.ensemble.RandomForestClassifier() on my data, I get some leaf nodes where the samples count doesn't match the value array, like this: ...
1
vote
1answer
24 views

Recommendation Engine With Physical Distance Cutoff

I am looking to develop a recommendation engine for local stores to users. There are approximately 1 million stores in the database and around 1 million users. The 1Mx1M matrix for a user-based ...
0
votes
1answer
31 views

Plot that shows which attribute has the most effect on class?

I'm playing around with two datasets: Mushrooms and Breast Cancer. I'm trying to form a hypothesis of which attribute would have the most effect on the class when making predictions about the class. ...
0
votes
1answer
66 views

LogisticRegression - binary classification, “custom threshold”

I have a binary classification problem that I am trying to solve with sklearn's Logistic Regression. I am aware of the fact that the predict_proba() function is apparently only an approximation of the ...
0
votes
0answers
33 views

Decision function for BernoulliNB classifier. ( for use in plotting ROC and PR curves )

I would like to plot the PR curve using scikit-learn for the Bernoulli Naive Bayes estimator. However, attempting to do so give an error, ...
2
votes
0answers
52 views

Random Forest Probabilistic Prediction vs majority vote

Scikit learn seems to use probabilistic prediction instead of majority vote for the model aggregation technique without an explanation as to why (1.9.2.1. Random Forests). Is there a clear ...
0
votes
1answer
44 views

Tuning alpha parameter in LASSO linear model in scikitlearn

I'm using the LASSO method, in the problem of text classification (sentiment classification). The features I'm using are mainly Ngrams (every N consecutive words) and I'm using the LASSO specifically ...
0
votes
0answers
23 views

DecisionTreeClassifier scikit-learn : knowing the leaf to which an example belongs to

I am currently reading this paper http://quinonero.net/Publications/predicting-clicks-facebook.pdf , where they are using trees to generate feature that are afterwards fed to a linear classifier. My ...
2
votes
2answers
146 views

Output of Scikit SVM in multiclass classification always gives same label

I am currently using Scikit learn with the following code: ...
0
votes
0answers
9 views

Is there a way to get the p-values/standard errors via a function in scikit learn?

Can't seem to figure this out very easily. I am looking for a similar output as that of statsmodels; however, statsmodels doesn't support some of the regressions that I want to do. I basically want ...
0
votes
1answer
18 views

Why do two identical feature vectors (distance score 0) get different labels in DBSCAN?

I have two identical feature vectors. They have a distance score of 0. I perform DBSCAN Clustering (using sci-kit) and they get different labels. Is this expected behaviour?
0
votes
0answers
35 views

Regression Analysis with String values in column of DataFrame

I have a dataset which is having multiple columns where some column has string values with comma seperated ...
0
votes
1answer
28 views

Scikit-learn model representation

Suppose, i have some models created and fitted in scikit-learn. ...
0
votes
0answers
8 views

Grouping team features and comparing them to a single match outcome

I have two teams, and both teams have multiple features related to that team. For example: Players in the team. Players total points won. Team win percentage. Average player weight. Average player ...
0
votes
0answers
115 views

Random Forest Regressor - Incorporating Sample Weights in scikit-learn

I am running randomforestregressor in python. The target variable I am modeling is the frequency of an event occurring per unit of time. Each record in my data includes whether or not the event ...
0
votes
2answers
131 views

Predict interesting articles: increase accuracy

I'm trying to write a gui to display articles, and predict which articles I could like, based on the articles I previously liked. This post is the continuation of this one: ...
1
vote
0answers
56 views

How can I compare GBM feature importances to GBM partial dependence plots?

I am having trouble reconciling the difference between the indicated "importance" from a GBM that I am calculating with what is shown in the partial dependence plots. I would expect higher ...