我用随机森林分类器获得了90%以上的准确率,但我担心其他算法的结果要低得多: A table with the results个 但这并不是主要的担忧.问题是,当我使用用户输入时,预测是A table with the results%错误的.用户输入的列的顺序对应于训练数据集列的位置.
model = RandomForestClassifier()
model.fit(X_train, y_train)
prediction = model.predict(X_test)
acc = accuracy_score(y_test, prediction) # output: 0.91
X_test_user = df_user_compounds_1.to_numpy()
user_input_predictions_1 = model.predict(X_test_user) #
user_input_predictions_1 # output: array([0, 0, 0, 0, 0], dtype=int64), but it should be: array([1, 1, 1, 1, 1],dtype=int64)
有人知道为什么会发生这种事吗?
数据集经过了预处理-没有缺失值,没有重复,它使用RandomOverSsamer进行了平衡,使用MinMaxScaler进行了zoom ,没有负值,并且包含11个要素/7K行.