<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;">Pues depende del modelo, y de los datos. Por ejemplo, si se ajusta con el kernel sigmoidal, sí que se visualiza la separación con los vectores:<div><br></div><div>modelo <- svm(fallecido~., data=datos.entreno, kernel = "sigmoid”)</div><div>plot(modelo,df11, LDH ~ INL ) </div><div><br></div><div><img alt="Gráfico_pegado-1.tiff" src="cid:5BECB1F0-F012-41ED-B6FB-0165FE30C850"></div><div><br><div>
<div>Emilio L. Cano<br>Tel: 665 676 225<br>http://emilio.lcano.com </div><div><br></div><div><br></div><br class="Apple-interchange-newline">
</div>
<div><br><blockquote type="cite"><div>El 17 feb 2023, a las 13:36, Jose Betancourt Bethencourt <betanster@gmail.com> escribió:</div><br class="Apple-interchange-newline"><div><meta charset="UTF-8"><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;">Perdon, si sale el grafico, pero no le veo sentido como en el caso de iris</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;">jose</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;">El 17/2/23, Jose Betancourt Bethencourt <</span><a href="mailto:betanster@gmail.com" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;">betanster@gmail.com</a><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;">> escribió:</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; text-decoration: none;">EStimado Emilio<br>plot(modelo,df11, LDH ~ INL )<br>no funcionó, pienso que a la formula hay que agregarle algo<br><br>como en esta<br>data(iris)<br>m2 <- svm(Species~., data = iris)<br>plot(m2, iris, Petal.Width ~ Petal.Length,<br> slice = list(Sepal.Width = 3, Sepal.Length = 4))<br><br>Apreciaria su ayuda<br><br><br>Adjunto base de datos y codigos<br><br>saludos<br>José<br><br><br><br><br>El 16/2/23, Emilio L. Cano <emilopezcano@gmail.com> escribió:<br><blockquote type="cite">Hola,<br><br>El mensaje es claro: el modelo svmfit no existe, tú has llamado al ajuste<br>“modelo”. De todas formas, aparte de eso tendrías que especificar qué<br>dimensiones (variables predictivas) quieres representar. Si miras en la<br>ayuda de ?plot.svm lo tienes explicado.<br><br>Esto sí funcionaría:<br><br>plot(modelo,df11, LDH ~ INL )<br><br>Gracias por proporcionar el código y los datos para poder reproducir el<br>error.<br><br>Un saludo,<br><br>Emilio L. Cano<br><br><br><br><blockquote type="cite">El 16 feb 2023, a las 12:44, Jose Betancourt Bethencourt<br><betanster@gmail.com> escribió:<br><br>Estimados<br>En este modelo no puedo hacer el plot(svmfit,df11 ) #AQUI NO TRABAJA<br>Le adjunto Excel<br><br><br>library(readxl)<br><br>df11<br>attach(df11)<br><br>df11$fallecido=factor(df11$fallecido)<br><br># Selección de una submuestra del 70% de los datos<br>set.seed(101)<br>tamano.total <- nrow(df11)<br>tamano.entreno <- round(tamano.total*0.7)<br>datos.indices <- sample(1:tamano.total , size=tamano.entreno)<br>datos.entreno <- df11[datos.indices,]<br>datos.test <- df11[-datos.indices,]<br><br># Ejecución del modelo SVM<br>modelo <- svm(fallecido~., data=datos.entreno)<br><br># Predicción de los restantes<br>prediccion <- predict(modelo,new=datos.test)<br><br># Tabla de confusión.<br><br>(mc <- with(datos.test,(table(prediccion,fallecido))))<br><br><br># % correctamente clasificados<br>(correctos <- sum(diag(mc)) / nrow(datos.test) *100)<br><br><br>plot(svmfit,df11 ) #AQUI NO TRABAJA<br><br>Saludos José<br><df11.xlsx>_______________________________________________<br>R-help-es mailing list<br>R-help-es@r-project.org<br>https://stat.ethz.ch/mailman/listinfo/r-help-es<br></blockquote><br><br></blockquote><br><br>--<br>Dr. Jose A. Betancourt Bethencourt<br>Universidad de Ciencias Medicas Carlos j. Finlay<br><br></blockquote><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;">--<span class="Apple-converted-space"> </span></span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;">Dr. Jose A. Betancourt Bethencourt</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;">Universidad de Ciencias Medicas Carlos j. Finlay</span></div></blockquote></div><br></div></body></html>