创建一个 Python 程序来对给定数据集进行分类
import pandas as pd 

# 加载数据集 
dataset = pd.read_csv('dataset.csv')

# 将数据分成输入和输出字段 
X = dataset.iloc[:, :-1].values
y = dataset.iloc[:, -1].values

# 将数据集分为训练和测试集 
from sklearn.model_selection import train_test_split
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=0)

# 计算模型的参数 
from sklearn.linear_model import LogisticRegression
classifier = LogisticRegression()
classifier.fit(X_train, y_train)

# 预测测试集 
y_pred = classifier.predict(X_test)

# 评估结果 
from sklearn.metrics import accuracy_score
score = accuracy_score(y_test, y_pred)
print("准确率得分为：" + str(score))