Ticket #181 (closed task: fixed)

Opened 7 years ago

Last modified 6 years ago

ReliefFov nevarni cache

Reported by: janez Owned by: janez
Milestone: 1.0 Component: library
Severity: minor Keywords:
Cc: Blocking:
Blocked By:

Description

ReliefFu dodati CRC32 preden vraca cacheirane rezultate?

Change History

comment:1 Changed 7 years ago by janez

Testna koda:

import orange
import random

def shuffleclasses(data):
    x = [d.getclass() for d in data]
    random.shuffle(x)
    for i, d in enumerate(data):
        d.setclass(x[i])

data = orange.ExampleTable("brown-selected")
measure = orange.MeasureAttribute_relief(m=100, k=10)
scores = [(a, measure(a, data)) for a in data.domain.attributes]
print "Originalni:        ", scores[:2]
print [str(d.getclass()) for d in data[:5]], "\n"

shuffleclasses(data)
scores = [(a, measure(a, data)) for a in data.domain.attributes]
print "Shuffled classes:  ", scores[:2]
print [str(d.getclass()) for d in data[:5]], "\n"

data = orange.ExampleTable(data)
scores = [(a, measure(a, data)) for a in data.domain.attributes]
print "After ExampleTable ", scores[:2]
print [str(d.getclass()) for d in data[:5]]

comment:2 Changed 6 years ago by janez

  • Status changed from new to closed
  • Resolution set to fixed

Urejeno. Poleg tega ni pobrisal cachea, ce se je spremenil m ali k. Tudi urejeno. ;)

Note: See TracTickets for help on using tickets.