I can easily train and test a classifier using the code below. Now, how can I make a prediction of the target variable (dependent variable) based on the independent variables? Something like this should work, I think, but it doesn’t… If we leave numerics as numerics, and put quotes around labels, I would like to predict the dependent variable, but
Tag: machine-learning
Reshaping problem (Input to reshape is a tensor with 10 values, but the requested shape has 1)
I’m trying to recreate this work using my own dataset: https://www.kaggle.com/code/amyjang/tensorflow-pneumonia-classification-on-x-rays/notebook I’ve made some slight tweaks to the code to accommodate my data but I don’t think that is what is causing an issue here; it could be though of course. My code: And the error: I can gather from the error that I have a mismatch in resizing, I
inverse_transform() takes 2 positional arguments but 3 were given
I’m trying to use Canonical Correlation Analysis (CCA) in scikit-learn. Still, I’m getting a TypeError, which asserts inverse_transform() takes 2 positional arguments but 3 were given. Here is my code: And the last line throws a TypeError: It’s ridiculous since I passed two arguments exactly, named x_test and predicted. If you’re curious about shape of x_test and predicted: How to
Tensorflow accuracy from model.predict does not match final epoch val_accuracy of model.fit
I am trying to match the accuracy of a model.predict call to the final val_accuracy of model.fit(). I am using tf dataset. The dataset setup for train_ds is similar. I prefetch both… Than I get the labels for the val_ds so I can use them later My model Compiles fine Seems to fit fine The last epoch output Epoch 10:
Cannot seem to pass pandas DataFrame into feature_engine.selection.DropHighPSIFeatures fit method correctly
I could not get the code to calculate psi values to work and I am not very familiar with feature_engine library or in general ML related operations. The code I am currently trying to run is: The error message returning is: The dataframe print statement in the previous code snippet is: So I assumed I don’t have anything problematic in
Create a ML model with tensorflow that predicts a values at any given time range at hourly intervals
I am pretty new to ML and completely new to creating my own models. I have went through tensorflows time-series forecasting tutorial and other LSTM time series examples on how to predict with multi-variate inputs. After trying multiple examples I think I realized that this is not what I want to achieve. My problem involves a dataset that is in
simple Neural Network gives random prediction result
I have been trying to build a simple neural network myself (3 layers) to predict the MNIST dataset. I referenced some codes online and wrote some parts my own, the code runs without any errors, but something is wrong with the learning process. It seems like the prediction result is all “random”. Applying the learning process to the network and
Is preprocessing repeated in a Pipeline each time a new ML model is loaded?
I have created a pipeline using sklearn so that multiple models will go through it. Since there is vectorization before fitting the model, I wonder if this vectorization is performed always before the model fitting process? If yes, maybe I should take this preprocessing out of the pipeline. Answer When you are running a GridSearchCV, pipeline steps will be recomputed
Mask layer is not working with MLPs, how to add a custom layer with masking?
I’m using MLPs to forecast a time series, I implement a code that contain a mask layer to let the model skip the mask values. for instance, in my data, the time series has a lot of NaN values, I fill it by a ‘value = -999’. I don’t want to remove it, but I want the Keras masking to
RuntimeError: Found dtype Char but expected Float
I am using PyTorch in my program(Binary Classification). The output from my model and actual labels are When I calculate the Binary Cross Entropy, it gives me the error I have no idea how it is finding the Char dtype. Even If calculate it manually, it gives me this error. My DataLoader is my training loop is And my Model