0


sklearn学习的一个例子用pycharm jupyter

环境

运行在jupyter 进行开发。即一个WEB端的开发工具。能适时显示开发的输出。后缀用的是ipynb.pycharm也可以支持。但也要提示按装jupyter.
或直接用andcoda
这里我们用pycharm进行项目创建
在这里插入图片描述

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple  jupyterlab
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple  notebook
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple scikit-learn
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pandas
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple matplotlib

在这里插入图片描述

将以下的文本复制到本地sklearn/data:

sepal_length    sepal_width    petal_length    petal_width    species
5.13.51.40.2    Iris-setosa
4.931.40.2    Iris-setosa
4.73.21.30.2    Iris-setosa
4.63.11.50.2    Iris-setosa
53.61.40.2    Iris-setosa
5.43.91.70.4    Iris-setosa
4.63.41.40.3    Iris-setosa
53.41.50.2    Iris-setosa
4.42.91.40.2    Iris-setosa
4.93.11.50.1    Iris-setosa
5.43.71.50.2    Iris-setosa
4.83.41.60.2    Iris-setosa
4.831.40.1    Iris-setosa
4.331.10.1    Iris-setosa
5.841.20.2    Iris-setosa
5.74.41.50.4    Iris-setosa
5.43.91.30.4    Iris-setosa
5.13.51.40.3    Iris-setosa
5.73.81.70.3    Iris-setosa
5.13.81.50.3    Iris-setosa
5.43.41.70.2    Iris-setosa
5.13.71.50.4    Iris-setosa
4.63.610.2    Iris-setosa
5.13.31.70.5    Iris-setosa
4.83.41.90.2    Iris-setosa
531.60.2    Iris-setosa
53.41.60.4    Iris-setosa
5.23.51.50.2    Iris-setosa
5.23.41.40.2    Iris-setosa
4.73.21.60.2    Iris-setosa
4.83.11.60.2    Iris-setosa
5.43.41.50.4    Iris-setosa
5.24.11.50.1    Iris-setosa
5.54.21.40.2    Iris-setosa
4.93.11.50.2    Iris-setosa
53.21.20.2    Iris-setosa
5.53.51.30.2    Iris-setosa
4.93.61.40.1    Iris-setosa
4.431.30.2    Iris-setosa
5.13.41.50.2    Iris-setosa
53.51.30.3    Iris-setosa
4.52.31.30.3    Iris-setosa
4.43.21.30.2    Iris-setosa
53.51.60.6    Iris-setosa
5.13.81.90.4    Iris-setosa
4.831.40.3    Iris-setosa
5.13.81.60.2    Iris-setosa
4.63.21.40.2    Iris-setosa
5.33.71.50.2    Iris-setosa
53.31.40.2    Iris-setosa
73.24.71.4    Iris-versicolor
6.43.24.51.5    Iris-versicolor
6.93.14.91.5    Iris-versicolor
5.52.341.3    Iris-versicolor
6.52.84.61.5    Iris-versicolor
5.72.84.51.3    Iris-versicolor
6.33.34.71.6    Iris-versicolor
4.92.43.31    Iris-versicolor
6.62.94.61.3    Iris-versicolor
5.22.73.91.4    Iris-versicolor
523.51    Iris-versicolor
5.934.21.5    Iris-versicolor
62.241    Iris-versicolor
6.12.94.71.4    Iris-versicolor
5.62.93.61.3    Iris-versicolor
6.73.14.41.4    Iris-versicolor
5.634.51.5    Iris-versicolor
5.82.74.11    Iris-versicolor
6.22.24.51.5    Iris-versicolor
5.62.53.91.1    Iris-versicolor
5.93.24.81.8    Iris-versicolor
6.12.841.3    Iris-versicolor
6.32.54.91.5    Iris-versicolor
6.12.84.71.2    Iris-versicolor
6.42.94.31.3    Iris-versicolor
6.634.41.4    Iris-versicolor
6.82.84.81.4    Iris-versicolor
6.7351.7    Iris-versicolor
62.94.51.5    Iris-versicolor
5.72.63.51    Iris-versicolor
5.52.43.81.1    Iris-versicolor
5.52.43.71    Iris-versicolor
5.82.73.91.2    Iris-versicolor
62.75.11.6    Iris-versicolor
5.434.51.5    Iris-versicolor
63.44.51.6    Iris-versicolor
6.73.14.71.5    Iris-versicolor
6.32.34.41.3    Iris-versicolor
5.634.11.3    Iris-versicolor
5.52.541.3    Iris-versicolor
5.52.64.41.2    Iris-versicolor
6.134.61.4    Iris-versicolor
5.82.641.2    Iris-versicolor
52.33.31    Iris-versicolor
5.62.74.21.3    Iris-versicolor
5.734.21.2    Iris-versicolor
5.72.94.21.3    Iris-versicolor
6.22.94.31.3    Iris-versicolor
5.12.531.1    Iris-versicolor
5.72.84.11.3    Iris-versicolor
6.33.362.5    Iris-virginica
5.82.75.11.9    Iris-virginica
7.135.92.1    Iris-virginica
6.32.95.61.8    Iris-virginica
6.535.82.2    Iris-virginica
7.636.62.1    Iris-virginica
4.92.54.51.7    Iris-virginica
7.32.96.31.8    Iris-virginica
6.72.55.81.8    Iris-virginica
7.23.66.12.5    Iris-virginica
6.53.25.12    Iris-virginica
6.42.75.31.9    Iris-virginica
6.835.52.1    Iris-virginica
5.72.552    Iris-virginica
5.82.85.12.4    Iris-virginica
6.43.25.32.3    Iris-virginica
6.535.51.8    Iris-virginica
7.73.86.72.2    Iris-virginica
7.72.66.92.3    Iris-virginica
62.251.5    Iris-virginica
6.93.25.72.3    Iris-virginica
5.62.84.92    Iris-virginica
7.72.86.72    Iris-virginica
6.32.74.91.8    Iris-virginica
6.73.35.72.1    Iris-virginica
7.23.261.8    Iris-virginica
6.22.84.81.8    Iris-virginica
6.134.91.8    Iris-virginica
6.42.85.62.1    Iris-virginica
7.235.81.6    Iris-virginica
7.42.86.11.9    Iris-virginica
7.93.86.42    Iris-virginica
6.42.85.62.2    Iris-virginica
6.32.85.11.5    Iris-virginica
6.12.65.61.4    Iris-virginica
7.736.12.3    Iris-virginica
6.33.45.62.4    Iris-virginica
6.43.15.51.8    Iris-virginica
634.81.8    Iris-virginica
6.93.15.42.1    Iris-virginica
6.73.15.62.4    Iris-virginica
6.93.15.12.3    Iris-virginica
5.82.75.11.9    Iris-virginica
6.83.25.92.3    Iris-virginica
6.73.35.72.5    Iris-virginica
6.735.22.3    Iris-virginica
6.32.551.9    Iris-virginica
6.535.22    Iris-virginica
6.23.45.42.3    Iris-virginica
5.935.11.8    Iris-virginica

开发

创建一个jupyter的文件在这里插入图片描述这编程界面出现
在这里插入图片描述写代码:
在这里插入图片描述
.ipynb 是 Jupyter Notebook 文件的扩展名。Jupyter Notebook 是一个交互式的 Web 应用程序,用于创建和共享包含实时代码、方程、可视化和叙述性文本的文档。

在 Jupyter Notebook 中,你可以编写 Python 代码,并且代码单元格可以执行。这使得 Jupyter Notebook 成为数据清理、数据分析和可视化、机器学习模型训练等任务的强大工具。

使用 .ipynb 扩展名的原因是因为它表示这个文件是一个 Jupyter Notebook 文件,并且该文件可以使用 Jupyter Notebook 或 JupyterLab 等工具打开和编辑。

此外,Jupyter Notebook 文件也可以保存为 .py 文件,这样它们就可以作为常规的 Python 脚本运行。但是,直接保存为 .py 文件会失去 Jupyter Notebook 的交互性特性,例如代码单元格的执行和实时代码的输出。

import pandas as pd
df=pd.read_csv('data/iris.txt',sep='\t')
df.head()#前五行
df.tail()# 后五行print(df.shape)#行例数print(df.info())# 数据整体信息print(df.describe())#统计

在这里插入图片描述 #### 相关教程
sklearn介绍

标签: sklearn 学习 pycharm

本文转载自: https://blog.csdn.net/hzether/article/details/135231898
版权归原作者 老大白菜 所有, 如有侵权,请联系我们删除。

“sklearn学习的一个例子用pycharm jupyter”的评论:

还没有评论