Skip to main content

All Questions

0 votes
0 answers
28 views

Keras SKLearnClassifier wrapper can't fit MNIST data

I'm trying to use the SKLearnClassifier Keras wrapper to do some grid searching and cross validation using the sklearn library but I'm unable to get the model to work properly. def build_model(X, y, ...
Jesus Diaz Rivero's user avatar
0 votes
0 answers
30 views

How to load a Neural Network Model along with MinMaxScalar? [duplicate]

I have a simple neural network model, of 4 layers, that I trained on a numerical dataset of 25K data points. It takes a good time to load the data, whenever I want to evaluate new features to python ...
Jesh Kundem's user avatar
0 votes
0 answers
82 views

How to use Keras with Optuna tuning and Sklearn Pipeline

I am developing a model using Keras and use Optuna for the hyperameter tuning. I need to use K-fold method for the development. However, I cannot successfully run it. Please help. Here is the code: ...
HappyFish's user avatar
0 votes
1 answer
46 views

How do I pass sklearns train_test_split actual dataseries and not single values as input argument?

I want to train an LSTM-based RNN model for binary classification and for that I wanted to use tensorflow keras model with LSTM layers. In order to do so, I need testing input and output as well as ...
actopozipc's user avatar
1 vote
2 answers
402 views

Problem with Keras class weights and KeyError

I anticipate that I have seen the question: Keras class_weight error dictionary keys/values referring to the same problem, but the solution does not seem to help me. With this code, where I just added ...
Pinguiz's user avatar
  • 123
1 vote
1 answer
6k views

ValueError: The filepath provided must end in `.keras` (Keras model format). Received: filepath=model/keypoint_classifier/keypoint_classifier.hdf5

PYTHON version : 3.12.4 PIP version : 24.1.1 KERAS version : 3.4.1 TENSORFLOW version : 2.16.1 i've been trying to run a code on jupyter notebook in order to train a model: which actually throws an ...
Pratik Ranjan's user avatar
-1 votes
1 answer
31 views

ValueError: Input 0 of layer "sequential" is incompatible with the layer: expected shape=(None, 247, 15), found shape=(None, 15)

This is my code import pandas as pd import tensorflow as tf from sklearn.model_selection import train_test_split dataset = pd.read_csv('/content/survey lung cancer.csv') x = dataset.drop(columns=[&...
christoffer refnov's user avatar
0 votes
1 answer
296 views

Is it possible to train a neural network to feed into a Random Forest Classifier or any other type of classifier like XGBoost or Decision Tree?

I want to create a model architecture to predict future stock price movement as such: The Goal of this model is to predict if the price will go UP or DOWN within the next 3 months. I have tried a few ...
Evank's user avatar
  • 29
0 votes
0 answers
18 views

Python3 dcg_score via sklearn is different from keras LTR

Confusion in calculating DCG scores via sklearn and keras LTR. y_true = [[1,7,3.0,4,6, 8]] y_pred = [[1,2,3.0,4,5, 0.1]] import numpy as np from sklearn.metrics import ndcg_score, dcg_score s = ...
user1639926's user avatar
1 vote
0 answers
513 views

ValueError: Could not interpret metric identifier: loss using Keras and Scikeras

i want to use GridSearchCV using KerasClassifier, but i am stuck at the following error message: --------------------------------------------------------------------------- ValueError ...
bumbummath's user avatar
0 votes
1 answer
89 views

GridSearchCV returns error "invalid parameters"

I'm trying to tune hyperparameters using GridSearchCV however the code returns the error that the parameters are invalid even though they should be working perfectly. my tensorflow and keras versions ...
Beginner_coder's user avatar
0 votes
0 answers
54 views

Unable to stack trained models with scickit learn 1.4.1.post1

I have four trained models. 2 VotingClassifier models and 2 StackingClassifier models. They are already trained and saved in joblib format. I can even load them and use them for prediction (in prod, ...
Mohamed Kounda SACKO's user avatar
1 vote
2 answers
182 views

How to wrap keras models for scikit-learn stacking ensemble usages

I have a list of keras models already trained. I want to use them with StackingClassifier in scikit learn. Due to the fact that keras doesn't have predict_proba method I created a wrapper. If use my ...
Mohamed Kounda SACKO's user avatar
1 vote
1 answer
93 views

String "loss" being passed to metric_name() instead of metric name

I'm following a tutorial, but I'm getting the error: ValueError: Could not interpret metric identifier: loss at: \keras\src\metrics\__init__.py:205, in get(identifier) It seems like in the wrapper.py ...
Zanchet2020's user avatar
1 vote
1 answer
781 views

Can't import the lib from tensorflow

I try to import some library from tensorflow. from tensorflow.keras.models import Sequential. But the terminal said ModuleNotFoundError: No module named 'keras.wrappers'. But I found the way out is to ...
NooBabyyy's user avatar

15 30 50 per page
1
2 3 4 5
32