数据科学图书馆

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第三方库


热门话题
c#安卓发布字节数组(图像)到WCF restful服务   java Android随机对象   如何在java中使用Jsch库处理密码过期   java动态SSL密钥库/证书选择   java Scroll在JScrollPane中不起作用   swing如何在java netbeans中创建隐藏的“退出”按钮?   java如何在NetBeans中刷新自定义bean?   java在主循环中“优雅地”中断线程   比较一下。java文件到。类文件   java读取14位和16位图像   java 安卓如何使用SharedReference编程秒表   java My应用程序在点击按钮后崩溃   清单3.7实际上是如何在java并发中工作的?   接收asn。通过javasocket发送1条消息   java读取带有数字的txt文件并将其保存在字符串矩阵中   shell将参数从java类传递到sh文件   spring属性“serviceBeans”引发异常;嵌套的例外是java。lang.NoSuchMethodError:javax。ws。rs.Path。有限公司