scikits

how to Load CSV Data in scikit and using it for Naive Bayes Classification

一曲冷凌霜 提交于 2019-12-03 08:03:19
Trying to load custom data to perform NB Classification in Scikit. Need help in loading the sample data into Scikit and then perform NB. How to load categorical values for target. Use the same data for Train and Test or use a complete set just for test. Sl No,Member ID,Member Name,Location,DOB,Gender,Marital Status,Children,Ethnicity,Insurance Plan ID,Annual Income ($),Twitter User ID 1,70000001,Fly Dorami,New York,39786,M,Single,,Asian,2002,0,548900028 2,70000002,Bennie Ariana,Pennsylvania,6/24/1940,F,Single,,Caucasian,2002,66313, 3,70000003,Brad Farley,Pennsylvania,12001,F,Married,4,African

How to extract info from scikits.learn classifier to then use in C code

孤人 提交于 2019-12-03 06:58:36
I have trained a bunch of RBF SVMs using scikits.learn in Python and then Pickled the results. These are for image processing tasks and one thing I want to do for testing is run each classifier on every pixel of some test images. That is, extract the feature vector from a window centered on pixel (i,j), run each classifier on that feature vector, and then move on to the next pixel and repeat. This is far too slow to do with Python. Clarification: When I say "this is far too slow..." I mean that even the Libsvm under-the-hood code that scikits.learn uses is too slow. I'm actually writing a

getrs function of cuSolver over pycuda doesn't work properly

只愿长相守 提交于 2019-12-01 14:43:11
I'm trying to make a pycuda wrapper inspired by scikits-cuda library for some operations provided in the new cuSolver library of Nvidia. I want to solve a linear system of the form AX=B by LU factorization, to perform that first use the cublasSgetrfBatched method from scikits-cuda, that give me the factorization LU; then with that factorization I want to solve the system using cusolverDnSgetrs from cuSolve that I want to wrap, when I perform the computation return status 3, the matrices that supose to give me the answer don't change, BUT the *devInfo is zero, looking in the cusolver's

getrs function of cuSolver over pycuda doesn't work properly

懵懂的女人 提交于 2019-12-01 12:47:16
问题 I'm trying to make a pycuda wrapper inspired by scikits-cuda library for some operations provided in the new cuSolver library of Nvidia. I want to solve a linear system of the form AX=B by LU factorization, to perform that first use the cublasSgetrfBatched method from scikits-cuda, that give me the factorization LU; then with that factorization I want to solve the system using cusolverDnSgetrs from cuSolve that I want to wrap, when I perform the computation return status 3, the matrices that

Sparse implementations of distance computations in python / scikit-learn

假如想象 提交于 2019-12-01 06:36:28
I have a large (100K by 30K) and (very) sparse dataset in svmlight format which I load as follows: import numpy as np from scipy.cluster.vq import kmeans2 from scipy.spatial.distance import pdist, squareform from sklearn.datasets import load_svmlight_file X,Y = load_svmlight_file("somefile_svm.txt") which returns a sparse scipy array X I simply need to compute the pairwise distances of all training points as D = pdist(X) Unfortunately, distance computation implementations in scipy.spatial.distance work only for dense matrices. Due to the size of the dataset it is infeasible to, say, use pdist

Forecasting using Pandas OLS

≯℡__Kan透↙ 提交于 2019-11-30 16:09:37
I have been using the scikits.statsmodels OLS predict function to forecast fitted data but would now like to shift to using Pandas. The documentation refers to OLS as well as to a function called y_predict but I can't find any documentation on how to use it correctly. By way of example: exogenous = { "1998": "4760","1999": "5904","2000": "4504","2001": "9808","2002": "4241","2003": "4086","2004": "4687","2005": "7686","2006": "3740","2007": "3075","2008": "3753","2009": "4679","2010": "5468","2011": "7154","2012": "4292","2013": "4283","2014": "4595","2015": "9194","2016": "4221","2017": "4520

Simultaneous record audio from mic and play it back with effect in python

天涯浪子 提交于 2019-11-30 15:57:30
My goal is to record my voice through the laptop mic and simultaneously adding an effect to it, in python. What I need is similar to a music effects pedal where you connect a guitar or mic and it adds reverb or echo or distortion, etc. I am using 'pyaudio' and 'wave' to record and play back audio. Using 'scikits.audiolab' to import audio as a array and to be able to edit this array with with functions such as invert, clip, tile, etc. This manipulation of the audio array lets me "add" effects to the original audio. I am having a problem, which isn't really a problem, it's just not the effect I

Cannot import scikits-learn even though it seems to be installed

家住魔仙堡 提交于 2019-11-30 10:53:34
Per the scikit-learn user guide, I installed scikit-learn using pip install -U scikit-learn . So using pip search scikit-learn , I get this search result: scikit-learn - A set of python modules for machine learning and data mining INSTALLED: 0.12.1 (latest) But when I go into Python and try to import sklearn , I get an ImportError: No module named sklearn . This really should have just worked. I am using Enthought's free distribution of Python (2.7.3) on a Mac OS 10.6.8 with NumPy 1.6.1 and SciPy 0.10.1. Yes, I'm aware that EPD Free comes with scikit-learn but pip should have upgraded my

Simultaneous record audio from mic and play it back with effect in python

旧城冷巷雨未停 提交于 2019-11-29 16:10:33
问题 My goal is to record my voice through the laptop mic and simultaneously adding an effect to it, in python. What I need is similar to a music effects pedal where you connect a guitar or mic and it adds reverb or echo or distortion, etc. I am using 'pyaudio' and 'wave' to record and play back audio. Using 'scikits.audiolab' to import audio as a array and to be able to edit this array with with functions such as invert, clip, tile, etc. This manipulation of the audio array lets me "add" effects

Cannot import scikits-learn even though it seems to be installed

隐身守侯 提交于 2019-11-29 16:08:53
问题 Per the scikit-learn user guide, I installed scikit-learn using pip install -U scikit-learn . So using pip search scikit-learn , I get this search result: scikit-learn - A set of python modules for machine learning and data mining INSTALLED: 0.12.1 (latest) But when I go into Python and try to import sklearn , I get an ImportError: No module named sklearn . This really should have just worked. I am using Enthought's free distribution of Python (2.7.3) on a Mac OS 10.6.8 with NumPy 1.6.1 and