Machine learning framework for Python.

learn more… | top users | synonyms

5
votes
2answers
94 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 ...
2
votes
0answers
45 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
29 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
1answer
21 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
6 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
26 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
37 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
42 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
138 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
25 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 ...
2
votes
2answers
62 views

Use of nested cross-validation

Scikit Learn's page on Model Selection mentions the use of nested cross-validation: ...
0
votes
0answers
26 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
54 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
50 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
40 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 ...
1
vote
0answers
22 views

How to enforce periodic boundary conditions when performing regression with sci-kit learn?

I have signals that resemble sine waves (or, more accurately, sums of sines). The data are normalized in the time domain so that there is only one cycle and all of the points lie between 0 and 1. An ...
0
votes
0answers
23 views

Optimal feature selection for MAPE criteria with RandomForest cross-validation

I am trying to optimize my set of features against random forest cross-validation using MAPE criteria. I tried forward selection with Univariate linear regression test (f_regression in sklearn), I ...
0
votes
0answers
29 views

Multivariate Multiple Classification

Is it possible to have multiple (at least 3) dependent variables in a single classification model. I know this can be accomplished in a regression model but I need to perform this with a ...
0
votes
0answers
22 views

Merging different datasets for binary classification

I have four ($D_1, ... D_4$) different datasets from which I want to learn a robust binary classifier. I am currently using SVC and ...
8
votes
1answer
306 views

How to split the dataset for cross validation, learning curve, and final evaluation?

What is an appropriate strategy for splitting the dataset? I ask for feedback on the following approach (not on the individual parameters like test_size or ...
2
votes
1answer
111 views

Which metric should I trust to evaluate my predictive model

I am working on predictive model and when I evaluate it, I find good accuracy_score, precision_score, ...
1
vote
1answer
221 views

How can we evaluate the predicted values using Scikit-Learn

I am using AdaBoost Classifier to predict values I have. How can evaluate the accuracy of prediction model (I'd like to see how the accuracy of predicted values). You can check an example here: ...
0
votes
1answer
108 views

How do we use logistic regression (scikit-learn) to predict values

Logistic regression can help to predict a value whether it would happen or no. I'd like to know how can I do that using sklearn. I'd like to know the probability if this event would happen or no. I ...
1
vote
1answer
104 views

How do we predict rare events?

I am working on developing an insurance risk predictive model. These models are of "rare events" like airline no-show prediction, hardware fault detection, etc. As I prepared my data set, I tried to ...
0
votes
2answers
85 views

Streaming k-means

I want to perform something like streaming/online/out-of-core kmeans clustering on large data. Here is simple idea: Break all data into N chunks. Read from disk 1st chunk and calculate centroids ...
1
vote
0answers
36 views

scikit learn: add lasso or ridge penalty only on subset of parameters

Is there a way of using the linear model api to add the lasso penalty for a subset of the parameters I am regressing? For example, consider a linear separable decomposition that I want to fit to some ...
0
votes
1answer
38 views

R's equivalente of scikit's KFold

I'm new to R and I'm trying to set up a basic k folds CV loop. In Python I'd use scikit's KFold. ...
1
vote
0answers
16 views

How Does a Disparity in Number of Documents (Training Data Points) Affect Text Classification?

I have collected a fairly clean set of data (5,410 documents) to train a text classifier. I am now attempting to improve my classification success. (Note: When I trained/tested the classifier from ...
0
votes
0answers
31 views

Training models for classification using different negative datasets

I'm working on a massively unbalanced binary classification task - Classification of given protein sequences as belonging to a certain (very small) class, or not. There are about 1,300 positive ...
1
vote
0answers
59 views

“Robust” normalization of features from multiple groups and unknown distributions prior to learning

I'm working on a machine learning project involving statistical analysis (and later discriminatory classification) of different proteins (samples) drawn from multiple, potentially overlapping classes ...
1
vote
2answers
124 views

Prediction with scikit and an precomputed kernel (SVM)

I am kind of a newbie in the MachineLearning area and evaluating some tools etc. to get a feeling for it. For a project I am using a tool that creates a precomputed kernel (gram matrix) and also is ...
5
votes
1answer
226 views

What is the right attitude toward open source machine learning toolkits?

There are lots of machine learning toolkits nowadays, such as weka, sklearn, R libs. If we choose to use these toolkits, besides that it is convenient, sometimes ...
0
votes
1answer
44 views

Regression Tree when target is a ratio

I am learning a regression tree for data of the form $(x_i,y_i)$: $x_i = (1, 0, 1, ...., 1 , 1)$ a multiple input vector and $y$ is a ratio of the number of observations divided by the number of ...
1
vote
0answers
255 views

Using BIC to estimate the number of k in KMEANS

I am currently trying to compute the BIC for my toy data set (ofc iris (: ). I want to reproduce the results as shown here (Fig. 5). That paper is also my source for the BIC formulas. I have 2 ...
0
votes
0answers
30 views

building a feature set for scikit learn

Im using RandomForestClassifier for a probability prediction task. I have a featureset of around 50 features and two possible labels - ...
2
votes
2answers
302 views

How to compute the standard errors of a logistic regression's coefficients

I am using Python's scikit-learn to train and test a logistic regression. scikit-learn returns the regression's coefficients of the independent variables, but it does not provide the coefficients' ...
0
votes
0answers
32 views

Imputing categorical variables before binarization

I wish to replace the missing values with mode of that categorical variable. In scikit-learn, we can something like Imputer(strategy="most_frequent", axis=0) but ...
0
votes
0answers
39 views

How to normalize ranked data

I am doing some machine learning and need help with the stats aspect of my problem. I have a number of addresses of webpages and some features for these webpages. I am running TF-IDF on the webpage ...
2
votes
1answer
95 views

Name of algorithm (or paper) that scikit-learn cluster.estimate_bandwidth() function implements for meanshift bandwidth selection

Can someone tell me the name of the algorithm (or paper) that sklearn.cluster.estimate_bandwidth implements and is used by the meanshift algorithm implemented in Scikit-Learn to automatically select ...
0
votes
1answer
167 views

How to construct the feature weight vector (or Decision Boundry) from a linear SVM classifier from scikit?

I use the following code to train an svm classifier: clf = svm.SVC(kernel='linear') clf.fit(train_mat, train_labels) that fit the data and save the info in the ...
1
vote
0answers
68 views

Logistic Regression not quite working

I'm playing around with logistic regression (using scikit-learn, which uses liblinear) I created some example data sets, and it often works well. Since I created the data sets, I already know the ...
0
votes
0answers
64 views

what to do with 0.5 class probabilities ?

I am currently training a random forest regressor (scikit learn) on the Titanic dataset. My question is related to this issue ...
2
votes
1answer
98 views

Heuristic Feature Selection for Gradient Boosting

I originally posted on Stack Overflow and was told to move it here. If I am trying to select from two different sets of features for a Gradient Boosting Machine, but I do not want to run through ...
0
votes
0answers
60 views

Suitable model for predicting range-bound integer attribute?

I need to predict an integer variable in the scale (0-50). I am wondering how it should be modeled: Should zero be predicted as a 0/non-0 categorical classification separately, given that ...
1
vote
0answers
126 views

Dimension Reduction using PCA and Random Forests

I an using scikit-learn as a toolset. I have 1K features as candidates and am trying to reduce the feature set as I believe the majority is noise (but am not sure). I wanted to somehow automate ...
0
votes
0answers
66 views

equivalent of PCA explained variance ratio for SVD ?

i am wondering if there is an equivalent of PCA explained variance ratio for SVD. What are the measures I can get to monitor the number of columns I keep after the SVD ? Are any of these metrics ...
0
votes
0answers
18 views

scikit-learn SkewedChi2Sampler - meaning of skewedness parameter

I am trying to understand the meaning of the "skewedness" parameter for scikit-learn's SkewedChi2Sampler and figure out how this value affects the output of the sampler. I have looked at the docs ...
1
vote
0answers
891 views

Principal Component Analysis and Regression in Python

I'm trying to figure out how to reproduce in Python some work that I've done in SAS. Using this dataset, where multicollinearity is a problem, I would like to perform principal component analysis in ...
3
votes
2answers
225 views

Is it possible to train a one-class SVM to have zero training error?

I'm trying to work on an anomaly detection problem, so I am currently exploring my options on which algorithm is best to use for me. I've been looking at the one-class SVM in the scikit-learn library ...
0
votes
1answer
179 views

How to interpret scikit learn classification tree?

I'm currently trying to work with scikit-learn classification tree. I followed the example on iris dataset : http://scikit-learn.org/stable/modules/tree.html and everything is working fine. I do ...