New answers tagged

2

A wonderfully over-engineered solution: l1 = {"qwe", "abc", "abb", "aba", "ddd"}; l2 = {"abc", "abd", "aba", "qwe"}; PositionIndex[Join[l1, l2]] // Select[Length[#] > 1 &] // Values[#, First] & // Part[Join[l1, l2], #] &


0

Here we provided an example which indicate that we can not use BezierFunction or BSplineFunction since it is different from BezierCurve.( Although for a single Bezier curve which only contain two control points that they are the same.) pts = {{0, 0}, {1, -1}, {3, -1}, {3, 3}, {4, 1}, {5, 1}, {6, 0}}; a = Graphics[{BezierCurve[pts], Dotted, Line[pts], Red, ...


6

One way to keep the order in l1 is this: l1 = {"qwe", "abc", "abb", "aba", "ddd"}; l2 = {"abc", "abd", "aba", "qwe"}; Select[l1, MemberQ[l2, #] &]//InputForm which evaluates to {"qwe", "abc", "aba"}. The Select function has been in ...


7

To keep the original order, use Cases[] with Alternatives: l1 = {"qwe", "abc", "abb", "aba", "ddd"}; l2 = {"abc", "abd", "aba", "qwe"}; Cases[l1, Apply[Alternatives, l2]] Output: {"qwe", "abc", "aba"} Use AbsoluteTiming to benchmark this ...


6

Update Add example of other ClassifierMeasurementsObject properties. The code will work for any property that is a Graphics e.g. for "ConfusionMatrixPlot" confusionMatrixPlots = #["ConfusionMatrixPlot"] & /@ classifierMeasurements; KeyValueMap[Show[#2, PlotLabel -> #1, ImageSize -> 300] &, confusionMatrixPlots] // ...


Top 50 recent answers are included