我不知道我哪里做错了,'
from sklearn.neural_network import MLPRegressor
from sklearn.preprocessing import RobustScaler
import pandas as pd
import yfinance as yf
import numpy as np
from sklearn.metrics import mean_squared_error, r2_score, mean_absolute_error, median_absolute_error
from sklearn.pipeline import Pipeline
from sklearn.impute import SimpleImputer
import matplotlib.pyplot as plt
from sklearn.model_selection import TimeSeriesSplit, StratifiedKFold, KFold, train_test_split, cross_val_score, GridSearchCV, ShuffleSplit
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Conv2D, MaxPooling2D, Flatten, Dense
from scikit_keras import KerasClassifier
我使用PIP命令安装了所有的包,也按照我使用的其他帖子中的建议安装了所有的包pip install patchify
但还是会出错xception has occurred: ModuleNotFoundError No module named 'scikit_keras'
接下来,我给出了所有包版本的列表Name: scikit-learn Version: 1.2.0 Name: pandas Version: 1.5.2 Name: yfinance Version: 0.1.90 Name: numpy Version: 1.23.5 Name: tensorflow Version: 2.11.0 Name: keras Version: 2.11.0
看起来您安装了scikit-keras
,它实现了KerasClassifier
。
这意味着最后一行应该是:
from skkeras import KerasClassifier