GMSB文章八:微生物中介分析

歡迎大家關注全網生信學習者系列:

  • WX公zhong號:生信學習者
  • Xiao hong書:生信學習者
  • 知hu:生信學習者
  • CDSN:生信學習者2

介紹

中介分析(Mediation Analysis)是一種統計方法,用于研究一個自變量(通常是獨立變量或預測變量)如何通過一個或多個中介變量(也稱為中介因素或中介機制)影響因變量(通常是響應變量或結果變量)。中介分析的目的是揭示變量之間的內在關系,特別是自變量對因變量的間接效應,以及這種效應是如何通過中介變量傳遞的。

評估識別出的與結局變量顯著相關的標記物如炎癥細胞因子cytokines腸道微生物gut microbiota短鏈脂肪酸SCFA是否能夠在伴侶數目number of partnersHIV-1血清轉化HIV-1 seroconversion之間起到中介作用。

自然效應模型(Natural Effect Model)是一種統計方法,用于估計在自然情況下(即在沒有干預或隨機分配的情況下)變量之間的因果關系。在流行病學和臨床研究中,這種模型特別有用,因為它可以幫助研究者了解不同因素對健康結果的自然影響。以下是中介分析的變量解析:

  • exposure variables (自變量X): consisting of sexual exposure groups

  • mediators (中介變量M): biomarkers (cytokines, gut microbiota, SCFA)

  • outcome variable (因變量Y): HIV-1 seroconversion status

加載R包

library(readr)
library(openxlsx)
library(tidyverse) 
library(microbiome)
library(mia)
library(compositions)
library(medflex)
library(ggsci)
library(ggpubr)

導入數據

大家通過以下鏈接下載數據:

  • 百度網盤鏈接:https://pan.baidu.com/s/1fz5tWy4mpJ7nd6C260abtg
  • 提取碼: 請關注WX公zhong號_生信學習者_后臺發送 復現gmsb 獲取提取碼
df_v1 <- read_csv("./data/GMSB-data/df_v1.csv", show_col_types = FALSE)bias_corr_species <- read_csv("./data/GMSB-data/results/outputs/bias_corr_species.csv")sig_species_raw1 <- read.xlsx("./data/GMSB-data/results/outputs/res_ancombc2.xlsx", sheet = 1) 
sig_species_raw2 <- read.xlsx("./data/GMSB-data/results/outputs/res_ancombc2.xlsx", sheet = 2) # 趨勢分析結果
ne_trend_test <- readRDS("./data/GMSB-data/rds/ne_trend_test.rds")

數據預處理

  • 提取差異物種豐度表

  • 合并分組變量和差異物種豐度表

df_v1 <- df_v1 %>%dplyr::filter(group1 != "missing",druguse != "missing")# Microbiome data
bias_corr_species <- bias_corr_species %>%dplyr::rowwise() %>%dplyr::filter(grepl("Species:", species)|grepl("Genus:", species)) %>%dplyr::mutate(species = ifelse(grepl("Genus:", species), paste(strsplit(species, ":")[[1]][2], "spp."),strsplit(species, ":")[[1]][2])) %>%dplyr::ungroup() # Significant taxa by group
sig_species1 <- sig_species_raw1 %>%dplyr::filter(p_val < 0.05) %>%.$taxon# Significant taxa by status
sig_species2 <- sig_species_raw2 %>%dplyr::filter(p_statussc < 0.05) %>%.$taxonsig_species <- sort(base::intersect(sig_species1, sig_species2))# Subset significant taxa
df_da_species <- bias_corr_species %>%dplyr::filter(species %in% sig_species)
df_da_species <- t(df_da_species)
colnames(df_da_species) <- df_da_species[1, ]
df_da_species <- data.frame(df_da_species[-1, , drop = FALSE], check.names = FALSE) %>%rownames_to_column("sampleid") %>%dplyr::mutate(across(-1, as.numeric))# Exposure, outcome, confounders, and potential mediators
# cytokines overlap: sCD14 and sCD163
# SCFA overlap: none
df_causal <- df_v1 %>%dplyr::select(sampleid, recept_anal, group1, status, druguse, cd14, cd163) %>%dplyr::left_join(df_da_species, by = "sampleid")
df_causal$status <- factor(df_causal$status)
df_causal$group1 <- factor(df_causal$group1)
df_causal$druguse <- factor(df_causal$druguse)
df_causal <- data.frame(df_causal)head(df_causal)
sampleidrecept_analgroup1statusdrugusecd14cd163Dehalobacterium.spp.Bacteroides.spp.
1F-15g3ncyes1681.160665.6528NA0.1151280
2F-26g4ncyes1178.440336.1164-0.1870557-1.0903494
3F-33g3ncyes1717.935495.9060NA-0.3093994
4F-47g4ncyes1271.675536.5375NA-3.3221487
5F-54g3ncyes929.645472.6636-1.1128170-1.2803083
6F-64g3ncno1103.670382.0072NA1.8015313

函數

  • constrain_est:提取約束線性模型的beta值

  • l_infty:計算l_infty norm值

  • trend_test:趨勢檢驗

# Estimate coefficients under constraints
constrain_est <- function(beta_hat, vcov_hat, contrast, solver = "ECOS") {beta_opt <- CVXR::Variable(rows = length(beta_hat), cols = 1, name = "beta")obj <- CVXR::Minimize(CVXR::matrix_frac(beta_opt - beta_hat, vcov_hat))cons <- suppressMessages(contrast %*% beta_opt >= 0)problem <- CVXR::Problem(objective = obj, constraints = list(cons))suppressMessages(result <- try(CVXR::solve(problem, solver = solver), silent = TRUE))if (inherits(result, "try-error")) {beta_opt <- rep(0, length(beta_hat))} else {beta_opt <- as.numeric(result$getValue(beta_opt))}return(beta_opt)
}# Compute the l_infty norm for a pattern
l_infty <- function(beta_opt, node) {l <- max(abs(beta_opt[node]),abs(beta_opt[node] - beta_opt[length(beta_opt)]),na.rm = TRUE)return(l)
}# Trend test
trend_test <- function(beta_hat, vcov_hat, contrast, solver = "ECOS",node, B = 1000) {beta_opt <- constrain_est(beta_hat = beta_hat,vcov_hat = vcov_hat,contrast = contrast,solver = solver)l_opt <- l_infty(beta = beta_opt, node = node)beta_null <- MASS::mvrnorm(n = B, mu = rep(0, length(beta_hat)), Sigma = vcov_hat)l_null <- apply(beta_null, 1, function(x) {beta_trend <- constrain_est(beta_hat = x, vcov_hat = vcov_hat, contrast = contrast,solver = solver)l_trend <- l_infty(beta = beta_trend, node = node)})p_trend <- 1/B * sum(l_null > l_opt)res <- list(estimate = beta_opt,test_statistic = l_opt,p_value = p_trend)return(res)
}contrast_mat <- matrix(c(1, 0, 0, -1, 1, 0,0, -1, 1),nrow = 3, byrow = TRUE)

Cytokine mediators

炎癥細胞因子作為中介變量

All cytokines

  • 多重插補medflex::neImpute()

    • 使用medflex::neImpute()函數進行多重插補。
    • status是響應變量,而group1, cd14, cd163, druguse是預測變量。
    • family = binomial(“logit”)指定了使用邏輯斯蒂回歸模型,適用于二分類結果的變量。
    • nMed = 2表示生成兩個不同的插補數據集。
    • group1生成了group10group11兩個插補數據集。
    • 這個步驟是為了處理數據中的缺失值,通過生成多個完整的數據集來模擬缺失數據的可能值。
  • 構建自然效應模型Natural effects model

    • 使用medflex::neModel()函數來擬合自然效應模型。
    • 公式status ~ group10 + group11 + druguse定義了模型,其中status是響應變量,group10, group11, druguse是預測變量。group10group11來自medflex::neImpute()函數的多重插補。
    • family = binomial(“logit”)再次指定了模型的分布族和鏈接函數。expData = df_exp指定了使用經過多重插補的數據集來進行模型擬合。
    • se = "robust"表示使用穩健的標準誤差估計,這有助于在模型估計中減少異方差性的影響。
  • 中介分析使用Natural effects model

    • exposure variables (自變量X): consisting of sexual exposure groups
    • mediators (中介變量M): cytokines
    • outcome variable (因變量Y): HIV-1 seroconversion status
    • adjusted variable (混淆變量): druguse
    • NDE: natural direct effect(自變量X不經過中介變量M直接對因變量Y的效應大小)
    • NIE: natural indirect effect(自變量X僅通過中介變量M間接對因變量Y的效應大小)
df <- df_causal %>%dplyr::select(status, group1, cd14, cd163, druguse) %>%drop_na()df_exp <- medflex::neImpute(status ~ group1 + cd14 + cd163 + druguse,family = binomial("logit"), nMed = 2, data = df)ne_mod <- medflex::neModel(status ~ group10 + group11 + druguse,family = binomial("logit"), expData = df_exp, se = "robust")summ <- summary(ne_mod)
df_summ <- data.frame(summ$coefficients)# Trend test
# set.seed(123)
# trend_nde <- trend_test(
#   beta_hat = summ$coefficients[2:4, "Estimate"],
#   vcov_hat = ne_mod$vcov[2:4, 2:4],
#   contrast = contrast_mat,
#   node = 3, B = 1000)
# 
# set.seed(123)
# trend_nie <- trend_test(
#   beta_hat = summ$coefficients[5:7, "Estimate"],
#   vcov_hat = ne_mod$vcov[5:7, 5:7],
#   contrast = contrast_mat,
#   node = 3, B = 1000)
# 
# ne_trend_test <- base::append(
#   ne_trend_test,
#   list(cyto_nde = trend_nde, cyto_nie = trend_nie))# Outputs
types <- c("nde", "nie")
groups <- c("g2", "g3", "g4")
res <- data.frame(type = rep(types, each = length(groups)),group = rep(groups, length(types)), estimate = NA, se = NA, p = NA,trend_p = NA)res$estimate <- round(df_summ$Estimate[2:7], 2)
res$se <- round(df_summ$Std..Error[2:7], 2)
res$p <- round(df_summ$Pr...z..[2:7], 3)
res$trend_p[3] <- round(ne_trend_test$cyto_nde$p_value, 3)
res$trend_p[6] <- round(ne_trend_test$cyto_nie$p_value, 3)head(res)
typegroupestimateseptrend_p
1ndeg21.920.640.003NA
2ndeg32.560.610.000NA
3ndeg43.550.700.0000.000
4nieg20.110.100.284NA
5nieg30.120.090.168NA
6nieg40.330.140.0230.007

結果炎癥細胞因子cytokines在不同分組的直接和間接效應的結果

  • nde直接效應:具體來說,對于沒有druguse的受試者,增加從第1組到另一組的暴露【同時保持sCD14和sCD163在同一水平】顯著增加了血清轉化的幾率。第2、3、4組的優勢比為exp(1.92) = 6.82; Exp (2.56) = 12.94, Exp (3.55) = 34.81;

  • nie間接效應,對于未druguse的受試者,將sCD14和sCD163的水平從第1組觀察到的水平轉移到第4組可能看到的水平,同時在任何給定組保持暴露不變,增加血清轉化的幾率,比值比為exp(0.33) = 1.39。炎癥因子水平從g1組水平轉變成g4組,則對應HIV-1血清風險增加。

Individual cytokines

單個細胞因子的中介分析

features <- c("cd14", "cd163")
groups <- c("g2", "g3", "g4")
res_nde <- data.frame(type = "nde",feature = rep(features, each = length(groups)), group = rep(groups, length(features)), estimate = NA, se = NA, p = NA)
res_nie <- data.frame(type = "nie",feature = rep(features, each = length(groups)), group = rep(groups, length(features)), estimate = NA, se = NA, p = NA)for (i in seq_along(features)) {df <- df_causal %>%dplyr::select(status, group1, druguse, all_of(features[i])) %>%drop_na()t_formula <- as.formula(paste0("status ~ group1 + ", features[i], " + druguse"))df_exp <- neImpute(t_formula, family = binomial("logit"), data = df)ne_mod <- neModel(status ~ group10 + group11 + druguse,family = binomial("logit"), expData = df_exp, se = "robust")summ <- summary(ne_mod)idx <- seq_along(groups) + (i - 1) * length(groups)res_nde[idx, "estimate"] <- round(summ$coefficients[2:4, "Estimate"], 2)res_nde[idx, "se"] <- round(summ$coefficients[2:4, "Std. Error"], 2)res_nde[idx, "p"] <- round(summ$coefficients[2:4, "Pr(>|z|)"], 3)res_nie[idx, "estimate"] <- round(summ$coefficients[5:7, "Estimate"], 2)res_nie[idx, "se"] <- round(summ$coefficients[5:7, "Std. Error"], 2)res_nie[idx, "p"] <- round(summ$coefficients[5:7, "Pr(>|z|)"], 3)
}res <- rbind(res_nde, res_nie)head(res)
typefeaturegroupestimatesep
1ndecd14g21.990.640.002
2ndecd14g32.590.610.000
3ndecd14g43.660.690.000
4ndecd163g22.010.650.002
5ndecd163g32.690.620.000
6ndecd163g43.760.710.000

Microbial species

炎癥細胞因子作為中介變量

All species

  • 中介分析使用Natural effects model

    • exposure variables (自變量X): consisting of sexual exposure groups
  • mediators (中介變量M): gut microbiota
    • outcome variable (因變量Y): HIV-1 seroconversion status
  • adjusted variable (混淆變量): druguse
# Natural effects model
all_species <- colnames(df_causal)[8:16]
df <- df_causal %>%dplyr::select(status, group1, druguse, all_of(all_species))
df[is.na(df)] <- 0t_formula <- as.formula(paste0("status ~ group1 + ", paste0(all_species, collapse = " + "), " + druguse"))
df_exp <- neImpute(t_formula,family = binomial("logit"), nMed = length(all_species), data = df)ne_mod <- neModel(status ~ group10 + group11 + druguse,family = binomial("logit"), expData = df_exp, se = "robust")summ <- summary(ne_mod)
df_summ <- data.frame(summ$coefficients)# Trend test
# set.seed(123)
# trend_nde <- trend_test(beta_hat = summ$coefficients[2:4, "Estimate"],
#                        vcov_hat = ne_mod$vcov[2:4, 2:4],
#                        contrast = contrast_mat,
#                        node = 3, B = 1000)
# set.seed(123)
# trend_nie <- trend_test(beta_hat = summ$coefficients[5:7, "Estimate"],
#                        vcov_hat = ne_mod$vcov[5:7, 5:7],
#                        contrast = contrast_mat,
#                        node = 3, B = 1000)
# 
# ne_trend_test <- base::append(ne_trend_test,
#                              list(species_nde = trend_nde, species_nie = trend_nie))# Outputs
type <- c("nde", "nie")
groups <- c("g2", "g3", "g4")
res <- data.frame(type = rep(types, each = length(groups)), group = rep(groups, length(type)), estimate = NA, se = NA, p = NA,trend_p = NA)
res$estimate <- round(df_summ$Estimate[2:7], 2)
res$se <- round(df_summ$Std..Error[2:7], 2)
res$p <- round(df_summ$Pr...z..[2:7], 3)
res$trend_p[3] <- round(ne_trend_test$species_nde$p_value, 3)
res$trend_p[6] <- round(ne_trend_test$species_nie$p_value, 3)head(res)
typegroupestimateseptrend_p
1ndeg22.080.680.002NA
2ndeg32.610.640.000NA
3ndeg43.580.710.0000.000
4nieg20.020.130.879NA
5nieg30.150.130.264NA
6nieg40.350.170.0450.033

Individual species

features <- sort(all_species)
groups <- c("g2", "g3", "g4")
res_nde <- data.frame(type = "nde",feature = rep(features, each = length(groups)), group = rep(groups, length(features)), estimate = NA, se = NA, p = NA)
res_nie <- data.frame(type = "nie",feature = rep(features, each = length(groups)), group = rep(groups, length(features)), estimate = NA, se = NA, p = NA)for (i in seq_along(features)) {df <- df_causal %>%dplyr::select(status, group1, druguse, all_of(features[i])) %>%drop_na()t_formula <- as.formula(paste0("status ~ group1 + ", features[i], " + druguse"))df_exp <- neImpute(t_formula, family = binomial("logit"), data = df)ne_mod <- neModel(status ~ group10 + group11 + druguse,family = binomial("logit"), expData = df_exp, se = "robust")summ <- summary(ne_mod)idx = seq_along(groups) + (i - 1) * length(groups)res_nde[idx, "estimate"] <- round(summ$coefficients[2:4, "Estimate"], 2)res_nde[idx, "se"] <- round(summ$coefficients[2:4, "Std. Error"], 2)res_nde[idx, "p"] <- round(summ$coefficients[2:4, "Pr(>|z|)"], 3)res_nie[idx, "estimate"] <- round(summ$coefficients[5:7, "Estimate"], 2)res_nie[idx, "se"] <- round(summ$coefficients[5:7, "Std. Error"], 2)res_nie[idx, "p"] <- round(summ$coefficients[5:7, "Pr(>|z|)"], 3)
}res <- rbind(res_nde, res_nie)head(res)
typefeaturegroupestimatesep
1ndeA.muciniphilag2-0.621.370.649
2ndeA.muciniphilag31.570.880.076
3ndeA.muciniphilag43.461.370.012
4ndeB.caccaeg20.901.030.382
5ndeB.caccaeg32.090.950.028
6ndeB.caccaeg43.281.200.006

Combine cytokines and DA species

  • 中介分析使用Natural effects model

    • exposure variables (自變量X): consisting of sexual exposure groups
  • mediators (中介變量M): cytokines & gut microbiota
    • outcome variable (因變量Y): HIV-1 seroconversion status
  • adjusted variable (混淆變量): druguse
# Natural effects model
all_mediators <- c(all_species, "cd14", "cd163")
df <- df_causal %>%dplyr::select(status, group1, druguse, all_of(all_mediators))
df[is.na(df)] <- 0t_formula <- as.formula(paste0("status ~ group1 + ", paste0(all_mediators, collapse = " + "), " + druguse"))
df_exp <- neImpute(t_formula,family = binomial("logit"), nMed = length(all_mediators), data = df)ne_mod <- neModel(status ~ group10 + group11 + druguse,family = binomial("logit"), expData = df_exp, se = "robust")summ <- summary(ne_mod)
df_summ <- data.frame(summ$coefficients)# Trend test
# set.seed(123)
# trend_nde <- trend_test(beta_hat = summ$coefficients[2:4, "Estimate"],
#                        vcov_hat = ne_mod$vcov[2:4, 2:4],
#                        contrast = contrast_mat,
#                        node = 3, B = 1000)
# set.seed(123)
# trend_nie <- trend_test(beta_hat = summ$coefficients[5:7, "Estimate"],
#                        vcov_hat = ne_mod$vcov[5:7, 5:7],
#                        contrast = contrast_mat,
#                        node = 3, B = 1000)
# 
# ne_trend_test <- base::append(ne_trend_test,
#                              list(all_nde = trend_nde, all_nie = trend_nie))# Outputs
types <- c("nde", "nie")
groups <- c("g2", "g3", "g4")
res <- data.frame(type = rep(types, each = length(groups)), group = rep(groups, length(types)), estimate = NA, se = NA, p = NA,trend_p = NA)
res$estimate <- round(df_summ$Estimate[2:7], 2)
res$se <- round(df_summ$Std..Error[2:7], 2)
res$p <- round(df_summ$Pr...z..[2:7], 3)
res$trend_p[3] <- round(ne_trend_test$all_nde$p_value, 3)
res$trend_p[6] <- round(ne_trend_test$all_nie$p_value, 3)head(res)
typegroupestimateseptrend_p
1ndeg21.810.640.005NA
2ndeg32.380.610.000NA
3ndeg43.160.680.0000.000
4nieg20.200.170.241NA
5nieg30.290.170.087NA
6nieg40.740.240.0020.001

Additional analysis: treating the exposure as continuous

  • 中介分析使用Natural effects model

    • exposure variables (自變量X): recept_anal
  • mediators (中介變量M): cytokines & gut microbiota
    • outcome variable (因變量Y): HIV-1 seroconversion status
  • adjusted variable (混淆變量): druguse
# Natural effects model
all_mediators <- c(all_species, "cd14", "cd163")
df <- df_causal %>%dplyr::select(status, recept_anal, druguse, all_of(all_mediators))
df[is.na(df)] <- 0t_formula <- as.formula(paste0("status ~ recept_anal + ", paste0(all_mediators, collapse = " + "), " + druguse"))
df_exp <- neImpute(t_formula,family = binomial("logit"), nMed = length(all_mediators), data = df)
ne_mod <- neModel(status ~ recept_anal0 + recept_anal1 + druguse,family = binomial("logit"), expData = df_exp, se = "robust")
summ <- summary(ne_mod)
df_summ <- data.frame(summ$coefficients)df_summ
EstimateStd…Errorz.valuePr…z…
(Intercept)-1.928928730.419607493-4.5969844.286515e-06
recept_anal00.080285330.0409295311.9615504.981487e-02
recept_anal10.008316930.0047855971.7379098.222692e-02
druguseyes1.178525960.4348636542.7101056.726201e-03

Additional analysis: substance usage as the mediator

  • 中介分析使用Natural effects model

    • exposure variables (自變量X): recept_anal

    • mediators (中介變量M): druguse

    • outcome variable (因變量Y): HIV-1 seroconversion status

# Natural effects model
df <- df_causal %>%dplyr::select(status, group1, druguse)
df[is.na(df)] <- 0t_formula <- as.formula(paste0("status ~ group1 + druguse"))
df_exp <- neImpute(t_formula,family = binomial("logit"), data = df)
ne_mod <- neModel(status ~ group10 + group11,family = binomial("logit"), expData = df_exp, se = "robust")
summ <- summary(ne_mod)
df_summ <- data.frame(summ$coefficients)df_summ
EstimateStd…Errorz.valuePr…z…
(Intercept)-3.013282640.59597082-5.0560914.279374e-07
group10g22.078383970.656684933.1649641.551023e-03
group10g32.715491020.625797994.3392451.429728e-05
group10g43.886784870.706008845.5052923.685567e-08
group11g20.076097050.071852711.0590702.895679e-01
group11g30.180576390.110168341.6390951.011934e-01
group11g40.178175570.124831091.4273331.534839e-01

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

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

相關文章

C# Benchmark

創建控制臺項目&#xff08;或修改現有項目的Main方法代碼&#xff09;&#xff0c;Nget導入Benchmark0.13.12&#xff0c;創建測試類&#xff1a; public class StringBenchMark{int[] numbers;public StringBenchMark() {numbers Enumerable.Range(1, 20000).ToArray();}[Be…

大語言模型(LLMs)全面學習指南,初學者入門,一看就懂!

大語言模型&#xff08;LLMs&#xff09;作為人工智能&#xff08;AI&#xff09;領域的一項突破性發展&#xff0c;已經改變了自然語言處理&#xff08;NLP&#xff09;和機器學習&#xff08;ML&#xff09;應用的面貌。這些模型&#xff0c;包括OpenAI的GPT-4o和Google的gem…

楊冪跨界學術圈:內容營銷專家劉鑫煒帶你了解核心期刊的學術奧秘

近日&#xff0c;知名藝人楊冪在權威期刊《中國廣播電視學刊》上發表了一篇名為《淺談影視劇中演員創作習慣——以電視劇<哈爾濱一九四四>為例》的學術論文&#xff0c;此舉在學術界和娛樂圈均引起了廣泛關注。該期刊不僅享有極高的聲譽&#xff0c;還同時被北大中文核心…

數據庫-數據完整性-用戶自定義完整性實驗

NULL/NOT NULL 約束&#xff1a; 在每個字段后面可以加上 NULL 修飾符來指定該字段是否可以為空&#xff1b;或者加上 NOT NULL 修飾符來指定該字段必須填上數據。 DEFAULT約束說明 DEFAULT 約束用于向列中插入默認值。如果列中沒有規定其他的值&#xff0c;那么會將默認值添加…

發;flask的基本使用2

上一篇我們介紹了基本使用方法 flask使用 【 1 】基本使用 from flask import Flask# 1 實例化得到對象 app Flask(__name__)# 2 注冊路由--》寫視圖函數 app.route(/) def index():# 3 返回給前端字符串return hello worldif __name__ __main__:# 運行app&#xff0c;默認…

Conformal Prediction

1 A Gentle Introduction to Conformal Prediction and Distribution-Free Uncertainty Quantification 2 Language Models with Conformal Factuality Guarantees

【啟明智顯分享】樂鑫ESP32-S3R8方案2.8寸串口屏:高性能低功耗,WIFI/藍牙無線通信

近年來HMI已經成為大量應用聚焦的主題&#xff0c;在消費類產品通過創新的HMI設計帶來增強的連接性和更加身臨其境的用戶體驗之際&#xff0c;工業產品卻仍舊在采用物理接口。這些物理接口通常依賴小型顯示器或是簡單的LED&#xff0c;通過簡單的機電開關或按鈕來實現HMI交互。…

【人工智能】—葡萄牙酒店預訂信息多維度分析|預測是否取消預定算法模型大亂斗

引言 在當今數字化時代&#xff0c;數據驅動的決策在各個行業中變得越來越重要。酒店業&#xff0c;作為旅游和休閑服務的核心部分&#xff0c;正面臨前所未有的機遇和挑戰。隨著在線預訂平臺的興起&#xff0c;客戶行為數據的積累為酒店提供了洞察消費者需求和優化運營策略的…

探索WebKit的插件帝國:深入插件系統的奧秘

&#x1f310; 探索WebKit的插件帝國&#xff1a;深入插件系統的奧秘 WebKit作為現代瀏覽器的核心&#xff0c;其插件系統是擴展瀏覽器功能、增強用戶體驗的關鍵機制。通過插件&#xff0c;開發者可以為瀏覽器添加各種新特性&#xff0c;從視頻播放到3D圖形&#xff0c;無所不…

有框架和沒框架的Command

這兩段代碼在功能上是等效的&#xff0c;但它們使用了不同的 RelayCommand 實現。第一段代碼中&#xff0c;RelayCommand 是自定義實現的&#xff0c;而第二段代碼中&#xff0c;RelayCommand 是使用 GalaSoft.MvvmLight.Command 庫中的實現。 以下是兩段代碼的完整版本&#…

C#/.NET量化開發實現財富自由【4】實現EMA、MACD技術指標的計算

聽說大A又回到了2950點以下&#xff0c;對于量化交易來說&#xff0c;可能這些都不是事兒。例如&#xff0c;你可以預判到大A到頂了&#xff0c;你可能早就跑路了。判斷逃頂還是抄底&#xff0c;最簡單的方式就是判斷是否頂背離還是底背離&#xff0c;例如通過MACD&#xff0c;…

入門PHP就來我這(純干貨)00

~~~~ 有膽量你就來跟著路老師卷起來&#xff01; -- 純干貨&#xff0c;技術知識分享 ~~~~ 老路給大家分享PHP語言的知識了&#xff0c;旨在想讓大家入門PHP&#xff0c;并深入了解PHP語言。一只用的java作為后端開發的程序員&#xff0c;最近想看下php怎么玩的&#xff0c;現…

【保姆級教程+配置源碼】在VScode配置C/C++環境

目錄 一、下載VScode 1. 在官網直接下載安裝即可 2. 安裝中文插件 二、下載C語言編譯器MinGW-W64 三、配置編譯器環境變量 1. 解壓下載的壓縮包&#xff0c;復制該文件夾下bin目錄所在地址 2. 在電腦搜索環境變量并打開 3. 點擊環境變量→選擇系統變量里的Path→點擊編…

深度學習筆記: 最詳盡解釋邏輯回歸 Logistic Regression

歡迎收藏Star我的Machine Learning Blog:https://github.com/purepisces/Wenqing-Machine_Learning_Blog。如果收藏star, 有問題可以隨時與我交流, 謝謝大家&#xff01; 邏輯回歸概述 邏輯回歸類似于線性回歸&#xff0c;但預測的是某事物是否為真&#xff0c;而不是像大小這…

K8S 集群節點縮容

環境說明&#xff1a; 主機名IP地址CPU/內存角色K8S版本Docker版本k8s231192.168.99.2312C4Gmaster1.23.1720.10.24k8s232192.168.99.2322C4Gwoker1.23.1720.10.24k8s233&#xff08;需下線&#xff09;192.168.99.2332C4Gwoker1.23.1720.10.24 1. K8S 集群節點縮容 當集群中有…

爬蟲中如何創建Beautiful Soup 類的對象

在使用 lxml 庫解析網頁數據時&#xff0c;每次都需要編寫和測試 XPath 的路徑表達式&#xff0c;顯得非常 煩瑣。為了解決這個問題&#xff0c; Python 還提供了 Beautiful Soup 庫提取 HTML 文檔或 XML 文檔的 節點。 Beautiful Soup 使用起來很便捷&#xff0c;…

計算機中的浮點數 - 為什么十進制的 0.1 在計算機中是一個無限循環小數

計算機中的浮點數 - 為什么十進制的 0.1 在計算機中是一個無限循環小數 flyfish 用 float 或 double 來存儲小數時不是精確值 浮點數在計算機中是以二進制形式存儲的&#xff0c;通常使用 IEEE 754 標準。浮點數由三個部分組成&#xff1a;符號位、指數位和尾數位。 先看一個…

【2024】LeetCode HOT 100——圖論

目錄 1. 島嶼數量1.1 C++實現1.2 Python實現1.3 時空分析2. 腐爛的橘子2.1 C++實現2.2 Python實現2.3 時空分析3. 課程表3.1 C++實現3.2 Python實現3.3 時空分析4. 實現 Trie (前綴樹)4.1 C++實現4.2 Python實現4.3 時空分析1. 島嶼數量 ?? 原題鏈接:200. 島嶼數量 經典的Fl…

鴻蒙應用開發之OpenGL的EGL

要開發OpenGL程序,那么這個程序就需要與操作系統進行交流,由于存在不同的操作系統,這樣就面臨著開發不同的程序的困難,為了解決這個問題,就引入了一個中間層的軟件庫,這個軟件庫叫做EGL。 眾所周知,Opengl是跨平臺的,那么面對各種平臺的差異性,Opengl是如何抹平而做到…

CleanMyMacX2024讓你的蘋果電腦重獲生機!

在電腦使用過程中&#xff0c;你是否遇到過這樣的問題&#xff1a;運行速度變慢、磁盤空間不足、系統出現故障……這些問題不僅影響你的工作效率&#xff0c;還會讓電腦的使用壽命大大縮短。那么&#xff0c;如何輕松解決這些問題呢&#xff1f;答案就是CleanMyMac X。 CleanM…