Machine learning framework for Python.

learn more… | top users | synonyms

1
vote
2answers
17 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
4 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
9 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
16 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
13 views

Scikit-learn model representation

Suppose, i have some models created and fitted in scikit-learn. ...
0
votes
0answers
7 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
26 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
71 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: ...
0
votes
0answers
17 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 ...
0
votes
0answers
22 views

Factor Analysis in scikit learn: Many zero loadings

I am trying to apply Factor Analysis to a dataset with about 200 datapoints and 8 variables. When setting the n_components parameter to 8, I get a loading matrix with loadings for three factors that ...
0
votes
0answers
40 views

How to plot a precision-recall curve when doing cross-validation?

I'm using cross-validation to evaluate the performance of a classifier with scikit-learn and I want to plot the Precision-Recall curve. I found an example on ...
1
vote
0answers
39 views

Building a predictive model, regression with a long right tail

I am trying to build a, regressive, predictive model for a target time-series that is heavily skewed. You could think of the target as being like earthquake magnitudes or heavy rainfall. Most of the ...
0
votes
0answers
37 views

Which naive Bayes?

I am attempting to use a naïve Bayes classifier in python (using scikit-learn), with two examples. The first example has 6 classes and 2 hypotheses, the 2nd example has 2 classes and 6 hypotheses. ...
0
votes
0answers
28 views

Make a classification dataset with binary features using scikit-learn

I would like to illustrate a classification algorithm by using this algorithm on a 2-class dataset with binary n-dimensional features. In the past, I have used the scikit function make_classification ...
0
votes
1answer
76 views

How can you print the decision tree of a RandomForestClassifier

Recently, I have noticed that there is a method sklearn.tree.export_graphviz documented here. However, I do not know how I can apply it to a ...
0
votes
0answers
24 views

How do I get a classification report for my cross validated scores using sklean

I am running a logistic regression model using sklearn with 2 classes (1 and 0). Here is my code: ...
0
votes
0answers
27 views

How can I improve my sklearn logistic regression model

My objective is to classify sentences into useful (denote in boolean as 1) and not useful (denote in boolean as 0) categories. I have about 525 features where 300 features are the most frequent and ...
1
vote
1answer
145 views

scikit multi label classification

I am trying to classify data into four different labels. The training data looks something like: ...
0
votes
1answer
60 views

what does the numbers in the classification report of sklearn mean?

I have below an example i pulled from sklearn 's sklearn.metrics.classification_report documentation. What i dont understand is why there are f1-score, precision and recall values for each class ...
1
vote
1answer
28 views

Logistic-Regression: Prior correction at test time

Using sklean.linear_model.LogisticRegression for a binary classification problem. My classes are unbalanced. The positive class comprises about 20% of the training set. When fitting the model I use: ...
0
votes
0answers
24 views

How to scale data to train RBMs?

I know that when training Bernoulli Restricted Boltzmann Machines with real-valued data, then the input data should be scaled to the interval $[0,1]$ (last section from here). What I understood is ...
1
vote
1answer
65 views

Out-Of-Bag estimate in scikit-learn

I am using a bagging model from the Python Scikit-Learn module: ...
0
votes
0answers
102 views

More recognizable Python implementation of Linear Discriminant Analysis?

I have been using scikit-learn's LDA implementation to do some experiments, and recently wanted to test out some modifications to the LDA derivation. I was looking at the Python implementation that ...
1
vote
0answers
25 views

How do I filter insignificant modes from a kernel density estimation

How do I detect the number of significant modes in a set of data? I have a set of 1 dimensional data where the number of modes are unknown. I'm familiar with python and scikit learn so I use the ...
0
votes
0answers
14 views

Dealing with numbers-based categorial data in rf regression: to standardize, or encode?

I'm working with the SEER cancer dataset, and I'm trying to use regression to calculate the months a breast cancer patient can expect to survive given certain variables. Some of these variables are ...
4
votes
1answer
208 views

How to apply a Gaussian radial basis function kernel PCA to nonlinear data?

I have an assignment to implement a Gaussian radial basis function-kernel principal component analysis (RBF-kernel PCA) and have some challenges here. It would be great if someone could point me to ...
0
votes
1answer
30 views

Generating even-sized clusters in scikit-learn [duplicate]

I'm attempting to generate approximately even-sized clusters of a PCA'd feature set in Scikit-learn, but I'm not having any luck. I'm only familiar with KMeans clustering, and with that algorithm the ...
1
vote
0answers
67 views

Naive Bayes and text classification: which probability model and vectorizer combination makes sense?

I am wondering which combinations of Naive models can be paired with different vectorizing methods so that it makes sense. Let's say we have a simple binary spam-classification task. Multinomial ...
3
votes
1answer
58 views

Excluding the scatter points from a feature

I have a set of data points that are supposed to sit on a locus and follow a pattern, but there are some scatter points from the main locus that cause uncertainty in my final analysis. I would like to ...
2
votes
1answer
83 views

Classification algorithms that return confidence?

Given a machine learning model built on top of scikit-learn, how can I classify new instances but then choose only those with the highest confidence? How do we define confidence in machine learning ...
7
votes
0answers
101 views

Why does the scikit-learn bootstrap function resample the test set?

When using bootstrapping for model evaluation, I always thought the out-of-bag samples were directly used as a test set. However, this appears not to be the case for the scikit-learn bootstrap ...
0
votes
0answers
16 views

How could I generate an “explanation” for each prediction in a classification ?

I have a classification problem. My classes are 0 and 1. The dataset is a bit big, the training is done on 7 million lines and 100 + variables so I choose to use scikit learn and the logistic ...
0
votes
0answers
37 views

why is adaboost predicting probabilities with so little standard deviation?

I'm using several algorithms to predict a binary target. So far I tried Gradient Boosting, Random Forest, Extra Random Trees and adaboost from scikit learn. All of these algorithms appear to predict ...
0
votes
1answer
87 views

How to get both MSE and R2 from a sklearn GridSearchCV?

I can use a GridSearchCV on a pipeline and specify scoring to either be 'MSE' or 'R2'. I can then access ...
0
votes
0answers
17 views

Joint label between two datasets produces significantly worse results

I have two sets of corresponding example labels with more or less the same features. Let's call first one label A and the second one label B. Both labels are binary. The classification accuracy of ...
7
votes
3answers
617 views

Why Python's scikit-learn LDA results are different from LDA in R or a step-by-step approach

I was using the Linear Discriminant Analysis (LDA) from the scikit-learn machine learning library (Python) for dimensionality reduction and was a little bit curious about the results. I am wondering ...
3
votes
1answer
148 views

Training a Tic Tac Toe brain - am I on the right track?

My only experience with Machine Learning is Andrew Ng's Coursera course, but I did work through that just fine and passed with 100%. I decided to practice by making up some problems and solving them. ...
3
votes
1answer
58 views

K-means metrics

I have read through the scikit learn documentation and Googled to no avail. I have 2000 data sets, clustered as the picture shows. Some of the clusters, as shown, are wrong, here the red cluster. I ...
0
votes
2answers
69 views

How to deal with a skewed class in binary classification having many features?

I am doing data analysis in the mobile ad targeting domain. I have around 18 features and for a combination of these features, the result is either True or False (1/0) depending on whether the ...
0
votes
0answers
21 views

Turning MiniBatchKMeans into Fuzzy MiniBatchKMeans

I'm using Scikit-Learn, which has an implementation of MiniBatchKMeans. I'm very inexperienced with ML, so I'm wondering how (if ...
1
vote
0answers
96 views

Running R caret in Python script [closed]

I am currently trying to transition from R into Python to streamline the process of working in web-based applications. I know that SciKit Learn has a ton of functionalities parallel to R's, including ...
2
votes
1answer
98 views

How to prepare interactions of categorical variables in scikit-learn?

What is the best way to prepare interactions of categorical features before fitting with scikit-learn? With statsmodels I could conveniently say in R-style ...
0
votes
0answers
68 views

How to prepare data for classifiaction

I have a relative small dataset that is consisted of numerical, nominal as well as text features. Some cells are empty whereas the class type is nominal and can take any of the ~10 different ...
2
votes
3answers
229 views

Naive Bayes: Imbalanced Dataset in Real-time Scenario

I am using scikit-learn Multinomial Naive Bayes classifier for binary text classification (classifier tells me whether the document belongs to the category X or not). I use a balanced dataset to train ...
0
votes
1answer
37 views

document similarity with documents using synonyms

I have a bunch of documents where some of the documents are a copy of other documents with their text jumbled up and some of the words replaced by their synonyms. Mentioned below is one such example ...
3
votes
2answers
324 views

Use of nested cross-validation

Scikit Learn's page on Model Selection mentions the use of nested cross-validation: ...
0
votes
0answers
47 views

Gaussian Mixture Model - Density estimation

I am working on the estimation of density function and I am using the scikit-learn library. As example of code I am looking at the code at the following link. My doubt is at this following line of ...
3
votes
1answer
119 views

Clustering without a distance matrix

I've recently completed a project where I used scikit-learn's DBSCAN module to find clusters in relatively short strings of text. I used a custom string similarity ...
1
vote
0answers
142 views

Possible to evaluate GLM in Python/scikit-learn using the Poisson, Gamma, or Tweedie distributions as the family for the error distribution?

Trying to learn some Python and SKLearn, but for my work I need to run regressions that use error distributions from the Poisson, Gamma, and especially Tweedie families. I don't see anything in the ...
0
votes
0answers
46 views

What method should I use for this optimization / feature selection project

I'm going to describe a problem and I'm not sure how to best solve it. I will describe the situation. When answering please recommend a method and maybe a software library. I'm using Python for my ...