Category "machine-learning"

How to fix NPE when transforming RasterFrameLayer into Raster?

I'm trying to convert a predicted RasterFrameLayer in RasterFrames into a GeoTiff file after training a machine learning model. When using the demo data Elkton-

I this the correct way of computing the average accuracy?

I am fairly new to coding and getting confused between average accuracy and overall accuracy. I have created a function to calculate accuracy, i then divide thi

How to set AUC as scoring method while searching for hyperparameters?

I want to perform a random search, in classification problem, where the scoring method will be chosen as AUC instead of accuracy score. Have a look at my code f

Non Linear Decision boundary SVM

I need you guys help to find a non linear decision boundary. I have 2 features with numerical data, I made a simple linear decision boundary (see picture below)

Understanding `leafsize` in scipy.spatial.KDTree

Problem statement: I have 150k points in a 3D space with their coordinates stored in a matrix with dimension [150k, 3] in mm. I want to find all the neighbors o

Is it possible to average the output of multiple classification models using pipeline in sklearn?

As an example, suppose there is a random forest and a logistic regression model that accept the same input data, and I want the inference result to be the avera

Issue fitting a SGD Classifier

I'm following the book Hands-on Machichine Learning by Aurelien Geron, more specifically, where it begins to go into classifiers. I'm following the code from th

Generate a GMM Dataset by using multivariate_normal from scipy.stats

How can I use from scipy.stats import multivariate_normal to generate data? In specific, I want to create a GMM data that contains 3 columns (features) and a la

Compute Similarity(percentage) between two Matrix/Array

How to compute similarity(percentage) between two matrix/arrays. or find the closest array/matrix to a given array, on the basis of how similar their data value

How to configure the Keras Optimizer and Learning rate using config.yaml file?

I have defined few parameters in my config.yaml like as below. params: epochs: 10 batch_size: 128 num_classes: 10 loss_function: sparse_categorical_cros

Sklearn Pipeline with KernelExplainer and data to predict as DataFrame leads to error

I want to calculate shap values from a sklearn pipeline with a preprocessor and a model. When i do it with the code below I get 0 for all shape_values def creat

Negative BIC values for GaussianMixture in scikit-learn (sklearn)

In scikit-learn, the GaussianMixture object has the method bic(X) that implements the Bayesian Information Criterion to choose the number of components that bet

KeyError: 'initialized_diffuse'

I'm getting a keyerror 'initialized_diffuse' while calling the following API, probably after joblib.load(). import joblib .......... @routes.route("/forecast",

Why the sum "value" isn't equal to the number of "samples" in scikit-learn RandomForestClassifier?

I built a random forest by RandomForestClassifier and plot the decision trees. What does the parameter "value" (pointed by red arrows) mean? And why the sum of

Custom GRU model (OGRU)

I want to customise the GRU-RNN cell from tensorflow. But i dont know which function i need to change from standart GRU from tensorflow. i want to modify GRU ce

Hardware for Machine Learning / Deep Learning

I want to build a new computer for Data Science purposes. What do you think about this hardware: https://www.ldlc.com/configurateur-pc/23fe088422141bb69274a13ca

GlobalAveragePooling1D equivalence with Lambda Layer

Is the GlobalAveragePooling1D Layer the same like calculating the mean with a custom Lambda Layer? The data is temporal, so x has shape (batch, time, features)

Assigning custom weights to embedding layer in PyTorch

Does PyTorch's nn.Embedding support manually setting the embedding weights for only specific values? I know I could set the weights of the entire embedding laye

Decision tree regression producing multiple lines

I'm trying to make a single variable regression using decision tree regression. However when I'm plotting the results. Multiple lines show in the plot just like

Instantiate Keras model with some weights before training

I have Keras model: pre-trained CV model + a few added layers on top I would want to be able to do model.predict before model.fit Q: how do I instantiate model