我是python和机器学习的新手。我有79个特征的数据集(.csv),并且我正在尝试应用特征选择算法。 代码:
import numpy as np
import matploitlib.pyplot as plt
import pandas as pd
#Importing the dataset
dataset = pd.read_csv('Rural.csv', sep=';')
dataset = dataset.dropna()
print(dataset.info())
X = dataset.iloc[:, :-1].values
y = dataset.iloc[:, 75].values
#Feature selection part
from sklearn.ensemble import RandomForestClassifier
from sklearn.feature_selection import RFECV
m = RFECV(RandomForestClassifier(), scoring='accuracy')
m.fit(X, y)
m.score(X, y)