数据科学图书馆

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}$

转换: Image

分发: Image

样品: Image

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)

Image

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)

Image

print(pl.analyze_df(openml_df,'target',10))

Image

data_df=pl.get_important_features(openml_df,'target')pl.get_bar(data_df,'bar.png','Importance','Feature_Name')

Image

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)

Image

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)

Image

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()

Image

cluster_df[cluster_df['text_cluster']==9]['text_stem_lem']

Image

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java变量始终存储0值。为什么?   如何使用Java/REST将Azure blob从一个存储容器移动到另一个存储容器?   java将commons DBCP从1.2升级到1.4,我应该害怕吗?   java如何使用分隔符拆分字符串?   java使用数组读取json对象   java在groovy中切片字符串   交换数组java的两个邻域元素   java移动用于确定字符串是否为回文的逻辑   java Android应用程序在一个活动中崩溃   java Sparkjava将webapp文件夹设置为静态资源/模板的文件夹   java复杂条件表达式,用户易用。   java如何仅在表存在时从表中选择值   java I无法将数据从Recyclerview传递到其他活动   java数据结构最佳设计(大数据)   java Android从DatePickerDialogFragment中删除日历视图   java将数据从Firebase获取到片段   数组。sort()在java中运行不正常