from sklearn.model_selection import train_test_split
from sklearn.ensemble import RandomForestClassifier
from sklearn.metrics import accuracy_score
import optuna
X_train, X_test, Y_train, Y_test = train_test_split(df_xy[["SMA5/current", "SMA20/current","RSI","MACD","BBANDS+2σ","BBANDS-2σ"]],df_xy["前日比_classified"], train_size=0.8)
と入力すると以下の様なエラーが発生します
ValueError Traceback (most recent call last)
<ipython-input-16-fa5627863ca1> in <module>
----> 1 X_train, X_test, Y_train, Y_test = train_test_split(df_xy[["SMA5/current", "SMA20/current","RSI","MACD","BBANDS+2σ","BBANDS-2σ"]],df_xy["前日比_classified"], train_size=0.8)
~\anaconda3\lib\site-packages\sklearn\model_selection_split.py in train_test_split(test_size, train_size, random_state, shuffle, stratify, *arrays)
2173
2174 n_samples = _num_samples(arrays[0])
-> 2175 n_train, n_test = _validate_shuffle_split(n_samples, test_size, train_size,
2176 default_test_size=0.25)
2177
~\anaconda3\lib\site-packages\sklearn\model_selection_split.py in _validate_shuffle_split(n_samples, test_size, train_size, default_test_size)
1855
1856 if n_train == 0:
-> 1857 raise ValueError(
1858 'With n_samples={}, test_size={} and train_size={}, the '
1859 'resulting train set will be empty. Adjust any of the '
ValueError: With n_samples=0, test_size=None and train_size=0.8, the resulting train set will be empty. Adjust any of the aforementioned parameters.
読み込み先の設定がわかりません。
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2021/07/01 21:48