Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Analysis of various commonly used sentences in Python with examples

2025-03-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "Python various commonly used sentence example analysis", interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Now let the editor to take you to learn "Python various commonly used sentences for example analysis" it!

Anaconda 1pip list "or 3conda list", where pip list can only view the library On the other hand, conda list can view the library and its version 56 7pip install scipy 8pip install scipy-- upgrade "or 10conda install scipy11conda update scipy1213# updates all libraries 14conda update-- all1516# updates conda itself 17conda update conda1819# updates anaconda itself 20conda update anacondajupyter" Show all columns 2pd.set_option ('display.max_columns', None) 3 "display all rows 5pd.set_option (' display.max_rows', None) 6" set the display length of value to 100th The default is 50 8pd.set_option ('max_colwidth' 100) 91mm embedded drawing 11%matplotlib inline1213# drawing alone 14%matplotlib qt1516# drawing Chinese garbled, The minus sign 17plt.rcParams ['font.sans-serif'] = [' Microsoft YaHei'] 18plt.rcParams ['axes.unicode_minus'] = False1920# allows a cell to have multiple outputs at the same time print21from IPython.core.interactiveshell import InteractiveShell22InteractiveShell.ast_node_interactivity = "all" the main data analysis package 1import numpy as np 2import pandas as pd 3import matplotlib.pyplot as plt 4from matplotlib.figure import SubplotParams analyze we use SubplotParams to adjust the vertical spacing of subgraphs 6#plt.figure (figsize= (12) 6), dpi=200, subplotpars=SubplotParams (hspace=0.3) 7 8import scipy.stats as stats 9import seaborn as sns10import statsmodels.api as smSklearn 1from sklearn import datasets # Local data 2from sklearn.model_selection import train_test_split # data segmentation 3 4from sklearn.feature_extraction import DictVectorizer # feature extraction and vectorization 5from sklearn.preprocessing import PolynomialFeatures # polynomial feature construction 6 7from sklearn.feature_selection import VarianceThreshold # 8from sklearn.feature_selection import SelectKBest based on variance feature selection SelectPercentile # feature selection 9#For classification: chi2, f_classif, mutual_info_classif10#For regression: f_regression Mutual_info_regression11from sklearn.feature_selection import RFE # Recursive feature Elimination (Recursive Feature Elimination) 12from sklearn.feature_selection import SelectFromModel # feature selection based on Model 1314from sklearn.decomposition import PCA # Principal component Analysis 15from sklearn.manifold import MDS # Multidimensional scale Analysis 16from sklearn.manifold import TSNE # T Distribution and Random nearest neighbor embedded 1718from sklearn.pipeline import Pipeline # Pipeline 19from sklearn import metrics # Model Evaluation 20from sklearn.model_selection import GridSearchCV # Grid search Cross validation 21from sklearn.model_selection import KFold # K fold Cross validation 22from sklearn.model_selection import cross_val_score # Cross validation 2324from sklearn.linear_model import LinearRegression # Linear regression 2526from sklearn.linear_model import LogisticRegression # logical regression 2728from sklearn import svm # support Vector Machine 2930from sklearn.tree import DecisionTreeClassifier # decision Tree 31from sklearn.ensemble import RandomForestClassifier # Random Forest 32from sklearn.ensemble import GradientBoostingClassifier # gradient fetch Ascending 3334from sklearn.naive_bayes import MultinomialNB # polynomial naive Bayesian 35from sklearn.naive_bayes import BernoulliNB # Bernoulli naive Bayesian 36from sklearn.naive_bayes import GaussianNB # Gaussian naive Bayesian 3738from sklearn.neighbors import KNeighborsClassifier # k adjacent to 3940from sklearn.cluster import KMeans # k-means clustering 41from sklearn.cluster import DBSCAN # density-based spatial clustering 42from sklearn.cluster import SpectralClustering # spectral clustering 43from sklearn.cluster import Birch # hierarchical clustering 4445from Sklearn.externals import joblib # Save the model here I believe that everyone has a deeper understanding of "Python various commonly used sentence example analysis", might as well come to the actual operation of it! Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report