Kaggle 泰坦尼克

入門kaggle,開始機器學習應用之旅。

參看一些入門的博客,感覺pandas,sklearn需要熟練掌握,同時也學到了一些很有用的tricks,包括數據分析和機器學習的知識點。下面記錄一些有趣的數據分析方法和一個自己擼的小程序。

?

1.Tricks

1) df.info():數據的特征屬性,包括數據缺失情況和數據類型。

? ? df.describe(): 數據中各個特征的數目,缺失值為NaN,以及數值型數據的一些分布情況,而類目型數據看不到。

? ? 缺失數據處理:缺失的樣本占總數比例極高,則直接舍棄;缺失樣本適中,若為非連續性特征則將NaN作為一個新類別加到類別特征中(0/1化),若為連續性特征可以將其離散化后把NaN作為新類別加入,或用平均值填充。

2)數據分析方法:將特征分為連續性數據:年齡、票價、親人數目;類目數據:生存與否、性別、等級、港口;文本類數據:姓名、票名、客艙名

3)數據分析技巧(畫圖、求相關性)

  • 畫圖

類目特征分布圖&&特征與生存情況關聯柱狀圖:

fig1 = plt.figure(figsize=(12,10))  # 設定大尺寸后使得圖像標注不重疊
fig1.set(alpha=0.2)  # 設定圖表顏色alpha參數

plt.subplot2grid((2,3),(0,0))             # 在一張大圖里分列幾個小圖
data_train.Survived.value_counts().plot(kind='bar')# 柱狀圖
plt.title(u"獲救情況 (1為獲救)") # 標題
plt.ylabel(u"人數")plt.subplot2grid((2,3),(0,1))
data_train.Pclass.value_counts().plot(kind="bar")
plt.ylabel(u"人數")
plt.title(u"乘客等級分布")plt.subplot2grid((2,3),(0,2))
plt.scatter(data_train.Survived, data_train.Age)
plt.ylabel(u"年齡")                         # 設定縱坐標名稱
plt.grid(b=True, which='major', axis='y')
plt.title(u"按年齡看獲救分布 (1為獲救)")plt.subplot2grid((2,3),(1,0), colspan=2)
data_train.Age[data_train.Pclass == 1].plot(kind='kde')
data_train.Age[data_train.Pclass == 2].plot(kind='kde')
data_train.Age[data_train.Pclass == 3].plot(kind='kde')
plt.xlabel(u"年齡")# plots an axis lable
plt.ylabel(u"密度")
plt.title(u"各等級的乘客年齡分布")
plt.legend((u'頭等艙', u'2等艙',u'3等艙'),loc='best') # sets our legend for our graph.
View Code

? ? ? ? ? ? ? ? ? ?

以上為3種在一張畫布實現多張圖的畫法:

ax1 = plt.subplot2grid((3,3), (0,0), colspan=3)  
ax2 = plt.subplot2grid((3,3), (1,0), colspan=2)  
ax3 = plt.subplot2grid((3,3), (1, 2), rowspan=2)  
ax4 = plt.subplot2grid((3,3), (2, 0))  
ax5 = plt.subplot2grid((3,3), (2, 1))  
plt.suptitle("subplot2grid")  
View Code

? ? ?? ? ? ? ? ? ? ? ?

此外,還有兩種方法等效:

f=plt.figure()
ax=fig.add_subplot(111)
ax.plot(x,y)plt.figure()
plt.subplot(111)
plt.plot(x,y)
View Code

連續性特征分布可以用直方圖hist來實現(見上圖-年齡分布直方圖):

figure1 = plt.figure(figsize=(6,6))
value_age = train_data['Age']
value_age.hist(color='b', alpha=0.5)  # 年齡分布直方圖
plt.xlabel(u'年齡')
plt.ylabel(u'人數')
plt.title(u'年齡分布直方圖')
View Code

類目特征與生存關系柱狀圖(見上圖-各乘客等級的獲救情況):

fig2 = plt.figure(figsize=(6,5))
fig2.set(alpha=0.2)
Survived_0 = data_train.Pclass[data_train.Survived==0].value_counts()
Survived_1 = data_train.Pclass[data_train.Survived==1].value_counts()
df = pd.DataFrame({u'獲救':Survived_1, u'未獲救':Survived_0})
df.plot(kind='bar', stacked=True)  # stacked=False時不重疊
plt.title(u"各乘客等級的獲救情況")
plt.xlabel(u"乘客等級")
plt.ylabel(u"人數")
plt.show()
View Code

各屬性與生存率進行關聯:

eg:艙位和性別?與存活率的關系:利用pandas中的groupby函數

Pclass_Gender_grouped=dt_train_p.groupby(['Sex','Pclass'])  #按照性別和艙位分組聚合  
PG_Survival_Rate=(Pclass_Gender_grouped.sum()/Pclass_Gender_grouped.count())['Survived']  #計算存活率  
  
x=np.array([1,2,3])  
width=0.3  
plt.bar(x-width,PG_Survival_Rate.female,width,color='r')  
plt.bar(x,PG_Survival_Rate.male,width,color='b')  
plt.title('Survival Rate by Gender and Pclass')  
plt.xlabel('Pclass')  
plt.ylabel('Survival Rate')  
plt.xticks([1,2,3])  
plt.yticks(np.arange(0.0, 1.1, 0.1))  
plt.grid(True,linestyle='-',color='0.7')  
plt.legend(['Female','Male'])  
plt.show()  #畫圖  
View Code

可以看到,不管是幾等艙位,都是女士的存活率遠高于男士。

?將連續性數據年齡分段后,畫不同年齡段的分布以及存活率:

age_train_p=dt_train_p[~np.isnan(dt_train_p['Age'])]  #去除年齡數據中的NaN  
ages=np.arange(0,85,5)  #0~85歲,每5歲一段(年齡最大80歲)  
age_cut=pd.cut(age_train_p.Age,ages)  
age_cut_grouped=age_train_p.groupby(age_cut)  
age_Survival_Rate=(age_cut_grouped.sum()/age_cut_grouped.count())['Survived']  #計算每年齡段的存活率  
age_count=age_cut_grouped.count()['Survived']  #計算每年齡段的總人數 

ax1=age_count.plot(kind='bar')  
ax2=ax1.twinx()  #使兩者共用X軸  
ax2.plot(age_Survival_Rate.values,color='r')  
ax1.set_xlabel('Age')  
ax1.set_ylabel('Number')  
ax2.set_ylabel('Survival Rate')  
plt.title('Survival Rate by Age')  
plt.grid(True,linestyle='-',color='0.7')  
plt.show()   
View Code

可以看到年齡主要在15~50歲左右,65~80歲死亡率較高,后面80歲存活率高是因為只有1人。

?

  • 相關性分析:

Parch、SibSp取值少,分布不均勻,不適合作為連續值來處理。可以將其分段化。這里分析一下Parch和SibSp與生存的關聯性

from sklearn.feature_selection import chi2
print("Parch:", chi2(train_data.filter(["Parch"]), train_data['Survived']))
print("SibSp:", chi2(train_data.filter(["SibSp"]), train_data['Survived']))
# chi2(X,y)  X.shape(n_samples, n_features_in)   y.shape(n_samples,)
# 返回 chi2 和 pval,  chi2值描述了自變量與因變量之間的相關程度:chi2值越大,相關程度也越大,
# http://guoze.me/2015/09/07/chi-square/
# 可以看到Parch比SibSp的卡方校驗取值大,p-value小,相關性更強。

?

4)數據預處理:

PassengerId 舍掉

Pclass為類目屬性,3類。本身有序的,暫時不進行dummy coding

Name 為文本屬性,舍掉,暫時不考慮

Sex為類目屬性,2類。本身無序,進行dummy coding

Age為連續屬性,確實較多可以用均值填充。幅度變化大。可以將其以5歲為step進行離散化或利用scaling將其歸一化到[-1,1]之間

SibSp為連續屬性,但比較離散,不適合按照連續值處理,暫時不用處理。或者可以按照其數量>3和<=3進行dummy coding

Parch為連續屬性。但比較離散,不適合按照連續值處理,暫時不用處理。

Ticket為文本屬性,舍掉,暫時不考慮

Fare為連續屬性,幅度變化大,可以利用scaling將其歸一化到[-1,1]之間

Cabin為類目屬性,但缺失嚴重,可以按照是否缺失來0/1二值化,進行dummy coding

Embarked為類目屬性,缺失值極少,先填充后進行dummy coding

?綜上,可用的數據特征有:Pclass,Sex,Age,SibSp,Parch,Fare,Cabin,Embarked

?此外需注意的是,需對訓練集和測試集的數據做同樣的處理。

?

?

2.實例

根據以上思路,一個小baseline誕生了:

import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from pandas import Series, DataFrame
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler
from sklearn.tree import DecisionTreeClassifier
from sklearn.metrics import classification_report
from learning_curve import *
from pylab import mpl
from sklearn.linear_model import LogisticRegression
from sklearn.model_selection import cross_val_score
mpl.rcParams['font.sans-serif'] = ['SimHei']  #使得plt操作可以顯示中文
from sklearn.feature_extraction import DictVectorizerdata_train = pd.read_csv('train.csv')
data_test = pd.read_csv('test.csv')feature = ['Pclass','Age','Sex','Fare','Cabin','Embarked','SibSp','Parch']  # 考慮的特征X_train = data_train[feature]
y_train = data_train['Survived']X_test = data_test[feature]X_train.loc[data_train['SibSp']<3, 'SibSp'] = 1   #按照人數3來劃分
X_train.loc[data_train['SibSp']>=3, 'SibSp'] = 0
X_train['Age'].fillna(X_train['Age'].mean(), inplace=True)
X_test.loc[data_test['SibSp']<3, 'SibSp']=1
X_test.loc[data_test['SibSp']>=3, 'SibSp'] = 0
X_test['Age'].fillna(X_test['Age'].mean(), inplace=True)  # 缺失的年齡補以均值
X_test['Fare'].fillna(X_test['Fare'].mean(), inplace=True)
# X_train.loc[X_train['Age'].isnull(), 'Age'] = X_train['Age'].mean()

dummies_SibSp = pd.get_dummies(X_train['SibSp'], prefix='SibSp')  #進行dummy coding
dummies_Sex = pd.get_dummies(X_train['Sex'], prefix= 'Sex')
dummies_Pclass = pd.get_dummies(X_train['Pclass'], prefix='Pclass')
dummies_Emabrked = pd.get_dummies(X_train['Embarked'], prefix='Embarked')ss=StandardScaler()X_train.loc[X_train['Cabin'].isnull(), 'Cabin'] = 1
X_train.loc[X_train['Cabin'].notnull(), 'Cabin'] = 0
X_train['Age_new'] = (X_train['Age']/5).astype(int)
X_train['Fare_new'] = ss.fit_transform(X_train.filter(['Fare']))
X_train = pd.concat([X_train, dummies_Sex, dummies_Pclass, dummies_Emabrked, dummies_SibSp], axis=1)
X_train.drop(['Age', 'Sex', 'Pclass', 'Fare','Embarked', 'SibSp'], axis=1, inplace=True)dummies_SibSp = pd.get_dummies(X_test['SibSp'], prefix='SibSp')
dummies_Sex = pd.get_dummies(X_test['Sex'], prefix= 'Sex')
dummies_Pclass = pd.get_dummies(X_test['Pclass'], prefix='Pclass')
dummies_Emabrked = pd.get_dummies(X_test['Embarked'], prefix='Embarked')X_test['Age_new'] = (X_test['Age']/5).astype('int')
X_test['Fare_new'] = ss.fit_transform(X_test.filter(['Fare']))
X_test = pd.concat([X_test, dummies_Sex, dummies_Pclass, dummies_Emabrked, dummies_SibSp], axis=1)
X_test.drop(['Age', 'Sex', 'Pclass', 'Fare','Embarked','SibSp'], axis=1, inplace=True)
X_test.loc[X_test['Cabin'].isnull(), 'Cabin'] = 1
X_test.loc[X_test['Cabin'].notnull(), 'Cabin'] = 0dec = LogisticRegression()  # logistic回歸
dec.fit(X_train, y_train)
y_pre = dec.predict(X_test)# 交叉驗證
all_data = X_train.filter(regex='Cabin|Age_.*|Fare_.*|Sex.*|Pclass_.*|Embarked_.*|SibSp_.*_Parch')
X_cro = all_data.as_matrix()
y_cro = y_train.as_matrix()
est = LogisticRegression(C=1.0, penalty='l1', tol=1e-6)
print(cross_val_score(dec, X_cro, y_cro, cv=5))# 保存結果
# result = pd.DataFrame({'PassengerId':data_test['PassengerId'].as_matrix(), 'Survived':y_pre.astype(np.int32)})
# result.to_csv("my_logisticregression_1.csv", index=False)# 學習曲線
plot_learning_curve(dec, u"學習曲線", X_train, y_train)# 查看各個特征的相關性
columns = list(X_train.columns)
plt.figure(figsize=(8,8))
plot_df = pd.DataFrame(dec.coef_.ravel(), index=columns)
plot_df.plot(kind='bar')
plt.show()# 分析SibSp
# survived_0 = data_train.SibSp[data_train['Survived']==0].value_counts()
# survived_1 = data_train.SibSp[data_train['Survived']==1].value_counts()
# df = pd.DataFrame({'獲救':survived_1, '未獲救':survived_0})
# df.plot(kind='bar', stacked=True)
# plt.xlabel('兄妹個數')
# plt.ylabel('獲救情況')
# plt.title('兄妹個數與獲救情況')

# 不加SibSp [ 0.70 0.80446927 0.78651685 0.76966292 0.79661017] # 加上SibSp [ 0.70 0.78212291 0.80337079 0.79775281 0.81355932]# logistic:[ 0.78212291 0.80446927 0.78651685 0.76966292 0.80225989] why?

?

3.結果分析與總結

1)學習曲線函數:

import numpy as np
import matplotlib.pyplot as plt
from sklearn.model_selection import learning_curve# 用sklearn的learning_curve得到training_score和cv_score,使用matplotlib畫出learning curve
def plot_learning_curve(estimator, title, X, y, ylim=None, cv=None, n_jobs=1,train_sizes=np.linspace(.05, 1., 20), verbose=0, plot=True):"""畫出data在某模型上的learning curve.參數解釋----------estimator : 你用的分類器。title : 表格的標題。X : 輸入的feature,numpy類型y : 輸入的target vectorylim : tuple格式的(ymin, ymax), 設定圖像中縱坐標的最低點和最高點cv : 做cross-validation的時候,數據分成的份數,其中一份作為cv集,其余n-1份作為training(默認為3份)n_jobs : 并行的的任務數(默認1)"""train_sizes, train_scores, test_scores = learning_curve(estimator, X, y, cv=cv, n_jobs=n_jobs, train_sizes=train_sizes, verbose=verbose)train_scores_mean = np.mean(train_scores, axis=1)train_scores_std = np.std(train_scores, axis=1)test_scores_mean = np.mean(test_scores, axis=1)test_scores_std = np.std(test_scores, axis=1)if plot:plt.figure(1)plt.title(title)if ylim is not None:plt.ylim(*ylim)plt.xlabel(u"訓練樣本數")plt.ylabel(u"得分")plt.gca().invert_yaxis()plt.grid()plt.fill_between(train_sizes, train_scores_mean - train_scores_std, train_scores_mean + train_scores_std,alpha=0.1, color="b")plt.fill_between(train_sizes, test_scores_mean - test_scores_std, test_scores_mean + test_scores_std,alpha=0.1, color="r")plt.plot(train_sizes, train_scores_mean, 'o-', color="b", label=u"訓練集上得分")plt.plot(train_sizes, test_scores_mean, 'o-', color="r", label=u"交叉驗證集上得分")plt.legend(loc="best")plt.draw()plt.show()plt.gca().invert_yaxis()midpoint = ((train_scores_mean[-1] + train_scores_std[-1]) + (test_scores_mean[-1] - test_scores_std[-1])) / 2diff = (train_scores_mean[-1] + train_scores_std[-1]) - (test_scores_mean[-1] - test_scores_std[-1])return midpoint, diff
learning_curve.py

見下圖:將learning_curve畫出可以看到兩者在0.8左右趨于平行,但是正確率不夠高,應該是屬于欠擬合。所以可以考慮加入新的特征,再對特征進行更深的挖掘 。

? ? ? ?

?

2)特征相關性分析圖

columns = list(X_train.columns)
plt.figure(figsize=(8,8))
plot_df = pd.DataFrame(dec.coef_.ravel(), index=columns)
plot_df.plot(kind='bar')
plt.show()
View Code

結果見下圖:通過logistic學到的參數權重

?性別、等級和親屬相關性較強,而親屬在前面已經了解到相關性并不強,所以可以對這一特征加以優化,例如將Parch+SibSp作為一個新特征。

?其他特征或正相關或負相關,但都不太明顯。

?cabin怎么沒有相關性呢?

?

3)交叉驗證

# 交叉驗證
all_data = X_train.filter(regex='Cabin|Age_.*|Fare_.*|Sex.*|Pclass_.*|Embarked_.*|SibSp_.*_Parch')
X_cro = all_data.as_matrix()
y_cro = y_train.as_matrix()
est = LogisticRegression(C=1.0, penalty='l1', tol=1e-6)
print(cross_val_score(dec, X_cro, y_cro, cv=5))
View Code

每次通過訓練集學習到參數后進行分類,但是怎么評價結果的好壞呢,可以利用交叉驗證來實現,根據交叉驗證的結果大致可以知道運用于測試集的結果。

?這是本次測試的交叉驗證結果: ?[ 0.78212291 0.80446927 0.78651685 0.76966292 0.80225989]

實際提交到Kaggle上時候準確率為0.7751

?

?

?

參考

機器學習系列(3)_邏輯回歸應用之Kaggle泰坦尼克之災

機器學習筆記(1)-分析框架-以Kaggle Titanic問題為例

機器學習一小步:Kaggle上的練習Titanic: Machine Learning from Disaster(一)

轉載于:https://www.cnblogs.com/king-lps/p/7576452.html

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/253322.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/253322.shtml
英文地址,請注明出處:http://en.pswp.cn/news/253322.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

語音交互設備 前端信號處理技術和語音交互過程介紹

一、前端信號處理 1. 語音檢測&#xff08;VAD&#xff09; 語音檢測&#xff08;英文一般稱為 Voice Activity Detection&#xff0c;VAD&#xff09;的目標是&#xff0c;準確的檢測出音頻信號的語音段起始位置&#xff0c;從而分離出語音段和非語音段&#xff08;靜音或噪…

css中偽類與偽元素的區別

一&#xff1a;偽類&#xff1a;1:定義&#xff1a;css偽類用于向某些選擇器添加特殊效果。 偽類其實與普通的css類相類似&#xff0c;可以為已有的元素添加樣式&#xff0c;但是他只有處于dom無法描述的狀態下才能為文檔樹中的元素添加樣式&#xff0c;所以將其稱為偽類。 2:偽…

【BZOJ1500】[NOI2005]維修數列 Splay

【BZOJ1500】[NOI2005]維修數列 Description Input 輸入的第1 行包含兩個數N 和M(M ≤20 000)&#xff0c;N 表示初始時數列中數的個數&#xff0c;M表示要進行的操作數目。第2行包含N個數字&#xff0c;描述初始時的數列。以下M行&#xff0c;每行一條命令&#xff0c;格式參見…

bzoj2588: Spoj 10628. Count on a tree(樹上第k大)(主席樹)

每個節點繼承父節點的樹&#xff0c;則答案為query(root[x]root[y]-root[lca(x,y)]-root[fa[lca(x,y)]]) #include<iostream> #include<cstring> #include<cstdlib> #include<cstdio> #include<algorithm> using namespace std; const int maxn1…

圖文詳解YUV420數據格式

YUV格式有兩大類&#xff1a;planar和packed。 對于planar的YUV格式&#xff0c;先連續存儲所有像素點的Y&#xff0c;緊接著存儲所有像素點的U&#xff0c;隨后是所有像素點的V。 對于packed的YUV格式&#xff0c;每個像素點的Y,U,V是連續交*存儲的。 YUV&#xff0c;分為三個…

USB通信接口介紹

1. 概述 Usb Universal Serial Bus全稱通用串行總線&#xff0c;是一種支持熱插拔的高速串行傳輸總線&#xff0c;使用差分信號來傳輸數據。 USB設備可以直接和host通信&#xff0c;或者通過hub和host通信。一個USB系統中僅有一個USB主機&#xff0c;設備包括功能設備和hub&…

關于java中BufferedReader的read()及readLine()方法的使用心得

BufferedReader的readLine()方法是阻塞式的, 如果到達流末尾, 就返回null, 但如果client的socket末經關閉就銷毀, 則會產生IO異常. 正常的方法就是使用socket.close()關閉不需要的socket. 從一個有若干行的文件中依次讀取各行&#xff0c;處理后輸出&#xff0c;如果用以下方法…

HDCVI——一種創新性的高清視頻傳輸方案

什么是HDCVI 2012年11月&#xff0c;大華技術股份有限公司發布了具有自主知識產權的同軸高清傳輸接口技術HDCVI。HDCVI技術是一種基于已有SYV75-3或SYV75-5同軸電纜的高清視頻傳輸方法&#xff0c;能夠在低成本和較低質量的同軸電纜上實現超長距離高清視頻信號的可靠傳輸。相比…

typedef struct 用法

如果在c程序中我們寫&#xff1a;    typedef struct     {    int num;    int age;    }aaa,bbb,ccc;    這算什么呢&#xff1f;    我個人觀察編譯器&#xff08;VC6&#xff09;的理解&#xff0c;這相當于    typedef struct     …

智能機器人品牌簡介

隨著科技的發展&#xff0c;硬件的計算速度和大數據支撐&#xff0c;越來越多的智能化設備和產品出現在我們的面前&#xff0c;為我們的生活帶來更多便利。其中包括智能機器人&#xff0c;這種產品是有自己的“大腦”&#xff0c;可以接收人為指令&#xff0c;為人服務&#xf…

轉 Java對日期Date類進行加減運算一二三

請移步&#xff0c;https://blog.csdn.net/hacker_lees/article/details/74351838 &#xff0c;感謝博主分享轉載于:https://www.cnblogs.com/bestxyl/p/9790088.html

誕生之日 隨筆

今天我誕生了&#xff0c;祝自己誕生日happy&#xff0c;happy&#xff0c;happy&#xff01; 轉載于:https://www.cnblogs.com/xiaohuihui-/p/7594406.html

智能音箱 之 麥克風參數介紹

1. 定義 麥克風&#xff0c;學名為傳聲器&#xff0c;是將聲音信號轉換為電信號的能量轉換器件&#xff1b;聲—電轉換。 與揚聲器正好相反&#xff08;電—聲轉換&#xff09;&#xff0c;構成電聲設備的兩個終端&#xff0c;俗稱咪頭&#xff0c;麥克等。 是電聲系統的入口&a…

大屏幕行業發展現狀以及趨勢深刻剖析

瀏覽數: 689 海康威視&#xff1a;葉志龍 中國投影網&#xff1a;大屏幕顯示作為安防領域重要一環&#xff0c;而海康威視作為安防領域的佼佼者&#xff0c;請介紹海康威視大屏顯示系統DLP/LCD這兩大產品線&#xff1f;與行業同類產品相比&#xff0c;海康威視大屏拼接單元產品…

架構師是大忽悠嗎?阿里技術大牛告訴你真相!

來源&#xff1a;阿里云 作者&#xff1a;林昊&#xff08;花名畢玄&#xff09;&#xff0c;阿里巴巴技術保障部研究員&#xff0c;曾任淘寶網平臺架構部架構師。個人的研究方向主要為Java模塊化、動態化系統的構建&#xff0c;以及高性能大型分布式Java系統構建&#xff0c;主…

動手動腦-Java重載

有以下例子&#xff1a; 例&#xff1a; Using overloaded methods public class MethodOverload { public static void main(String[] args) { System.out.println("The square of integer 7 is " square(7)); System.out.println("\nThe square of double 7.…

利用django框架,手把手教你搭建數據可視化系統(一)

如何使用django去構建數據可視化的 web,可視化的結果可以呈現在web上。 使用django的MTV模型搭建網站 基礎鋪墊—MTV模型 Created with Raphal 2.1.0Request服務器&#xff08;Djangoweb&#xff09;Response首先&#xff0c;要搞清楚我們去訪問服務器&#xff0c;服務器返回信…

智能音箱 之 揚聲器喇叭介紹

在全雙工語音交互的系統中&#xff0c;功放的質量是非常重要的&#xff0c;因為AEC回聲消除對信號失真 是非常敏感的。音頻通路的整體諧波失真需要控制在5%以內。 對于整個系統的諧波失真來說&#xff0c;揚聲器是最關鍵的因素&#xff0c;其次是功放&#xff0c;麥克風的很小…

關于拓撲排序的問題-P3116 [USACO15JAN]會議時間Meeting Time

https://www.luogu.org/problem/show?pid3116 這道題目很水啊&#xff0c;但是我沒有1A&#xff0c;而且wa了好多&#xff1b; 題目意思我就不講了&#xff1b; 反正就是一個拓撲序dp&#xff1b; 但是這道題目規定了起點是1&#xff1b; 所以我一開始直接把1放進隊列里然…

HD-SDI DVR發展與應用剖析

自2010年以來&#xff0c;視頻監控已經進入“高清”監控時代&#xff1b;隨著高清的發展&#xff0c;HD-SDI高清數字系統開始進入人們的視線&#xff0c;在大、小展會上均可以輕松找到“數字高清”的產品和解決方案。作為HD-SDI系統中編碼、存儲部分的HD-SDI高清數字硬盤錄像機…