数据科学图书馆
polar的Python项目详细描述
极性
polar是一个Python模块,包含易于使用的数据科学函数。 它是建立在SciPy,scikit learn,seaborn和pandas之上的。在
安装
如果你已经安装了numpy和scipy,
安装parkitny的最简单方法是使用pip
:
pip install polar seaborn pandas scikit-learn scipy matplotlib numpy nltk -U
依赖关系
polar要求:
- Python(>;=3.5)
- 数量(>;=1.11.0)
- 压缩性(>;=0.17.0)
- Seaborn公司(>;=0.9.0)
- scikit学习(>;=0.21.3)
- nltk(>;=3.4.5)
- python pptx(>;=0.6.18)
- 密码学(>2.8)
- 学习
Jupyter笔记本示例
以下是jupyter笔记本的链接,下面介绍了所有示例 Polar-Examples
ACA(自动队列分析)示例
ACA为数据集中的每个要素创建三个热图。在
- 转换热图-每个特征值的转换
- 分布热图-按特征值分布
- 尺寸热图-每个特征值的总样本数
数据文件: ACA_date.csv
最终结果功率点: ACA.pptx
^{pr2}$转换:
分发:
样品:
EDA示例
importpandasaspdimportopenmlimportpolaraspldataset=openml.datasets.get_dataset(31)X,y,categorical_indicator,attribute_names= \ dataset.get_data(target=dataset.default_target_attribute,dataset_format='dataframe')openml_df=pd.DataFrame(X)openml_df['target']=ydata_df=pl.analyze_correlation(openml_df,'target')pl.get_heatmap(data_df,'correlation_heat_map.png',1.1,14,'0.1f',0,100,5,5)
data_df=pl.analyze_association(openml_df,'target',verbose=0)pl.get_heatmap(data_df,'association_heat_map.png',1.1,12,'0.1f',0,100,10,10)
print(pl.analyze_df(openml_df,'target',10))
data_df=pl.get_important_features(openml_df,'target')pl.get_bar(data_df,'bar.png','Importance','Feature_Name')
NLP示例
importnltknltk.download('wordnet')importpandasaspdimportpolarasplfromcryptography.fernetimportFerneturl="https://raw.githubusercontent.com/pparkitn/imagehost/master/test_real_or_not_from_kaggle.csv"data_df=pd.read_csv(url)data_df.drop(columns=['id','keyword','location'],inplace=True)data_df.head(3)
key=Fernet.generate_key()data_df['text_encrypted']=data_df['text'].apply(pl.encrypt_df,args=(key,))data_df['text_decrypted']=data_df['text_encrypted'].apply(pl.decrypt_df,args=(key,))data_df['text_stem']=data_df['text_decrypted'].apply(pl.nlp_text_process,args=('stem',))data_df['text_stem_lem']=data_df['text_stem'].apply(pl.nlp_text_process,args=('lem',))data_df.head(3)
cluster_df=pl.nlp_cluster(data_df,'text_stem_lem',10,'text_cluster',1.0,1,100,1,'KMeans',(1,2))[0]cluster_df.groupby(['text_cluster']).count()
cluster_df[cluster_df['text_cluster']==9]['text_stem_lem']
- 项目
标签: