机器学习项目IRIS dataset,ANN,pytorch

本文通过IRIS数据集,使用PyTorch构建并训练了一个简单的Artificial Neural Network(ANN)模型,详细介绍了从数据导入、探索、划分数据集到模型训练和测试的全过程。
摘要由CSDN通过智能技术生成


前言

利用IRIS数据集,基于pytorch,练习构建简单的ANN网络
(又名:放假了把作业整理一下,复习一遍课程


Task
学习用pytorch搭建ANN模型
Dataset
IRIS

1.导入包和数据

from sklearn import datasets
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
import pandas as pd
url = "https://raw.githubusercontent.com/callxpert/datasets/master/iris.data.txt" 
names = ['sepal-length', 'sepal-width', 'petal-length', 'petal-width', 'class'] 
dataset = pd.read_csv(url, names=names)

2.Exploratory Data Analysis (EDA)数据探索

# shape
print(dataset.shape)
#Find out the statistical summary of the data 
#including the count, mean, the min and max values as well as some percentiles.
print(dataset.describe())
print(dataset.info)

在这里插入图片描述

#class distribution
print(dataset.groupby('class').size())

在这里插入图片描述

# box and whisker plots
dataset.plot(kind='box', subplots=True, layout=(2,2), sharex=False, sharey=False)
plt.show()

在这里插入图片描述

ax = sns.boxplot(x="class", y="sepal-length", data=dataset)
ax = sns.stripplot(x
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值