current position:Home>Python libraries you may not know
Python libraries you may not know
2022-01-30 13:55:03 【DebugUsery】
You may not know Python library
In this article , I put forward some things that many people don't know Python A rare Library in . These libraries are excellent at performing specific tasks . therefore , It's good to have some contact with them .
Let's get started !
1. Pattern
This Python library Pattern
It's an open source library , For natural language processing 、 Network mining and data analysis tasks based on machine learning . The main focus of this library is its ease of use for users .
This library can perform various tasks , Such as Text processing 、 data mining And from various sources Extract the data . The syntax of this library is very simple and clear . therefore , Users with both scientific and non scientific backgrounds can easily use it .
Installation method
pip install pattern
Copy code
Example
from pattern.en import sentiment
Copy code
Emotional scores and subjectivity have been returned as output .
The emotional score of a given sentence is 0.75, This means that it is a highly positive sentence . Subjectivity 0.8 It means that the given sentence is the user's personal opinion .
2.Eli5
Eli5
It's a useful Python library , It is used to debug and check machine learning classifiers and interpret the prediction results of these classifiers . It supports various machine learning packages and frameworks , Such as Keras
、scikit-learn
、LightGBM
、XGBoost
、CatBoost
etc. .
There are two ways to understand machine learning models using this library .
- Understand the weight of the model by analyzing the weight of the model
global
performance . - By analyzing the prediction of a single sample to understand the accuracy of the model
local
performance .
Installation method .
pip install eli5
Copy code
3.CatBoost
stay Python in ,CatBoost
By Yandex An open source machine learning algorithm developed by the company .CatBoost It's made up of two words ,Category and Boosting.
This library can be used to process different types of data , Such as images 、 Text 、 Audio and other classified data .Boost It means that this library is based on gradient lifting Library , Compared with other lifting algorithms, such as XGBoost It works the same way .
The advantage of this library is that it can provide... Without adjusting parameters High accuracy , And it also provides GPU Support To speed up training .
Installation method
pip install catboost
Copy code
Example
import numpy as npfrom catboost import CatBoost, Pool
Copy code
This is how we use this algorithm to predict .
4.Bokeh
Bokeh
yes Python A data visualization Library in , Used to create interactive charts 、 Drawing and graphics . The output and visualization of this library can be used in various media , Such as Notebook、HTML and Flask, And based on Django Internet applications .
adopt Boken, We can create various visualizations , From simple diagrams to complex and high-end dashboards . It also allows us to write without JavaScript Code created by JavaScript Driven Visualization .
Installation method
pip install bokeh
Copy code
Example
from bokeh.plotting import figure, output_notebook, show
Copy code
Output
The picture is provided by the author
use Bokeh Visualization is quite simple and direct .
5.StatsModels
This StatsModels
Library is one of the most useful modules for statistical analysis of data . This library allows users to perform statistical tests and explore data .
This library is built on Numpy and Scipy On top of the library . If you want to analyze the data and estimate the statistical model , This library is a good tool .
Installation method
pip install statsmodels
Copy code
Example
import numpy as npimport statsmodels.api as sm
Copy code
Output
6.SpaCy
spaCy
It's a Python Open source library , Natural language processing for analyzing and processing data . It has many built-in functions , Because it uses Cython Compiling . It has user-friendly API, It's very simple to use .
Installation method
pip install -U pip setuptools wheel
Copy code
Example
We will look at... Through an example of discourse tagging spaCy Operating condition . Voice part or PoS Tagging is a common task in natural language processing .
import spacy nlp = spacy.load('en_core_web_sm')
Copy code
Output
Apple --> PROPN is --> AUX the --> DET first --> ADJ U.S. --> PROPN public --> ADJ company --> NOUN to --> PART reach --> VERB a --> DET $ --> SYM 1 --> NUM trillion --> NUM market --> NOUN value --> NOUN
Copy code
Conclusion
That's all for this article . In this article , We discussed some that are not very popular but are useful for performing specific tasks Python library .
These libraries are for those who Python Programming doesn't have much contact with its library , But it's also convenient for people who want to perform specific tasks . Because the syntax of these libraries is simple and clear , So it's very convenient for them .
Thanks for reading !
copyright notice
author[DebugUsery],Please bring the original link to reprint, thank you.
https://en.pythonmana.com/2022/01/202201301355000242.html
The sidebar is recommended
- Python code reading (Part 44): find the location of qualified elements
- Elegant implementation of Django model field encryption
- 40 Python entry applet
- Pandas comprehensive application
- Chapter 2: Fundamentals of python-3 character string
- Python pyplot draws a parallel histogram, and the x-axis value is displayed in the center of the two histograms
- [Python crawler] detailed explanation of selenium from introduction to actual combat [1]
- Curl to Python self use version
- Python visualization - 3D drawing solutions pyecharts, Matplotlib, openpyxl
- Use python, opencv's meanshift and CAMSHIFT algorithms to find and track objects in video
guess what you like
-
Using python, opencv obtains and changes pixels, modifies image channels, and trims ROI
-
[Python data collection] university ranking data collection
-
[Python data collection] stock information collection
-
Python game development, pyGame module, python takes you to realize a magic tower game from scratch (2)
-
Python solves the problem of suspending execution after clicking the mouse in CMD window (fast editing mode is prohibited)
-
[Python from introduction to mastery] (II) how to run Python? What are the good development tools (pycharm)
-
Python type hints from introduction to practice
-
Python notes (IX): basic operation of dictionary
-
Python notes (8): basic operations of collections
-
Python notes (VII): definition and use of tuples
Random recommended
- Python notes (6): definition and use of lists
- Python notes (V): string operation
- Python notes (IV): use of functions and modules
- Python notes (3): conditional statements and circular statements
- Python notes (II): lexical structure
- Notes on python (I): getting to know Python
- [Python data structure series] - tree and binary tree - basic knowledge - knowledge point explanation + code implementation
- [Python daily homework] Day7: how to combine two dictionaries in an expression?
- How to implement a custom list or dictionary in Python
- 15 advanced Python tips for experienced programmers
- Python string method tutorial - how to use the find() and replace() functions on Python strings
- Python computer network basics
- Python crawler series: crawling global airport information
- Python crawler series: crawling global port information
- How to calculate unique values using pandas groupby
- Application of built-in distribution of Monte Carlo simulation SciPy with Python
- Gradient lifting method and its implementation in Python
- Pandas: how to group and calculate by index
- Can you create an empty pandas data frame and fill it in?
- Python basic exercises teaching! can't? (practice makes perfect)
- Exploratory data analysis (EDA) in Python using SQL and Seaborn (SNS).
- Turn audio into shareable video with Python and ffmpeg
- Using rbind in python (equivalent to R)
- Pandas: how to create an empty data frame with column names
- Talk about quantifying investment using Python
- Python, image restoration in opencv - CV2 inpaint
- Python notes (14): advanced technologies such as object-oriented programming
- Python notes (13): operations such as object-oriented programming
- Python notes (12): inheritance such as object-oriented programming
- Chapter 2: Fundamentals of python-5 Boolean
- Python notes (11): encapsulation such as object-oriented programming
- Python notes (10): concepts such as object-oriented programming
- Gradient lifting method and its implementation in Python
- Van * Python | simple crawling of a site course
- Chapter 1 preliminary knowledge of pandas (list derivation and conditional assignment, anonymous function and map method, zip object and enumerate method, NP basis)
- Nanny tutorial! Build VIM into an IDE (Python)
- Fourier transform of Python OpenCV image processing, lesson 52
- Introduction to python (III) network request and analysis
- China Merchants Bank credit card number recognition project (Part I), python OpenCV image processing journey, Part 53
- Python practice - capture 58 rental information and store it in MySQL database