Category "machine-learning"

Number of Support vectors in SVM

How do I print the number of support vectors for a particular SVM model? Please suggest a code snippet in Python. from sklearn.multiclass import OneVsRestClassi

Shape of ROC curve

I did a prediction analysis on a dataset and drew the ROC curve. The ROC curve looks like below, Im not very much sure about the shape of the curve. Doesn't

Classification metrics can't handle a mix of binary and continuous targets [duplicate]

I try to train and test several scikit-learn models and attempt to print off the accuracy. Only some of these models work, others fail with th

CatBoost precision imbalanced classes

I use a CatBoostClassifier and my classes are highly imbalanced. I applied a scale_pos_weight parameter to account for that. While training with an evaluation d

Normalized Cross-Correlation in Python

I have been struggling the last days trying to compute the degrees of freedom of two pair of vectors (x and y) following reference of Chelton (1983) which is:

How can i impelement SMOTE inside a columnTransformer?

I'm trying to implement SMOTENC inside a column transformer. However I'm getting error. The code and the error is provided below. #Create a mask for categorical

Node indexing in hierarchical clustering dendrograms

I'm looking to annotate a hierarchical clustering dendrogram, but I have some trouble associating the node indices produced by scipy.cluster.hierarchy.dendrogra

training = False in Keras Sequential API

We can pass the training = False argument while calling the pre-trained model when using Keras Functional API as shown in this tutorial. How to implement the sa

Cant properly load saved model and call predict method

I am having trouble loading large model after saving. have tried all below saveing methods: tf.saved_model.save(model, model_save_path) model.save(model_save_pa

How does MindsDB renew/develop models?

I've linked a datasource to mindsdb, using scout. I'm wondering, does it automatically pull new data and retrain the model incrementially, or do I have to trigg

How to apply cross_val_score to cross valid our own model

Usually, we apply cross_val_score to the Sklearn models by doing the following way. scores = cross_val_score(clf, X, y, cv=5, scoring='f1_macro') Now I have my

How to Upload Many Files to Google Colab?

I am working on a image segmentation machine learning project and I would like to test it out on Google Colab. For the training dataset, I have 700 images, most

ImportError('Could not import PIL.Image. ' working with keras-ternsorflow

I'm following some lectures from lynda.com about deep learning using Keras-TensorFlow in a PyCharmCE enviroment and they didn't have this problem. I get this er

selective search in cv2 python

I am learning R-CNN, the first step for R-CNN is selective search, I used this algorithm on a sample image from my dataset. Code - ss = cv2.ximgproc.segmentatio

Implement Relu derivative in python numpy

I'm trying to implement a function that computes the Relu derivative for each element in a matrix, and then return the result in a matrix. I'm using Python and

Getting ValueError: y contains new labels when using scikit learn's LabelEncoder

I have a series like: df['ID'] = ['ABC123', 'IDF345', ...] I'm using scikit's LabelEncoder to convert it to numerical values to be fed into the RandomForestC

AttributeError: module 'tensorflow.python.pywrap_tensorflow' has no attribute 'TFE_Py_RegisterExceptionClass'

I am trying to develop some time-series sequence prediction, using the latest resources available. To that end, I did check the example code from TensorFlow tim

What is "linear projection" in convolutional neural network [closed]

I am reading through Residual learning, and I have a question. What is "linear projection" mentioned in 3.2? Looks pretty simple once got this

Metrics F1 warning zero division

I want to calculate the F1 score of my models. But I receive a warning and get a 0.0 F1-score and I don't know what to do. here is the source code: def model_

Input 0 of layer "sequential_3" is incompatible with the layer: expected shape=(None, 256, 256, 3), found shape=(None, 324, 500, 3)

I'm having an issue if anyone can help please comment input_shape=(BATCH_SIZE,256,256,3) model=models.Sequential([ resize_and_rescale, data_aug