scikits

scikits confusion matrix with cross validation

假装没事ソ 提交于 2021-02-18 06:42:42
问题 I am training a svm classifier with cross validation (stratifiedKfold) using the scikits interfaces. For each test set (of k), I get a classification result. I want to have a confusion matrix with all the results. Scikits has a confusion matrix interface: sklearn.metrics.confusion_matrix(y_true, y_pred) My question is how should I accumulate the y_true and y_pred values. They are arrays (numpy). Should I define the size of the arrays based on my k-fold parameter? And for each result I should

scikits confusion matrix with cross validation

戏子无情 提交于 2021-02-18 06:41:25
问题 I am training a svm classifier with cross validation (stratifiedKfold) using the scikits interfaces. For each test set (of k), I get a classification result. I want to have a confusion matrix with all the results. Scikits has a confusion matrix interface: sklearn.metrics.confusion_matrix(y_true, y_pred) My question is how should I accumulate the y_true and y_pred values. They are arrays (numpy). Should I define the size of the arrays based on my k-fold parameter? And for each result I should

how to assess the confidence score of a prediction with scikit-learn

青春壹個敷衍的年華 提交于 2021-02-05 06:15:41
问题 I have write down a simple code that takes One arguments "query_seq", further methods calculates descriptor and in the end predictions can be made using "LogisticRegression" (or any other algorithm provided with the function) algorithms as "0 (negative for given case)" or "1 (positive for given case)" def main_process(query_Seq): LR = LogisticRegression() GNB = GaussianNB() KNB = KNeighborsClassifier() DT = DecisionTreeClassifier() SV = SVC(probability=True) train_x, train_y,train_l = data

how to assess the confidence score of a prediction with scikit-learn

杀马特。学长 韩版系。学妹 提交于 2021-02-05 06:15:08
问题 I have write down a simple code that takes One arguments "query_seq", further methods calculates descriptor and in the end predictions can be made using "LogisticRegression" (or any other algorithm provided with the function) algorithms as "0 (negative for given case)" or "1 (positive for given case)" def main_process(query_Seq): LR = LogisticRegression() GNB = GaussianNB() KNB = KNeighborsClassifier() DT = DecisionTreeClassifier() SV = SVC(probability=True) train_x, train_y,train_l = data

Sparse implementations of distance computations in python / scikit-learn

别等时光非礼了梦想. 提交于 2020-01-21 07:20:20
问题 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

Sparse implementations of distance computations in python / scikit-learn

孤者浪人 提交于 2020-01-21 07:19:27
问题 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

Error while importing scikits.talkbox

你说的曾经没有我的故事 提交于 2020-01-04 09:07:16
问题 I want to use scikits.talkbox, but i get the following error while import scikits.talkbox. Traceback (most recent call last): File "/home/seref/Desktop/machine learning codes/MFCC/main.py", line 3, in from scikits.talkbox.features.mfcc import mfcc File "/usr/local/lib/python3.5/dist-packages/scikits/talkbox/ init .py", line 3, in from tools import * ImportError: No module named 'tools' code sample import scipy.io.wavfile from scikits.talkbox.features.mfcc import mfcc sample_rate, X = scipy.io