Gracias por su ayuda
El 2/3/22, Carlos Ortega <cof en qualityexcellence.es>
escribió:> Hola,
>
> Mira el ejemplo adaptado de la función "fuzzy_syxtem()".
>
> - Para el segundo plot (en rojo): los colores se pueden cambiar sin
> problemas, siguiendo el esquema de "plot()" del paquete base.
He
> modificado
> el color y el ancho de la línea.
> - En cambio para el caso en azul, no he encontrado la forma de cambiar
> los colores. En este caso, tienes que seguir mirando...
>
>
> #-----------------------
> library(sets)
>
> ## set universe
> sets_options("universe", seq(from = 0, to = 25, by = 0.1))
>
> ## set up fuzzy variables
> variables <-
> set(service > fuzzy_partition(varnames >
c(poor = 0, good = 5, excellent = 10),
> sd = 1.5),
> food > fuzzy_variable(rancid >
fuzzy_trapezoid(corners = c(-2, 0, 2, 4)),
> delicious >
fuzzy_trapezoid(corners = c(7, 9, 11, 13))),
> tip > fuzzy_partition(varnames >
c(cheap = 5, average = 12.5, generous = 20),
> FUN = fuzzy_cone, radius = 5)
> )
>
> ## set up rules
> rules <-
> set(
> fuzzy_rule(service %is% poor || food %is% rancid,
> tip %is% cheap),
> fuzzy_rule(service %is% good,
> tip %is% average),
> fuzzy_rule(service %is% excellent || food %is% delicious,
> tip %is% generous)
> )
>
> ## combine to a system
> system <- fuzzy_system(variables, rules)
> print(system)
> *# plot(system, col = gray.colors(10))*
> plot(system)
>
> ## do inference
> fi <- fuzzy_inference(system, list(service = 3, food = 8))
>
>
>
>
>
> *## plot resulting fuzzy setpar(mfrow = c(2,1))plot(fi)plot(fi, col >
"blue", lwd = 4)*
> ## defuzzify
> gset_defuzzify(fi, "centroid")
>
> ## reset universe
> sets_options("universe", NULL)
> #------------------------------------------------
>
> Gracias,
> Carlos Ortega
> www.qualityexcellence.es
>
>
> El mié, 2 mar 2022 a las 13:23, Jose Betancourt Bethencourt (<
> betanster en gmail.com>) escribió:
>
>> no funcionó
>>
>> es simple lo que quiero , es que las lineas de todos los plots tengan
>> un color que no sea el negro
>>
>> saludos
>>
>> José
>>
>>
>> El 2/3/22, Jose Betancourt Bethencourt <betanster en gmail.com>
escribió:
>> > Estimado
>> > no funcionó
>> >
>> > es simple lo que quiero , es que las lineas de todos los plots
tengan
>> > un color que no sea el negro
>> >
>> > saludos
>> >
>> > José
>> >>
>> >> El 1/3/22, Juan Abasolo <juan.abasolo en ehu.eus>
escribió:
>> >>> Hola, Jose;
>> >>> A mí no me da para entender lo que estás haciendo, o sea
que entender
>> lo
>> >>> que preguntás, muy probablemente no lo haga. Como
ejercicio de antes
>> >>> de
>> >>> irme a dormir agarré tu script, le sume tidiverse, de
haragán no más
>> >>> y
>> >>> probé de a poquito
>> >>>
>> >>> model$variables$severidad %>% plot(col = 1:3)
>> >>>
>> >>> Y sale el primero de los modelos con las rayas de tres
colores. o sea
>> >>> que
>> >>> si lo recreás y lo único que querés es cambiar algunos de
los
>> >>> colores,
>> >>> ese
>> >>> es el camino.
>> >>> Si es medio raro, porque si le pedís que haga lo mismo con
el tipo de
>> >>> linea, no lo hace, solamente toma el primer valor.
>> >>>
>> >>> Suerte
>> >>>
>> >>>
>> >>>
>> >>> Hau idatzi du Jose Betancourt Bethencourt (betanster en
gmail.com)
>> >>> erabiltzaileak (2022 mar. 1, ar. (12:53)):
>> >>>
>> >>>> ---------- Forwarded message ----------
>> >>>> From: Jose Betancourt Bethencourt <betanster en
gmail.com>
>> >>>> Date: Fri, 25 Feb 2022 13:38:44 -0500
>> >>>> Subject: colores de los plots
>> >>>> To: r-help-es <r-help-es en r-project.org>
>> >>>>
>> >>>> Estimados
>> >>>> En este script quisieramos poder manejar los colores
de los plots
>> >>>> plot(model) y plot(example1)
>> >>>>
>> >>>> y no
>> >>>> vemos como se puede hacer
>> >>>> Por lo que apreciariamos su ayuda
>> >>>> NO RECIBIMOS RESPUESTA
>> >>>> saludos cordiales.
>> >>>> José
>> >>>>
>> >>>>
>> >>>>
>> >>>>
>> >>>>
>> >>>> rm(list=ls(all=TRUE))
>> >>>>
>> >>>> library(sets)
>> >>>>
>> >>>> sets_options("universe", seq(1, 45, 1))
>> >>>>
>> >>>> #VARIABLES no cierra
>> >>>>
>> >>>>
>> >>>>
>> >>>> variables <- set(
>> >>>> temp= fuzzy_partition(varnames = c(normal= 36.5,
>> >>>> moderada= 37.5, alta= 38, muyalta=39), sd = 0.2),
>> >>>>
>> >>>> disnea = fuzzy_partition(varnames = c(no = 0, poca
>> >>>> 20,mucha=40),sd=2.5),
>> >>>>
>> >>>> gusto = fuzzy_partition(varnames = c(no = 0, poca
>> >>>> 30,mucha=40),sd=2.5),
>> >>>>
>> >>>> garganta = fuzzy_partition(varnames = c(no = 0, poca
>> >>>> 25,mucha=40),sd=2.5),
>> >>>>
>> >>>> severidad = fuzzy_partition(varnames = c(baja = 10,
media >> >>>> 20,alta=40),
>> >>>> FUN = fuzzy_cone, radius
= 10)
>> >>>> )
>> >>>>
>> >>>>
>> >>>>
>> >>>> #RULES
>> >>>>
>> >>>> rules <- set(
>> >>>>
>> >>>> fuzzy_rule(temp %is% muyalta && disnea%is%
mucha &&
>> >>>> gusto%is%mucha&&
>> >>>> garganta%is%mucha, severidad %is%
alta),
>> >>>> fuzzy_rule(temp %is% muyalta&& disnea%is%
mucha, severidad %is%
>> >>>> alta),
>> >>>> fuzzy_rule(temp %is% normal && disnea%is%
no && gusto%is%no&&
>> >>>> garganta%is%no, severidad %is% baja),
>> >>>> fuzzy_rule(temp %is% normal && disnea%is%
no, severidad %is%
>> baja),
>> >>>> fuzzy_rule(temp %is% moderada &&
disnea%is% poca &&
>> gusto%is%poca&&
>> >>>> garganta%is%poca, severidad %is%
media),
>> >>>> fuzzy_rule(temp %is% moderada &&
disnea%is% poca, severidad %is%
>> >>>> media)
>> >>>>
>> >>>> )
>> >>>>
>> >>>>
>> >>>>
>> >>>>
>> >>>> model <- fuzzy_system(variables, rules)
>> >>>> print(model)
>> >>>> plot(model)
>> >>>>
>> >>>>
>> >>>> hacer========================>> >>>>
>> >>>> example.1 <- fuzzy_inference(model, list(temp = 37,
>> >>>> disnea=40,garganta=40,gusto=40))
>> >>>>
>> >>>> gset_defuzzify(example.1, "centroid") # NaN
>> >>>>
>> >>>> plot(example.1)
>> >>>>
>> >>>>
>> >>>>
>> >>>> example.2 <- fuzzy_inference(model, list(Edad = 70,
IMC=30,Tas=140,
>> >>>> tabaquismo=
40,
>> glicemia=140))
>> >>>> gset_defuzzify(example.2, "centroid") # NaN
>> >>>>
>> >>>> plot(example.2)
>> >>>>
>> >>>>
>> >>>> example.3 <- fuzzy_inference(model, list(Edad = 75,
IMC=30,Tas=140,
>> >>>> tabaquismo=
40,
>> glicemia=150))
>> >>>> gset_defuzzify(example.3, "centroid") # NaN
>> >>>>
>> >>>> plot(example.3)
>> >>>> sets_options("universe", NULL)
>> >>>> --
>> >>>> Dr. Jose A. Betancourt Bethencourt
>> >>>> Universidad de Ciencias Medicas Carlos j. Finlay
>> >>>>
>> >>>>
>> >>>>
>> >>>> --
>> >>>> Dr. Jose A. Betancourt Bethencourt
>> >>>> Universidad de Ciencias Medicas Carlos j. Finlay
>> >>>>
>> >>>> _______________________________________________
>> >>>> R-help-es mailing list
>> >>>> R-help-es en r-project.org
>> >>>> https://stat.ethz.ch/mailman/listinfo/r-help-es
>> >>>>
>> >>>
>> >>>
>> >>> --
>> >>> Juan Abasolo, PhD
>> >>>
>> >>> Hizkuntzaren eta Literaturaren Didaktika Saila | EUDIA
ikerketa
>> >>> taldea
>> >>> Bilboko Hezkuntza Fakultatea
>> >>> Euskal Herriko Unibertsitatea UPV/EHU
>> >>>
>> >>> Sarriena auzoa z/g 48940 - Leioa (Bizkaia)
>> >>>
>> >>> T : (+34) 94 601 7567
>> >>> Telegram: @JuanAbasolo
>> >>> Skype : abasolo72
>> >>>
>> >>
>> >>
>> >> --
>> >> Dr. Jose A. Betancourt Bethencourt
>> >> Universidad de Ciencias Medicas Carlos j. Finlay
>> >>
>> >
>> >
>> > --
>> > Dr. Jose A. Betancourt Bethencourt
>> > Universidad de Ciencias Medicas Carlos j. Finlay
>> >
>>
>>
>> --
>> Dr. Jose A. Betancourt Bethencourt
>> Universidad de Ciencias Medicas Carlos j. Finlay
>>
>> _______________________________________________
>> R-help-es mailing list
>> R-help-es en r-project.org
>> https://stat.ethz.ch/mailman/listinfo/r-help-es
>>
>
>
> --
> Saludos,
> Carlos Ortega
> www.qualityexcellence.es
>
--
Dr. Jose A. Betancourt Bethencourt
Universidad de Ciencias Medicas Carlos j. Finlay