当前位置:网站首页>pycaret source code analysis: download dataset\Lib\site-packages\pycaret\datasets.py
pycaret source code analysis: download dataset\Lib\site-packages\pycaret\datasets.py
2022-08-01 00:03:00 【Artificial Intelligence Zeng Xiaojian】

def get_data(
dataset="index",
save_copy=False,
profile=False,
verbose=True,
address="https://raw.githubusercontent.com/pycaret/pycaret/master/datasets/",
):
"""
This function loads sample datasets from git repository. List of available
datasets can be checked using ``get_data('index')``.
Example
-------
>>> from pycaret.datasets import get_data
>>> all_datasets = get_data('index')
>>> juice = get_data('juice')
dataset: str, default = 'index'
Index value of dataset.
save_copy: bool, default = False
When set to true, it saves a copy in current working directory.
profile: bool, default = False
When set to true, an interactive EDA report is displayed.
verbose: bool, default = True
When set to False, head of data is not displayed.
address: string, default = "https://raw.githubusercontent.com/pycaret/pycaret/master/datasets/"
Download url of dataset. For people have difficulty linking to github, they can change
the default address to their own (e.g. "https://gitee.com/IncubatorShokuhou/pycaret/raw/master/datasets/")
Returns:
pandas.DataFrame
Warnings
--------
- Use of ``get_data`` requires internet connection.
"""
import pandas as pd
import os.path
from IPython.display import display, HTML, clear_output, update_display
extension = ".csv"
filename = str(dataset) + extension
complete_address = address + filename
if os.path.isfile(filename):
data = pd.read_csv(filename)
else:
data = pd.read_csv(complete_address)
# create a copy for pandas profiler
data_for_profiling = data.copy()
if save_copy:
save_name = filename
data.to_csv(save_name, index=False)
if dataset == "index":
display(data)
else:
if profile:
import pandas_profiling
pf = pandas_profiling.ProfileReport(data_for_profiling)
display(pf)
else:
if verbose:
display(data.head())
return data
边栏推荐
- Web API 介绍和类型
- [1161. The maximum sum of elements in the layer]
- 【读书笔记->数据分析】02 数据分析准备
- 基于mysql的消息队列设计
- [QNX Hypervisor 2.2用户手册]9.16 system
- LeetCode--打家劫舍问题
- Keil nRF52832 download failed
- Recommendation system: Summary of common evaluation indicators [accuracy rate, precision rate, recall rate, hit rate, (normalized depreciation cumulative gain) NDCG, mean reciprocal ranking (MRR), ROC
- 继承和友元,静态成员的关系
- 二叉树遍历非递归程序 -- 使用栈模拟系统栈
猜你喜欢

手写一个简单的web服务器(B/S架构)

C# Rectangle basic usage and picture cutting

基于simulink的Passive anti-islanding-UVP/OVP and UFP/OFP被动反孤岛模型仿真

MLP神经网络,GRNN神经网络,SVM神经网络以及深度学习神经网络对比识别人体健康非健康数据

基于simulink的Active anti-islanding-AFD主动反孤岛模型仿真

面试突击69:TCP 可靠吗?为什么?

Shell common script: Nexus batch upload local warehouse script

Redis五种数据类型简介

Advanced Algebra _ Proof _ Any matrix is similar to an upper triangular matrix

基于mysql的消息队列设计
随机推荐
SQL injection Less47 (error injection) and Less49 (time blind injection)
二叉树遍历非递归程序 -- 使用栈模拟系统栈
Thinking and Implementation of Object Cache Service
力扣二叉树
命名实体识别-模型:BERT-MRC
Interview assault 69: TCP reliable?Why is that?
面试突击69:TCP 可靠吗?为什么?
Usage of mysql having
硬件设备计算存储及数据交互杂谈
无状态与有状态的区别
力扣2326、197
Redis五种数据类型简介
什么是动态规划,什么是背包问题
SQL注入 Less38(堆叠注入)
继承和友元,静态成员的关系
Weekly Summary
助力数字政府建设,中科三方构建域名安全保障体系
消息队列消息存储设计(架构实战营 模块八作业)
面试题:实现死锁
SQL注入 Less47(报错注入) 和Less49(时间盲注)