其他
牛逼!这个Python库竟然可以偷懒,和import说再见!
作者:xiaoyu,数据爱好者
Python数据科学出品
pip install pyforest
from pyforest import *
active_imports()
### Data Wrangling
pd = LazyImport("import pandas as pd")
np = LazyImport("import numpy as np")
dd = LazyImport("from dask import dataframe as dd")
SparkContext = LazyImport("from pyspark import SparkContext")
load_workbook = LazyImport("from openpyxl import load_workbook")
### Data Visualization and Plotting
mpl = LazyImport("import matplotlib as mpl")
plt = LazyImport("import matplotlib.pyplot as plt")
sns = LazyImport("import seaborn as sns")
py = LazyImport("import plotly as py")
go = LazyImport("import plotly.graph_objs as go")
px = LazyImport("import plotly.express as px")
dash = LazyImport("import dash")
bokeh = LazyImport("import bokeh")
alt = LazyImport("import altair as alt")
pydot = LazyImport("import pydot")
# statistics
statistics = LazyImport("import statistics")
### Machine Learning
sklearn = LazyImport("import sklearn")
OneHotEncoder = LazyImport("from sklearn.preprocessing import OneHotEncoder")
TSNE = LazyImport("from sklearn.manifold import TSNE")
train_test_split = LazyImport("from sklearn.model_selection import train_test_split")
svm = LazyImport("from sklearn import svm")
GradientBoostingClassifier = LazyImport(
"from sklearn.ensemble import GradientBoostingClassifier"
)
GradientBoostingRegressor = LazyImport(
"from sklearn.ensemble import GradientBoostingRegressor"
)
RandomForestClassifier = LazyImport(
"from sklearn.ensemble import RandomForestClassifier"
)
RandomForestRegressor = LazyImport("from sklearn.ensemble import RandomForestRegressor")
TfidfVectorizer = LazyImport(
"from sklearn.feature_extraction.text import TfidfVectorizer"
)
# TODO: add all the other most important sklearn objects
# TODO: add separate sections within machine learning viz. Classification, Regression, Error Functions, Clustering
# Deep Learning
tf = LazyImport("import tensorflow as tf")
keras = LazyImport("import keras")
# NLP
nltk = LazyImport("import nltk")
gensim = LazyImport("import gensim")
spacy = LazyImport("import spacy")
re = LazyImport("import re")
### Helper
sys = LazyImport("import sys")
os = LazyImport("import os")
re = LazyImport("import re")
glob = LazyImport("import glob")
Path = LazyImport("from pathlib import Path")
pickle = LazyImport("import pickle")
dt = LazyImport("import datetime as dt")
tqdm = LazyImport("import tqdm")
#############################
### User-specific imports ###
#############################
# You can save your own imports in ~/.pyforest/user_imports.py
# Please note: imports in ~/.pyforest/user_imports.py take precedence over the
# imports above.
赠送三本当当热销书籍
《Halcon机器视觉算法原理与编程实战》
👆扫描二维码 2 秒 购买书籍
3、{1,t},...,g_{c,t}...g_{n,t}>PyTorch中文版官方教程来了,附pdf下载
4、{1,t},...,g_{c,t}...g_{n,t}>神作《统计学习要素》的中文翻译、代码实现及其习题解答,附下载