Package ML :: Module EnrichPlot
[hide private]
[frames] | no frames]

Module EnrichPlot

source code

Command line tool to construct an enrichment plot from saved composite models

Usage:  EnrichPlot [optional args] -d dbname -t tablename <models>

Required Arguments:
  -d "dbName": the name of the database for screening

  -t "tablename": provide the name of the table with the data to be screened

  <models>: file name(s) of pickled composite model(s).
     If the -p argument is also provided (see below), this argument is ignored.
     
Optional Arguments:
  - -a "list": the list of result codes to be considered active.  This will be
        eval'ed, so be sure that it evaluates as a list or sequence of
        integers. For example, -a "[1,2]" will consider activity values 1 and 2
        to be active

  - --enrich "list": identical to the -a argument above.      

  - --thresh: sets a threshold for the plot.  If the confidence falls below
          this value, picking will be terminated

  - -H: screen only the hold out set (works only if a version of 
        BuildComposite more recent than 1.2.2 was used).

  - -T: screen only the training set (works only if a version of 
        BuildComposite more recent than 1.2.2 was used).

  - -S: shuffle activity values before screening

  - -R: randomize activity values before screening

  - -F *filter frac*: filters the data before training to change the
     distribution of activity values in the training set.  *filter frac*
     is the fraction of the training set that should have the target value.
     **See note in BuildComposite help about data filtering**

  - -v *filter value*: filters the data before training to change the
     distribution of activity values in the training set. *filter value*
     is the target value to use in filtering.
     **See note in BuildComposite help about data filtering**

  - -p "tableName": provides the name of a db table containing the
      models to be screened.  If you use this argument, you should also
      use the -N argument (below) to specify a note value.
      
  - -N "note": provides a note to be used to pull models from a db table.

  - --plotFile "filename": writes the data to an output text file (filename.dat)
    and creates a gnuplot input file (filename.gnu) to plot it

  - --showPlot: causes the gnuplot plot constructed using --plotFile to be
    displayed in gnuplot.



Functions [hide private]
 
message(msg, noRet=0, dest=sys.stdout)
emits messages to _sys.stderr_...
source code
 
error(msg, dest=sys.stdout)
emits messages to _sys.stderr_...
source code
 
ScreenModel(mdl, descs, data, picking=[1], indices=[], errorEstimate=0)
collects the results of screening an individual composite model that match a particular value **Arguments** - mdl: the composite model - descs: a list of descriptor names corresponding to the data set - data: the data set, a list of points to be screened.
source code
 
AccumulateCounts(predictions, thresh=0, sortIt=1)
Accumulates the data for the enrichment plot for a single model **Arguments** - predictions: a list of 3-tuples (as returned by _ScreenModels_) - thresh: a threshold for the confidence level.
source code
 
MakePlot(details, final, counts, pickVects, nModels, nTrueActs=-1) source code
 
Usage()
displays a usage message and exits
source code
Variables [hide private]
  __VERSION_STRING = '2.3.3'
  Complex0 = 'F'
  Complex16 = 'F'
  Complex32 = 'F'
  Complex64 = 'D'
  Complex8 = 'F'
  Float0 = 'f'
  Float16 = 'f'
  Float32 = 'f'
  Float64 = 'd'
  Float8 = 'f'
  Int0 = '1'
  Int16 = 's'
  Int32 = 'i'
  Int8 = '1'
  absolute = <ufunc 'absolute'>
  add = <ufunc 'add'>
  arccos = <ufunc 'arccos'>
  arccosh = <ufunc 'arccosh'>
  arcsin = <ufunc 'arcsin'>
  arcsinh = <ufunc 'arcsinh'>
  arctan = <ufunc 'arctan'>
  arctan2 = <ufunc 'arctan2'>
  arctanh = <ufunc 'arctanh'>
  bitwise_and = <ufunc 'bitwise_and'>
  bitwise_or = <ufunc 'bitwise_or'>
  bitwise_xor = <ufunc 'bitwise_xor'>
  ceil = <ufunc 'ceil'>
  conjugate = <ufunc 'conjugate'>
  cos = <ufunc 'cos'>
  cosh = <ufunc 'cosh'>
  divide = <ufunc 'divide'>
  divide_safe = <ufunc 'divide_safe'>
  e = 2.71828182846
  equal = <ufunc 'equal'>
  exp = <ufunc 'exp'>
  fabs = <ufunc 'fabs'>
  floor = <ufunc 'floor'>
  floor_divide = <ufunc 'floor_divide'>
  fmod = <ufunc 'fmod'>
  greater = <ufunc 'greater'>
  greater_equal = <ufunc 'greater_equal'>
  hypot = <ufunc 'hypot'>
  invert = <ufunc 'invert'>
  left_shift = <ufunc 'left_shift'>
  less = <ufunc 'less'>
  less_equal = <ufunc 'less_equal'>
  log = <ufunc 'log'>
  log10 = <ufunc 'log10'>
  logical_and = <ufunc 'logical_and'>
  logical_not = <ufunc 'logical_not'>
  logical_or = <ufunc 'logical_or'>
  logical_xor = <ufunc 'logical_xor'>
  maximum = <ufunc 'maximum'>
  minimum = <ufunc 'minimum'>
  multiply = <ufunc 'multiply'>
  negative = <ufunc 'negative'>
  not_equal = <ufunc 'not_equal'>
  pi = 3.14159265359
  power = <ufunc 'power'>
  remainder = <ufunc 'remainder'>
  right_shift = <ufunc 'right_shift'>
  sin = <ufunc 'sin'>
  sinh = <ufunc 'sinh'>
  sqrt = <ufunc 'sqrt'>
  subtract = <ufunc 'subtract'>
  tan = <ufunc 'tan'>
  tanh = <ufunc 'tanh'>
  true_divide = <ufunc 'true_divide'>
Function Details [hide private]

message(msg, noRet=0, dest=sys.stdout)

source code 
emits messages to _sys.stderr_
override this in modules which import this one to redirect output

**Arguments**

  - msg: the string to be displayed

error(msg, dest=sys.stdout)

source code 
emits messages to _sys.stderr_
override this in modules which import this one to redirect output

**Arguments**

  - msg: the string to be displayed

ScreenModel(mdl, descs, data, picking=[1], indices=[], errorEstimate=0)

source code 
collects the results of screening an individual composite model that match
 a particular value

**Arguments**

  - mdl: the composite model

  - descs: a list of descriptor names corresponding to the data set

  - data: the data set, a list of points to be screened.

  - picking: (Optional) a list of values that are to be collected.
    For examples, if you want an enrichment plot for picking the values
    1 and 2, you'd having picking=[1,2].

 **Returns**

   a list of 4-tuples containing:

      - the id of the point 

      - the true result (from the data set)

      - the predicted result

      - the confidence value for the prediction
    

AccumulateCounts(predictions, thresh=0, sortIt=1)

source code 
Accumulates the data for the enrichment plot for a single model

**Arguments**

  - predictions: a list of 3-tuples (as returned by _ScreenModels_)

  - thresh: a threshold for the confidence level.  Anything below
    this threshold will not be considered

  - sortIt: toggles sorting on confidence levels


**Returns**

  - a list of 3-tuples:

    - the id of the active picked here
    
    - num actives found so far

    - number of picks made so far