? ???? ?? ??? ?? ???? ???? ???? ????? ????? ???? ??? ?????.
???? ? ???
1. ???
??? ????? ???? ???? ?????? ???? ???? ?? ?? ?????? ???. ???? ??? ?? ?? ?? ???? ????? ??? ??? ??? ?? ?? ?????. ???? ??? ?? ??/?? ??? ??? ?? ?? ??? ???? ?? ??/??? ??? ?? ???.
?? ???: "???? ??: ??? ??? ???? ?? ??? ??? ???? ????? ???? ?????. ?? ??? ???? ?? ??? ??? ?? ???? ???? ???? ?? ? ?? ?????." 2. ????
??? ???? ??? ???? ??? ? ?? ?? ??????? ???. ???? ??? ??? ??? ?? ?? ??? ????? ????. ? ?? ?? ??? ?? ?? ??? ??? ??? ?? ? ? ????. ?? ??? ?? ???? ???? ?? ????? ???? ?? ??? ? ????. ???? ??? ???? ?? ??? ???? ???, ??? ?? ??? ?? ???? ??? ? ????. ??? ?? ???? ???? ??? ??? ????? ?? ???? ???.
???? ?? ??: ??? ??? ???? ?? ??? ??? ?????. ??? ???? ?? ??? ??? ? ???, ??? ?? ???? ??? ?? ?????. ??? ??? ??????? ?? ??? ?? ?????. ??? ??? ??? ???? ??? ???? ???? ??? ? ????. ??? ??? ?? ???? ?? ??? ????? ? ??? ??? ??? ? ????. ??
Learning Curve
?? ??? ??? ?? ??? ????? ???? ?? ?? ??? ?? ? ?? ??? ?????. ?? ??(??? ?? ???? ?? ??)? ????? ?? ?? ?? ??? ???? ??? ???? ? ??? ? ? ????. ??? ???? ?? ?? ?? ??? ???? ??? ?? ???? ?? ?? ??? ??? ? ????. ?????, ??? ????? ?? ?? ??? ???? ?? ???? ?? ? ????. 'learning_curve' ??? Scikit-Learn? 'model_selection' ???? ??? ? ????.
from sklearn.model_selection import learning_curve
#The function below builds the model and returns cross validation scores, train score and learning curve data def learn_curve(X,y,c): ''' param X: Matrix of input featuresparam y: Vector of Target/Labelc: Inverse Regularization variable to control overfitting (high value causes overfitting, low value causes underfitting)''' '''We aren't splitting the data into train and test because we will use StratifiedKFoldCV.KFold CV is a preferred method compared to hold out CV, since the model is tested on all the examples.Hold out CV is preferred when the model takes too long to train and we have a huge test set that truly represents the universe''' le = LabelEncoder() # Label encoding the target sc = StandardScaler() # Scaling the input features y = le.fit_transform(y)#Label Encoding the target log_reg = LogisticRegression(max_iter=200,random_state=11,C=c) # LogisticRegression model # Pipeline with scaling and classification as steps, must use a pipelne since we are using KFoldCV lr = Pipeline(steps=(['scaler',sc],['classifier',log_reg])) cv = StratifiedKFold(n_splits=5,random_state=11,shuffle=True) # Creating a StratifiedKFold object with 5 folds cv_scores = cross_val_score(lr,X,y,scoring="accuracy",cv=cv) # Storing the CV scores (accuracy) of each fold lr.fit(X,y) # Fitting the model train_score = lr.score(X,y) # Scoring the model on train set #Building the learning curve train_size,train_scores,test_scores =learning_curve(estimator=lr,X=X,y=y,cv=cv,scoring="accuracy",random_state=11) train_scores = 1-np.mean(train_scores,axis=1)#converting the accuracy score to misclassification rate test_scores = 1-np.mean(test_scores,axis=1)#converting the accuracy score to misclassification rate lc =pd.DataFrame({"Training_size":train_size,"Training_loss":train_scores,"Validation_loss":test_scores}).melt(id_vars="Training_size") return {"cv_scores":cv_scores,"train_score":train_score,"learning_curve":lc}
1. ?? ??? ?? ??
'learn_curve' ??? ?????. ???? ??/???? 'c'? 1? ???? ?? ?? ??? ?? ? ????(?, ???? ???? ????).
lc = learn_curve(X,y,1) print(f'Cross Validation Accuracies:\n{"-"*25}\n{list(lc["cv_scores"])}\n\n\ Mean Cross Validation Accuracy:\n{"-"*25}\n{np.mean(lc["cv_scores"])}\n\n\ Standard Deviation of Deep HUB Cross Validation Accuracy:\n{"-"*25}\n{np.std(lc["cv_scores"])}\n\n\ Training Accuracy:\n{"-"*15}\n{lc["train_score"]}\n\n') sns.lineplot(data=lc["learning_curve"],x="Training_size",y="value",hue="variable") plt.title("Learning Curve of Good Fit Model") plt.ylabel("Misclassification Rate/Loss");
? ???? ?? ?? ???? ?? ???? ?????.
?? ??(???): ? ?? ??? ?? ??? ?? ?? ?? ???? ?? ????? ???? ??????. ?? ? ?? ?? ??? ???? ??? ??? ???? ? ??? ?????. ?? ???.
?? ??(???): ? ?? ??? ?? ??? ???? ?? ??? ??? ?? ?? ?? ???? ?? ????? ???? ??????. ?? ??? ???? ? ?? ??? ?? ? ??? ?? "??? ??" ???? ??? ? ????
?????, ???? ?? ?? ??? ??? ?? ?? ??? ?? ??? ?? ???? ?? ? ? ????.
2. ??? ??? ?? ??
'learn_curve' ??? ???? ??? ??? ?? ?? ????('c' ?? ????? ???).
lc = learn_curve(X,y,10000) print(f'Cross Validation Accuracies:\n{"-"*25}\n{list(lc["cv_scores"])}\n\n\ Mean Cross Validation Deep HUB Accuracy:\n{"-"*25}\n{np.mean(lc["cv_scores"])}\n\n\ Standard Deviation of Cross Validation Accuracy:\n{"-"*25}\n{np.std(lc["cv_scores"])} (High Variance)\n\n\ Training Accuracy:\n{"-"*15}\n{lc["train_score"]}\n\n') sns.lineplot(data=lc["learning_curve"],x="Training_size",y="value",hue="variable") plt.title("Learning Curve of an Overfit Model") plt.ylabel("Misclassification Rate/Loss");
與擬合模型相比,交叉驗(yàn)證精度的標(biāo)準(zhǔn)差較高。
過擬合模型的學(xué)習(xí)曲線一開始的訓(xùn)練損失很低,隨著訓(xùn)練樣例的增加,學(xué)習(xí)曲線逐漸增加,但不會變平。過擬合模型的學(xué)習(xí)曲線在開始時(shí)具有較高的驗(yàn)證損失,隨著訓(xùn)練樣例的增加逐漸減小并且不趨于平坦,說明增加更多的訓(xùn)練樣例可以提高模型在未知數(shù)據(jù)上的性能。同時(shí)還可以看到,訓(xùn)練損失和驗(yàn)證損失彼此相差很遠(yuǎn),在增加額外的訓(xùn)練數(shù)據(jù)時(shí),它們可能會彼此接近。
3、欠擬合模型的學(xué)習(xí)曲線
將反正則化變量/參數(shù)' c '設(shè)置為1/10000來獲得欠擬合模型(' c '的低值導(dǎo)致欠擬合)。
lc = learn_curve(X,y,1/10000) print(f'Cross Validation Accuracies:\n{"-"*25}\n{list(lc["cv_scores"])}\n\n\ Mean Cross Validation Accuracy:\n{"-"*25}\n{np.mean(lc["cv_scores"])}\n\n\ Standard Deviation of Cross Validation Accuracy:\n{"-"*25}\n{np.std(lc["cv_scores"])} (Low variance)\n\n\ Training Deep HUB Accuracy:\n{"-"*15}\n{lc["train_score"]}\n\n') sns.lineplot(data=lc["learning_curve"],x="Training_size",y="value",hue="variable") plt.title("Learning Curve of an Underfit Model") plt.ylabel("Misclassification Rate/Loss");
與過擬合和良好擬合模型相比,交叉驗(yàn)證精度的標(biāo)準(zhǔn)差較低。
欠擬合模型的學(xué)習(xí)曲線在開始時(shí)具有較低的訓(xùn)練損失,隨著訓(xùn)練樣例的增加逐漸增加,并在最后突然下降到任意最小點(diǎn)(最小并不意味著零損失)。這種最后的突然下跌可能并不總是會發(fā)生。這表明增加更多的訓(xùn)練樣例并不能提高模型在未知數(shù)據(jù)上的性能。
總結(jié)
在機(jī)器學(xué)習(xí)和統(tǒng)計(jì)建模中,過擬合(Overfitting)和欠擬合(Underfitting)是兩種常見的問題,它們描述了模型與訓(xùn)練數(shù)據(jù)的擬合程度如何影響模型在新數(shù)據(jù)上的表現(xiàn)。
分析生成的學(xué)習(xí)曲線時(shí),可以關(guān)注以下幾個(gè)方面:
- 欠擬合:如果學(xué)習(xí)曲線顯示訓(xùn)練集和驗(yàn)證集的性能都比較低,或者兩者都隨著訓(xùn)練樣本數(shù)量的增加而緩慢提升,這通常表明模型欠擬合。這種情況下,模型可能太簡單,無法捕捉數(shù)據(jù)中的基本模式。
- 過擬合:如果訓(xùn)練集的性能隨著樣本數(shù)量的增加而提高,而驗(yàn)證集的性能在一定點(diǎn)后開始下降或停滯不前,這通常表示模型過擬合。在這種情況下,模型可能太復(fù)雜,過度適應(yīng)了訓(xùn)練數(shù)據(jù)中的噪聲而非潛在的數(shù)據(jù)模式。
根據(jù)學(xué)習(xí)曲線的分析,你可以采取以下策略進(jìn)行調(diào)整:
- 對于欠擬合:
- 增加模型復(fù)雜度,例如使用更多的特征、更深的網(wǎng)絡(luò)或更多的參數(shù)。
- 改善特征工程,嘗試不同的特征組合或轉(zhuǎn)換。
- 增加迭代次數(shù)或調(diào)整學(xué)習(xí)率。
- 對于過擬合:
使用正則化技術(shù)(如L1、L2正則化)。
減少模型的復(fù)雜性,比如減少參數(shù)數(shù)量、層數(shù)或特征數(shù)量。
增加更多的訓(xùn)練數(shù)據(jù)。
應(yīng)用數(shù)據(jù)增強(qiáng)技術(shù)。
使用早停(early stopping)等技術(shù)來避免過度訓(xùn)練。
通過這樣的分析和調(diào)整,學(xué)習(xí)曲線能夠幫助你更有效地優(yōu)化模型,并提高其在未知數(shù)據(jù)上的泛化能力。
? ??? ?? ??? ?? ???? ???? ??? ?? ?????. ??? ??? PHP ??? ????? ?? ?? ??? ?????!

? AI ??

Undress AI Tool
??? ???? ??

Undresser.AI Undress
???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover
???? ?? ???? ??? AI ?????.

Clothoff.io
AI ? ???

Video Face Swap
??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

?? ??

??? ??

???++7.3.1
???? ?? ?? ?? ???

SublimeText3 ??? ??
??? ??, ???? ?? ????.

???? 13.0.1 ???
??? PHP ?? ?? ??

???? CS6
??? ? ?? ??

SublimeText3 Mac ??
? ??? ?? ?? ?????(SublimeText3)

? ???? 6? 27?? Jianying? ByteDance? ???? FaceMeng Technology?? ??? ??? ?? ??????? ??????. ? ?????? Douyin ???? ???? ?? ????? ??? ???? ?? ?? ??? ???? ?????. Windows, MacOS ? ?? ?? ??. Jianying? ??? ??? ?????? ?? ???? ??? ??, ??? ?????, ??? ???, ??? ?? ?? ? ??? AI ?? ??? ???? ??? SVIP? ??????. ????? SVIP ??? ? ??? 79??, ?? ??? 599??(? ??? ??: ? 49.9??? ??), ?? ?? ???? ? 59??, ?? ?? ???? 59?????. ?? 499??(? 41.6??)???. ??, ? ???? "??? ?? ??? ?? ?? VIP? ???? ???

?? ?? ?? ? ???? ???? AI ?? ???? ???? ??? ???, ??? ? ???? ??????. EnhancingAICodingAssistantswithContextUsingRAGandSEM-RAG?? ???, ?? JanakiramMSV. ?? AI ????? ???? ????? ??? ???, ????? ??? ?? ???? ??? ????? ??? ?? ???? ??? ???? ??? ?? ???? ?? ??? ?? ??? ???? ??? ??? ????. ??? ?? ???? ??? ??? ??? ???? ? ??? ???? ? ????? ?? ?? ?? ??, ?? ? ???? ??? ?? ??? ????. ?? ?? ??? ??????? ???? ?? ????? ????? ?? ??? ???? ??? ????.

AIGC? ?? ??? ????? ??? ?????. 51CTOAI.x ???? https://www.51cto.com/aigc/Translator|Jingyan Reviewer|Chonglou? ??? ????? ? ? ?? ???? ?? ??? ????. ?????? ??? ???? ???. LLM(?? ?? ??)? ??? ??, ?? ?? ??(GenAI) ? ?? ?? ???? ?? ? ????? ????. ??? ??? ????? ??? ??? ????? ?? ?? ???? ???? ??? ???? ??? ???? ???? ? ??? ???. LLM? ??? ??, ??? ??, ?? ?? ? ?? ???? ?? ???? ????? ??? ? ????. LLM? ??? ?????? ???? ???? ??? ? ????.

LLM(?? ?? ??)? ??? ??? ???????? ???? ??? ?? ??? ?????. ? ??? ????? ???? ??? ? ??? ? ????. ??? ??? ?? ??? ??? ??? "???"???. ?? ??? ??? ??? ??? ??? ?????. ??? ????? ?? ???? ? ??? ???? ??? ??? ?? ????? ???? ??? ?????. ??? ??? ?? ?????? ???? ?? ?? ???, ??? RAG? ?? ?? ???? ??? ? ???? ?? ??? ?? ??? ??? ???? ????? ?? ??? ??? ?????. ??? ?? ??? ?? ?? ??? ?? ?? LLM ???? ??? ???? ?????. ??? ??? ???? ?? ??? ??? ?? ?????.

?? ??? ????? ??????? ??? ???? ?????? ???? ??? ???? ? ?? ??? ???? ?? ??? ??? ?????. ????? ??? ??, ??? ??, ?? ???, ?? ?? ? ??? ???? ??? ???? ??? ?? ??? ????? ????. ?? ?? ???? ??? ??? ??? ???, ? ? ?? ??? ?? 5?? ??? "?? ??? 5? ??"?? ???. 5? ?? ??? ????, ???? ??, ????, ???? ??, ??????. 1. ??????? ??? ????? ??? ??? ?? ??? ?? ??? ???? ?? ?????. ? ?? ??? ??? ??? ?? ??? ????? ????.

??? |ScienceAI ?? ??(QA) ??? ??? ??? ??(NLP) ??? ???? ? ??? ??? ???. ??? QA ??? ??? ??? ?? ???? ? ??? ? ?? ?? ??? LLM(?? ?? ??)? ??, ?? ??? ??? ???? ???? ??? ????? ???? ??? ??? ? ????. ?? ??, ??, ??? ? ?? ??? ???? ???? QA ??? ??? ?? ??? ??? ??? ???? ??? ? ?? ??? ????. ??, ??? ??? ??? ???? ???? ??? ????? ???? ??? ??? ?? ?? ??? ???? ??? ??? ?? ?? ??? ??? ???? ? ????. ?? ?? ??? Q&A?

????? ?? ???? VSCode? ??? ??? ??? ???? ???? ?? ??? ???? ???? ??? ?????. ?? ? ? ?? ???? ??? ??? ???? VSCode? AI ?? ???? ???? ???? ?? ???? ?? ???????. VSCode? AI ?? ???? ?? ?? ? ???? ??? ???? ?? ???? ?? ???????. ?? ?? ??? ???? ??? ????? ???? ??? ?? ??, ?? ?? ??, ?? ?? ? ?? ??? ???? ?? ???? ???? ??? ??? ?? ??? ?? ????. ??? ???? ????? ??? ??? ? VSCode ????? ?? AI ?? ??? 12?? ??? ??????.

1? ? ??? ??? ??? SK????? ??(1?) ??? ???? ?? 8? 6??? 8??? ?? ?????? ??????? ??? ??? ??? ??? ?? FMS2024? ????? ???. ?? ??? ??? ??. ???? ??? ?? ??? ???? ?? ???, ???? ?? NAND ????? ???? ? ??? ??? ??(FlashMemorySummit)??? ?? ??? ? ???? ??(FutureMemoryandStorage) ??? ??? ?? ??? ? ???? ??(FutureMemoryandStorage)?? ??? ??????. DRAM ? ???? ????? ? ?? ????? ?????. SK????? ??? ??? ???
