hyperopt、optuna、gridsearch、randomsearch自動調參

開始使?hyperopt進??動調參

algo = partial(tpe.suggest, n_startup_jobs=1)
best = fmin(lightgbm_factory, space, algo=algo, max_evals=20,
pass_expr_memo_ctrl=None)
RMSE = lightgbm_factory(best)
print(‘best :’, best)
print(‘best param after transform :’)
argsDict_tranform(best,isPrint=True)
print(‘rmse of the best lightgbm:’, np.sqrt(RMSE))
model= MultiOutputRegressor(LGBMRegressor(**best))#,device=‘gpu’))
return model
def tune_optuna_lightgbm_model(train_x, train_y,test_x,test_y):
from lightgbm import log_evaluation, early_stopping
callbacks = [log_evaluation(period=100), early_stopping(stopping_rounds=100)]

def objective(trial):#x_test,y_test
param = {
‘metric’: ‘rmse’,
‘random_state’: 48,
‘n_estimators’: 2,#0000,
‘reg_alpha’: trial.suggest_loguniform(‘reg_alpha’, 1e-3, 10.0),
‘reg_lambda’: trial.suggest_loguniform(‘reg_lambda’, 1e-3, 10.0),
‘colsample_bytree’: trial.suggest_categorical(‘colsample_bytree’,
[0.3,0.4,0.5,0.6,0.7,0.8,0.9, 1.0]),
‘subsample’: trial.suggest_categorical(‘subsample’, [0.4,0.5,0.6,0.7,0.8,1.0]),
‘learning_rate’: trial.suggest_categorical(‘learning_rate’,
[0.006,0.008,0.01,0.014,0.017,0.02]),
‘max_depth’: trial.suggest_categorical(‘max_depth’, [5, 7, 9, 11, 13, 15, 17, 20,
50]),
‘num_leaves’ : trial.suggest_int(‘num_leaves’, 1, 1000),
‘min_child_samples’: trial.suggest_int(‘min_child_samples’, 1, 300),
‘cat_smooth’ : trial.suggest_int(‘cat_smooth’, 1, 100) ,
‘verbose’:-1,
}
mlgb= MultiOutputRegressor(LGBMRegressor(**param))
mlgb.?t(train_x, train_y)#, eval_set=[(X_test, y_test)],callbacks=callbacks)
pred_lgb=mlgb.predict(test_x)
rmse = mean_squared_error(test_y, pred_lgb, squared=False)
return rmse
study=optuna.create_study(direction=‘minimize’)
n_trials=2#50 # try50次
study.optimize(objective, n_trials=n_trials)
print(‘Number of ?nished trials:’, len(study.trials))
print(“------------------------------------------------”)
print(‘Best trial:’, study.best_trial.params)
print(“------------------------------------------------”)
print(“study.best_params:”,study.best_params)
print(“------------------------------------------------”)
print(study.trials_dataframe())
print(“------------------------------------------------”)
optuna.visualization.plot_optimization_history(study).show()
#plot_parallel_coordinate: interactively visualizes the hyperparameters and scores
optuna.visualization.plot_parallel_coordinate(study).show()
params=study.best_params
model=MultiOutputRegressor(LGBMRegressor(**params))
return model
ridge_model=Ridge(alpha=10e-6,?t_intercept=True)
def tune_GridSearchCV_ridge_model(train_x, train_y,test_x,test_y):
from sklearn.model_selection import GridSearchCV
model=Ridge(?t_intercept=True)
alpha_can = np.logspace(-1, 1, 10)#(-10, 10, 1000)
model = GridSearchCV(model, param_grid={‘alpha’: alpha_can}, cv=5)
return model
###########超短期預測-3.模型訓練與預測-輸出最后1個點情況##########
def ultrashorttime_model_make_result(train_x,
train_y,test_x,test_y,model,modelname,Cap,result_):
model.?t(train_x, train_y)
print(“=“+modelname+”=”)
#save model
joblib.dump(model, path+r’/model/‘+modelname+r’ultrashorttime.pkl’)
#load model
model
= joblib.load(path+r’/model/'+modelname+r’ultrashorttime.pkl’)
pred_y = model
.predict(test_x)
test_y,pred_y=test_y[:,-1],pred_y[:,-1]
print(test_y.shape,pred_y.shape)

校正

for j in range(len(pred_y)):
pred_y[j] = np.round(pred_y[j], 3)
if pred_y[j] < 0:
pred_y[j] = ?oat(0)
if pred_y[j]>Cap:
pred_y[j]=Cap
mse=mean_squared_error(test_y,pred_y)
rmse=np.sqrt(mean_squared_error(test_y,pred_y))
mae=mean_absolute_error(test_y,pred_y)
mape = mean_absolute_percentage_error(test_y, pred_y)
r2score=r2_score(test_y, pred_y)
print(‘mse:’,mse)
print(‘rmse:’,rmse)
print(‘mae’,mae)
print(‘mape’,mape)
print(‘r2score’,r2score)
#分辨率參數-dpi,畫布??參數-?gsize
#plt.?gure(dpi=300,?gsize=(24,8))
plt.title(modelname+str(“預測結果”))
plt.plot(test_y.ravel(),label=“真實數據”)
plt.plot(pred_y.ravel(),label=“預測值”)
plt.legend(loc=1)
plt.save?g(path+r"/pictures/“+modelname+“超短期.png”)
plt.close()
result_[‘真實值’]=test_y
result_[‘預測值’]=pred_y
result_.to_csv(path+r”/result/“+modelname+“超短期.csv”, sep=‘,’)
modelname=[“Catboost”,“Lightgbm”,“Ridge”]
‘’’
ultrashorttime_model_make_result(train_x,
train_y,test_x,test_y,catboost_model,modelname[0],Cap)
ultrashorttime_model_make_result(train_x,
train_y,test_x,test_y,lightgbm_model,modelname[1],Cap)
ultrashorttime_model_make_result(train_x,
train_y,test_x,test_y,ridge_model,modelname[2],Cap)
‘’’
###########超短期預測-4.模型訓練與預測-輸出16個點情況##########
#########按照要求模型預測16個點,但是為了便于部署模型預測出相應的時間點,在實際
中,通常多預測出來?個點,變為預測17個點
#print(”“+“超短期16個點預測開始”+”********“)
def ultrashorttime_model_make_result_16output(train_x,
train_y,test_x,test_y,model,modelname,Cap,result16):
model.?t(train_x, train_y)
print(”=“+modelname+”=“)
#save model
joblib.dump(model, path+r’/model/‘+modelname+r’ultrashorttime.pkl’)
#load model
model
= joblib.load(path+r’/model/'+modelname+r’ultrashorttime.pkl’)
pred_y = model
.predict(test_x)
test_y_,pred_y_=test_y[:,-1],pred_y[:,-1]
print(test_y_.shape,pred_y_.shape)
mse=mean_squared_error(test_y_,pred_y_)
rmse=np.sqrt(mean_squared_error(test_y_,pred_y_))
mae=mean_absolute_error(test_y_,pred_y_)
mape = mean_absolute_percentage_error(test_y_, pred_y_)
r2score=r2_score(test_y_, pred_y_)
print(‘mse:’,mse)
print(‘rmse:’,rmse)
print(‘mae’,mae)
print(‘mape’,mape)
print(‘r2score’,r2score)
#分辨率參數-dpi,畫布??參數-?gsize
#plt.?gure(dpi=300,?gsize=(24,8))
plt.title(modelname+str(“預測結果”))
plt.plot(test_y_.ravel(),label=“真實數據”)
plt.plot(pred_y_.ravel(),label=“預測值”)
plt.legend(loc=1)
plt.save?g(path+r”/pictures/“+modelname+“超短期16個點取最后?個點畫圖.png”)
plt.close()
def correction(jj):
for j in range(len(pred_y[:,jj])):
pred_y[:,jj][j] = np.round(pred_y[:,jj][j], 3)
if pred_y[:,jj][j] < 0:
pred_y[:,jj][j] = ?oat(0)
if pred_y[:,jj][j]>Cap:
pred_y[:,jj][j]=Cap
for j in range(16):
correction(j)
result16[‘真實值’]=test_y_
for i in range(16):
result16[‘預測值’+str(i)]=pred_y[:,i]
result16.to_csv(path+r”/result/“+modelname+“超短期16個點.csv”, sep=‘,’)
modelname=[“Catboost”,“Lightgbm”,“Ridge”]
‘’’
ultrashorttime_model_make_result_16output(train_x,
train_y,test_x,test_y,catboost_model,modelname[0],Cap)
ultrashorttime_model_make_result_16output(train_x,
train_y,test_x,test_y,lightgbm_model,modelname[1],Cap)
ultrashorttime_model_make_result_16output(train_x,
train_y,test_x,test_y,ridge_model,modelname[2],Cap)
‘’’
if name == “main”:
###########場站數據##########
Cap=17
data=pd.read_csv(path+r”/data/with_nwp2024-05-14.csv", parse_dates=True,
index_col=‘時間’)
data = data.sort_index()
print(“場站數據:”,data.shape)
print(data.head())
print(“===============================場站數據相關性
===============================”)
print(data.corr())
data.plot(?gsize=(24,10))
plt.save?g(path+r"/pictures/with_nwp.png")
plt.close()
data[‘實際功率’]=data[‘實際功率’].map(lambda x: x if x> 0 else 0)
data= data[[“實際功率”,“預測?速”]]
#刪除某?中某個值為0的?
data= data[data[‘實際功率’] != np.nan]
data=data.?llna(value=‘0’)
‘’’
print(“===?成短期預測數據集
“)
#?成短期預測數據集
x_train, y_train,x_test,y_test,result=make_shorttime_data(data)
print(”=短期預測catboost?動調參VS?動調參
=“)
print(“1.短期預測catboost?動調參或者使?默認參數結果:”)
shorttime_model_make_result(x_train,
y_train,x_test,y_test,model_catboost,“catboost”,Cap,result)
print(“2.短期預測catboost使?hyperopt?動調參結果:”)
tune_hyperopt_catboost=tune_hyperopt_model_catboost(x_train, y_train,x_test,y_test)
shorttime_model_make_result(x_train, y_train,x_test,y_test,
tune_hyperopt_catboost,“tune_hyperopt_catboost”,Cap,result)
print(“3.短期預測catboost使?optuna?動調參結果:”)
tune_optuna_catboost=tune_optuna_model_catboost(x_train, y_train,x_test,y_test)
shorttime_model_make_result(x_train, y_train,x_test,y_test,
tune_optuna_catboost,“tune_optuna_catboost”,Cap,result)
print(”

“)
print(“1.短期預測lightgbm?動調參或者使?默認參數結果:”)
shorttime_model_make_result(x_train,
y_train,x_test,y_test,model_lightgbm,“lightgbm”,Cap,result)
print(“2.短期預測lightgbm使?hyperopt?動調參結果:”)
tune_hyperopt_lightgbm=tune_hyperopt_model_lightgbm(x_train, y_train,x_test,y_test)
shorttime_model_make_result(x_train, y_train,x_test,y_test,
tune_hyperopt_lightgbm,“tune_hyperopt_lightgbm”,Cap,result)
print(“3.短期預測lightgbm使?optuna?動調參結果:”)
tune_optuna_lightgbm=tune_optuna_model_lightgbm(x_train, y_train,x_test,y_test)
shorttime_model_make_result(x_train, y_train,x_test,y_test,
tune_optuna_lightgbm,“tune_optuna_lightgbm”,Cap,result)
print(“4.短期預測lightgbm使?RandomizedSearchCV?動調參結果:”)
#tune_RandomizedSearchCV_lightgbm=ttune_RandomizedSearchCV_model_lightgbm(x_tr
ain, y_train,x_test,y_test)
#shorttime_model_make_result(x_train, y_train,x_test,y_test,
tune_RandomizedSearchCV_lightgbm,“tune_RandomizedSearchCV_lightgbm”,Cap,result)
print(“5.短期預測lightgbm的交叉驗證結果:”)
cv_lightgbm=CV_model_lightgbm(x_train,y_train,x_test,y_test)
shorttime_model_make_result(x_train, y_train,x_test,y_test,
cv_lightgbm,“cv_lightgbm”,Cap,result)
print(”

“)
print(“1.短期預測ridge?動調參或者使?默認參數結果:”)
shorttime_model_make_result(x_train,
y_train,x_test,y_test,model_ridge,“ridge”,Cap,result)
print(“2.短期預測ridge使?GridSearchCV?動調參結果:”)
tune_GridSearchCV_ridge=tune_GridSearchCV_model_ridge(x_train,
y_train,x_test,y_test)
shorttime_model_make_result(x_train, y_train,x_test,y_test,
tune_GridSearchCV_ridge,“tune_GridSearchCV_ridge”,Cap,result)
‘’’
print(”=?成超短期預測數據集
“)
#?成超短期預測數據集
train_x, train_y,test_x,test_y,result_,result16=make_ultrashorttime_data(data)
print(”=超短期預測catboost?動調參VS?動調參
=“)
print(“1.超短期預測catboost?動調參或者使?默認參數結果:”)
ultrashorttime_model_make_result(train_x,
train_y,test_x,test_y,catboost_model,“catboost”,Cap,result_)
print(“2.超短期預測catboost使?hyperopt?動調參結果:”)
tune_hyperopt_catboost_=tune_hyperopt_catboost_model(train_x, train_y,test_x,test_y)
ultrashorttime_model_make_result(train_x,
train_y,test_x,test_y,tune_hyperopt_catboost_,“tune_hyperopt_catboost_”,Cap,result_)
print(“3.超短期預測catboost使?optuna?動調參結果:”)
tune_optuna_catboost_=tune_optuna_catboost_model(train_x, train_y,test_x,test_y)
ultrashorttime_model_make_result(train_x, train_y,test_x,test_y,
tune_optuna_catboost_,“tune_optuna_catboost_”,Cap,result_)
print(”

“)
print(“1.超短期預測lightgbm?動調參或者使?默認參數結果:”)
ultrashorttime_model_make_result(train_x,
train_y,test_x,test_y,lightgbm_model,“lightgbm”,Cap,result_)
print(“2.超短期預測lightgbm使?hyperopt?動調參結果:”)
tune_hyperopt_lightgbm_=tune_hyperopt_lightgbm_model(train_x, train_y,test_x,test_y)
ultrashorttime_model_make_result(train_x,
train_y,test_x,test_y,tune_hyperopt_lightgbm_,“tune_hyperopt_lightgbm_”,Cap,result_)
print(“3.超短期預測lightgbm使?optuna?動調參結果:”)
tune_optuna_lightgbm_=tune_optuna_lightgbm_model(train_x, train_y,test_x,test_y)
ultrashorttime_model_make_result(train_x, train_y,test_x,test_y,
tune_optuna_lightgbm_,“tune_optuna_lightgbm_”,Cap,result_)
print(”

“)
print(“1.超短期預測ridge?動調參或者使?默認參數結果:”)
ultrashorttime_model_make_result(train_x,
train_y,test_x,test_y,model_ridge,“ridge”,Cap,result_)
print(“2.超短期預測ridge使?GridSearchCV?動調參結果:”)
tune_GridSearchCV_ridge_=tune_GridSearchCV_ridge_model(train_x,
train_y,test_x,test_y)
ultrashorttime_model_make_result(train_x, train_y,test_x,test_y,
tune_GridSearchCV_ridge_,“tune_GridSearchCV_ridge”,Cap,result_)
print(”=超短期預測16個點catboost?動調參VS?動調參
=“)
print(“1.超短期預測catboost?動調參或者使?默認參數結果:”)
ultrashorttime_model_make_result_16output(train_x,
train_y,test_x,test_y,catboost_model,“catboost”,Cap,result16)
print(“2.超短期預測catboost使?hyperopt?動調參結果:”)
#tune_hyperopt_catboost_=tune_hyperopt_catboost_model(train_x,
train_y,test_x,test_y)
ultrashorttime_model_make_result_16output(train_x,
train_y,test_x,test_y,tune_hyperopt_catboost_,“tune_hyperopt_catboost_”,Cap,result16)
print(“3.超短期預測catboost使?optuna?動調參結果:”)
#tune_optuna_catboost_=tune_optuna_catboost_model(train_x, train_y,test_x,test_y)
ultrashorttime_model_make_result_16output(train_x, train_y,test_x,test_y,
tune_optuna_catboost_,“tune_optuna_catboost_”,Cap,result16)
print(”

“)
print(“1.超短期預測lightgbm?動調參或者使?默認參數結果:”)
ultrashorttime_model_make_result_16output(train_x,
train_y,test_x,test_y,lightgbm_model,“lightgbm”,Cap,result16)
print(“2.超短期預測lightgbm使?hyperopt?動調參結果:”)
#tune_hyperopt_lightgbm_=tune_hyperopt_lightgbm_model(train_x,
train_y,test_x,test_y)
ultrashorttime_model_make_result_16output(train_x,
train_y,test_x,test_y,tune_hyperopt_lightgbm_,“tune_hyperopt_lightgbm_”,Cap,result16)
print(“3.超短期預測lightgbm使?optuna?動調參結果:”)
#tune_optuna_lightgbm_=tune_optuna_lightgbm_model(train_x, train_y,test_x,test_y)
ultrashorttime_model_make_result_16output(train_x, train_y,test_x,test_y,
tune_optuna_lightgbm_,“tune_optuna_lightgbm_”,Cap,result16)
print(”

====================”)
print(“1.超短期預測ridge?動調參或者使?默認參數結果:”)
ultrashorttime_model_make_result_16output(train_x,
train_y,test_x,test_y,model_ridge,“ridge”,Cap,result16)
print(“2.超短期預測ridge使?GridSearchCV?動調參結果:”)
#tune_GridSearchCV_ridge_=tune_GridSearchCV_ridge_model(train_x,
train_y,test_x,test_y)
ultrashorttime_model_make_result_16output(train_x, train_y,test_x,test_y,
tune_GridSearchCV_ridge_,“tune_GridSearchCV_ridge”,Cap,result16)

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

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

相關文章

【Jenkins】Centos7安裝Jenkins(環境:JDK11,tomcat9,maven3.8)

目錄 Jenkins部署環境Maven安裝1.上傳安裝包2.解壓3.配置Maven環境變量4.使配置文件立即生效5.校驗Maven安裝6.Maven配置阿里云倉庫7.Maven配置依賴下載位置 Git安裝安裝監測安裝 JDK17安裝1.查看舊版本JDK2.卸載舊版本JDK3.查看是否卸載干凈4.創建java目錄5.下載JDK11安裝包6.…

“開源與閉源大模型:數據隱私、商業應用與社區參與的多維比較“

開源大模型和閉源大模型各有其優勢和局限&#xff0c;它們在數據隱私、商業應用和社區參與方面的表現也各有不同。以下是對這三個方面進行的分析&#xff1a; 方向一&#xff1a;數據隱私 開源大模型&#xff1a; 優點&#xff1a;開源模型通常允許用戶和開發者查看和修改代…

Excel中Lookup函數

#Excel查找函數最常用的是Vlookup&#xff0c;而且是經常用其精確查找。Lookup函數的強大之處在于其“二分法”的原理。 LOOKUP&#xff08;查找值&#xff0c;查找區域&#xff08;Vector/Array&#xff09;&#xff0c;[返回結果區域]&#xff09; 為什么查找區域必須升序/…

一種處理checked exception的方法

一種處理checked exception的方法 在網上看到的一種處理異常的方法 public abstract class Try<V> {private Try() {}public abstract Boolean isSuccess();public abstract Boolean isFailure();public abstract void throwException();public abstract Throwable getMe…

【UE HTTP】“BlueprintHTTP Server - A Web Server for Unreal Engine”插件使用記錄

1. 在商城中下載“BlueprintHTTP Server - A Web Server for Unreal Engine”插件 該插件的主要功能有如下3點&#xff1a; &#xff08;1&#xff09;監聽客戶端請求。 &#xff08;2&#xff09;可以將文件直接從Unreal Engine應用程序提供到Web。 &#xff08;3&#xff…

Antd Vue項目引入TailwindCss之后出現svg icon下移,布局中的問題解決方案

目錄 1. 現象&#xff1a; 2. 原因分析&#xff1a; 3. 解決方案&#xff1a; 寫法一&#xff1a;擴展Preflight 寫法二&#xff1a; 4. 禁用 Preflight 1. 現象&#xff1a; Antd Vue項目引入TailwindCss之后出現svg icon下移&#xff0c;不能對齊顯示的情況&#xff0…

k8s筆記 | Prometheus安裝

kube-prometheus 基于github安裝 選擇對應的版本 這里選擇 https://github.com/prometheus-operator/kube-prometheus/tree/release-0.11 下載修改為國內鏡像源 image: quay.io 改為 quay.mirrors.ustc.edu.cn image: k8s.gcr.io 改為 lank8s.cn 創建 prometheus-ingres…

在AndroidStudio創建虛擬手機DUB-AI20

1.DUB-AI20介紹 DUB-AL20是華為暢享9全網通機型。 華為暢享9采用基于Android 8.1定制的EMUI 8.2系統&#xff0c;最大的亮點是配置了1300萬AI雙攝、4000mAh大電池以及AI人臉識別功能&#xff0c;支持熄屏快拍、笑臉抓拍、聲控拍照、手勢拍照等特色的拍照功能&#xff0c;支持移…

Windows安裝mingw32/w64

1.下載 MinGW-w64 WinLibs - GCCMinGW-w64 compiler for Windows Releases niXman/mingw-builds-binaries (github.com) MinGW-w64、UCRT 和 MSVCRT 是 Windows 平臺上常用的 C/C 運行庫&#xff0c;它們有以下不同點&#xff1a; MinGW-w64&#xff1a;是一個基于 GCC 的…

Edge瀏覽器報錯:Ref A Ref B: Ref C

今天發現微軟Edge瀏覽器非常頻繁的出現以下報錯&#xff1a;Ref A: 0BF6B9E03845450C8E6A6C31006AD7B9 Ref B: BJ1EDGE1116 Ref C: 2024-05-23T12:41:30Z 通過搜索發現用如下問題解決&#xff1a; 1.打開Edge瀏覽器 2.進入設置選項 3.找到隱私、搜索和服務 4.關閉跟蹤防護后面…

【數據結構】【C語言】堆~動畫超詳細解讀!

目錄 1 什么是堆1.1 堆的邏輯結構和物理結構1.2 堆的訪問1.3 堆為什么物理結構上要用數組?1.4 堆數據上的特點 2 堆的實現2.1 堆類型定義2.2 需要實現的接口2.3 初始化堆2.4 銷毀堆2.5 堆判空2.6 交換函數2.7 向上調整(小堆)2.8 向下調整(小堆)2.9 堆插入2.10 堆刪除2.11 //堆…

微服務項目收獲和總結---第2,3天(分庫分表思想,文章業務)

①分庫分表思想 文章表一對一為什么要拆分&#xff1f;因為文章的內容會非常大&#xff0c;查詢效率會很低&#xff0c;我們經常操作文章的基本信息&#xff0c;不會很經常查詢文章內容。充分發揮高頻數據的操作效率。 ②freemarker和minIO 由于文章內容數據量過大&#xff0c…

git clone 出現的問題

問題: core源碼ref新API % git clone https://github.com/xxxx.git Cloning into core... remote: Enumerating objects: 58033, done. remote: Counting objects: 100% (1393/1393), done. remote: Compressing objects: 100% (750/750), done. error: 432 bytes of body are …

辦公自動化-Python如何提取Word標題并保存到Excel中?

辦公自動化-Python如何提取Word標題并保存到Excel中&#xff1f; 應用場景需求分析實現思路實現過程安裝依賴庫打開需求文件獲取word中所有標題去除不需要的標題創建工作簿和工作表分割標題功能名稱存入測試對象GN-TC需求標識符存入測試項標識存入需求標識符 完整源碼實現效果學…

Nginx學習與使用記錄

這里寫自定義目錄標題 定義域名&#xff08;本地&#xff09;Nginx的一下常用命令記錄win系統使用 .bat來啟動nginx配置 定義域名&#xff08;本地&#xff09; 本地定義域名不需要證書&#xff0c;直接更改hosts文件。 注意&#xff1a;在這個文件夾中是無法更改hosts文件的&…

Vue02-黑馬程序員學習筆記

一、今日學習目標 1.指令補充 指令修飾符v-bind對樣式增強的操作v-model應用于其他表單元素 2.computed計算屬性 基礎語法計算屬性vs方法計算屬性的完整寫法成績案例 3.watch偵聽器 基礎寫法完整寫法 4.綜合案例 &#xff08;演示&#xff09; 渲染 / 刪除 / 修改數量 …

一個簡約高級視差效果PR動態圖文開場視頻模板

這是一個高質量且易于定制的pr模板。具有模塊化結構&#xff0c;可以輕松更改內容。包括視頻教程&#xff0c;即使是新手小白也可以輕松套用模板制作視頻。 主要特點&#xff1a; 水平&#xff08;19201080&#xff09;和垂直&#xff08;10801920&#xff09;分辨率&#xff…

c語言:利用隨機函數產生20個[120, 834] 之間互不相等的隨機數, 并利用選擇排序法將其從小到大排序后輸出(每行輸出5個)

利用隨機函數產生20個[120, 834] 之間互不相等的隨機數&#xff0c; 并利用選擇排序法將其從小到大排序后輸出&#xff08;每行輸出5個&#xff09; 代碼如下&#xff1a; #include <stdio.h> #include <time.h> #include <stdlib.h> int shenchen(int a[…

三維模型相互轉換(obj文件轉inp文件)

三維模型文件根據其含義都是可以進行相互轉換的&#xff0c;這里主要介紹obj文件轉化為inp文件。 什么是inp文件&#xff1f; inp文件是以.inp為后綴的文本文件&#xff0c;它包括了模型的全部數據信息&#xff0c;ABAQUS求解器分析的對象是inp文件&#xff0c;軟件生成的.ca…

PHP身份證真偽驗證、身份證二、三要素核驗、身份證ocr接口

實名認證有利于網絡綠化&#xff0c;所以在互聯網發展迅速的今天&#xff0c;實名認證成了“剛需”。而OCR與實名認證兩種產品的結和更是擦出了美麗的火花。翔云人工智能開放平臺提供的實名認證OCR接口良好的展現出兩種功能結合的效果。以身份實名認證產品舉例來說&#xff0c;…