My dataset below shows product sales per price (link to download dataset csv): What I want to achive is clustering the dense regions (rectangles below) using HDBSCAN and sklearn. We have four regions, but regions 3 and 4 could also be grouped into a big region, which would lead to only 3 regions on the entire dataset by changing the
Tag: machine-learning
scikit preprocessing across entire dataframe
I have a dataframe: The data is an average response of the same question asked across 4 quarters. I am trying to create a benchmark index from this data. To do so I wanted to preprocess it first using either standardize or normalize. How would I standardize/normalize across the entire dataframe. What is the best way to go about this?
CPU only pytorch is crashing with error AssertionError: Torch not compiled with CUDA enabled
I’m trying to run the code from this repository and I need to use Pytorch 1.4.0. I’ve installed the CPU only version of pytorch with pip install torch==1.4.0+cpu torchvision==0.5.0+cpu -f https://download.pytorch.org/whl/torch_stable.html. I ran the program by doing py -m train_Kfold_CV –device 0 –fold_id 10 –np_data_dir “C:UsersusernameOneDriveDesktopemadeldeenAttnSleepprepare_datasetsedf_20_npz” but I’m getting this error: I’ve changed the number of GPU in the config
Modifying data frame containing NaN value so that I don’t get not a number error on division
I have a pandas data frame with some NaN values which I have replaced by Now one of my functions does the following: Since I have replaced the NaN value by “”, I am getting What should be the apt way to fill the NaN values so that I can get rid of this particular error? Answer You could filter
Keras: Does model.predict() require normalized data if I train the model with normalized data?
After completing model training using Keras I am trying to use Keras’ model.predict() in order to test the model on novel inputs. When I trained the model, I normalized my training data with Scikit Learn’s MinMaxScaler(). Do I need to normalize the data as well when using model.predict()? If so, how do I do it? Answer Yes. You need. Because
Keras – Hyper Tuning the initial state of the model
I’ve written an LSTM model that predicts the sequential data. I’ve tuned some of the layer’s params using AWS SageMaker. While validating the model I’ve run a model with a specific configuration several times. Most of the time the results are similar, however, one run was much better than others, which led me to think that the initial state of
How to make a custom activation function with trainable parameters in Tensorflow [closed]
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question
ModuleNotFoundError: No module named ‘grad’
I try to run this Neural Network script (for a regression model) There are two classes defined above. One is Standardizer class and other is Neural Net class. The Standardizer class normalizes all the values and the NeuralNet class builds the neural network that learns the data through feed forward and back propagation. This function takes the the number of
ValueError: shapes (240000,28,28) and (2,512) not aligned: 28 (dim 2) != 2 (dim 0)
I’m making a CNN and I’ve got this error that the matrices don’t align and i understand the error but i don’t know how to fix it. Here is the code: And this is the error i get in sublime text: As you can see it gets to epoch 1 then when trying to do the numpy dot product and
SVM working well on test subset fails on whole dataset
I trained a SVM iterativly on large chunks of data using sklearn. Each csv file is a part of an image. I made those with a sliding window aproach. I used partial_fit() for fitting the SVM as well as the scaler. The features are the RGBN values of an image, I want to classify the image in two different groups