Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
patipati
Frequent Visitor

Importación del modelo Rds R a Power BI - modelo de gam

Hola

Estoy tratando de pasar parámetros del modelo Gam usando este método.

https://towardsdatascience.com/how-to-predict-values-from-a-custom-r-model-in-power-bi-3364f83b0015

Desgraciadamente soy gettign error de lectura en la función de desserializar

from_byte_string de laFunción(x)
xcharvec á strsplit(x," ")[[1]]
xhex á as.hexmode(xcharvec)
xraw á as.raw(xhex)
unserialize(xraw)

}

#project_folder <- "Z:/Datasets/NSA/EBITDA_adimensional/"
#finalfit <- readRDS(paste0(project_folder, "mtcars-model.rds"))

finalfit.str <- como.Carácter( dataset[dataset$model_id ?1, "model_str"] )
finalfit <- from_byte_string(finalfit.str)

v <- c( wt-dataset$weight, qsec-dataset$qsec, am-as.Factor(dataset$am) )

pred <- round( predict(finalfit, newdata ? as.data.frame(t(v))), digits ?2 )

plot.new()
text(0.5, 0.5,
#labels as.character(dataset$weight)
etiquetas como.Carácter(Antes [[1]])
,cex ?3.5
)
En el script IDE se ejecuta correctamente.
¿Hay alguien que lo haya probado todavía? ¿Puede ser un problema con la biblioteca en Power BI?
3 REPLIES 3
v-chuncz-msft
Community Support
Community Support

@patipati

Eso funciona para mí. Pruebe la versión más reciente de Power BI Desktop y eche un vistazo a Crear objetos visuales de Power BI con R .

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Tengo la versión de marzo, y R 3.5.3 y todavía estoy recibiendo error con la función de deserializar:

unserialize(xraw): error de lectura

Anonymous
Not applicable

¿Dónde puede resolver este problema?

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.