def get_data(iris):
# Only petal length and petal width considered
X = iris.data[:, [2, 3]]
y = iris.target
# Place the iris data into a pandas dataframe
iris_df = pd.DataFrame(iris.data[:, [2, 3]], columns=iris.feature_names[2:])
# View the data
print(iris_df.head())
# Print the classes of the dataset
print('\n' + 'The classes in this data are ' + str(np.unique(y)))
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=.3, random_state=0)
print('Training set are {} samples and Test set are {} samples'.format(
X_train.shape[0], X_test.shape[0]))
print()
return(X_train, X_test, y_train, y_test,iris_df, X,y)
##scale the training data before training
Adaboost.py 文件源码
python
阅读 21
收藏 0
点赞 0
评论 0
评论列表
文章目录