Module Import alias identifier Import alias ClassDef bases body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad NameLoad body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Raise Call NameLoad decorator_list FunctionDef arguments args NameParam defaults body Raise Call NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body Expr Str If Call NameLoad NameLoad AttributeLoad NameLoad attr body Return Call AttributeLoad NameLoad attr Lambda arguments args NameParam defaults Call AttributeLoad NameLoad attr NameLoad NameLoad Num orelse Return Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body If CompareIs NameLoad NameLoad body Assign NameStore Num Assign NameStore Num Assign NameStore Num While NameLoad body Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index NameLoad If Call NameLoad NameLoad AttributeLoad NameLoad attr body If CompareEq NameLoad NameLoad body Return AttributeLoad NameLoad attr If Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Assign NameStore BinOpAdd NameLoad AttributeLoad NameLoad attr orelse Assign NameStore BinOpAdd NameLoad AttributeLoad NameLoad attr orelse Return AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore Call NameLoad NameLoad Assert CompareEq NameLoad Call NameLoad NameLoad If Call NameLoad NameLoad AttributeLoad NameLoad attr body Assign NameStore SubscriptLoad AttributeLoad NameLoad attr ExtSlice Slice Index Num Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call NameLoad GeneratorExp BinOpPow BinOpSub SubscriptLoad NameLoad Index NameLoad SubscriptLoad NameLoad Index NameLoad Num comprehension NameStore Call NameLoad NameLoad Assign NameStore BinOpDiv Call NameLoad NameLoad NameLoad Assign NameStore Call NameLoad GeneratorExp BinOpPow BinOpSub SubscriptLoad NameLoad Index NameLoad NameLoad Num comprehension NameStore Call NameLoad NameLoad Return BinOpSub Num BinOpDiv NameLoad NameLoad decorator_list decorator_list ClassDef bases body FunctionDef arguments args NameParam NameParam defaults body Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return BinOpAdd BinOpAdd Str Call NameLoad AttributeLoad NameLoad attr Str decorator_list FunctionDef arguments args NameParam NameParam defaults body Return AttributeLoad NameLoad attr decorator_list decorator_list ClassDef bases body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults Num Num Num body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return Call NameLoad GeneratorExp Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index NameLoad comprehension NameStore Call NameLoad Call NameLoad NameLoad Call AttributeLoad NameLoad attr decorator_list NameLoad FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults body Assign NameStore ListComp Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad NameLoad comprehension NameStore NameLoad Assign NameStore Call NameLoad ListComp AttributeLoad NameLoad attr comprehension NameStore NameLoad Return SubscriptLoad NameLoad Index NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return Call NameLoad GeneratorExp Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index NameLoad comprehension NameStore Call NameLoad Call NameLoad NameLoad Call AttributeLoad NameLoad attr decorator_list NameLoad FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults body Assign NameStore Call NameLoad SubscriptLoad AttributeLoad NameLoad attr ExtSlice Slice Index NameLoad NameLoad Assign NameStore Call NameLoad SubscriptLoad AttributeLoad NameLoad attr ExtSlice Slice Index NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad BinOpSub AttributeLoad NameLoad attr BinOpMult AttributeLoad NameLoad attr Num BinOpAdd AttributeLoad NameLoad attr BinOpMult AttributeLoad NameLoad attr Num AttributeLoad NameLoad attr Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr Return Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults Num NameLoad body If CompareIs NameLoad NameLoad body Assign NameStore Call NameLoad NameLoad If CompareLt BinOpSub NameLoad NameLoad AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad NameLoad For NameStore Call NameLoad NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index NameLoad Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index NameLoad Return Call AttributeLoad NameLoad attr Assign NameStore BinOpDiv BinOpAdd NameLoad NameLoad Num Return BinOpAdd Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str If Call NameLoad NameLoad AttributeLoad NameLoad attr body Assert CompareEq SubscriptLoad AttributeLoad NameLoad attr Index Num Num Assign NameStore SubscriptLoad AttributeLoad NameLoad attr ExtSlice Slice Index Num Return Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Num AttributeLoad NameLoad attr Call NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Num decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad NameLoad NameLoad body If CompareIs NameLoad NameLoad body Assign NameStore AttributeLoad NameLoad attr If CompareIs NameLoad NameLoad body Assign NameStore ListComp NameLoad comprehension NameStore Call NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Num CompareNotEq NameLoad NameLoad If CompareIs NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad If CompareIs NameLoad NameLoad body Assign NameStore Call NameLoad Call NameLoad NameLoad If BoolOpOr CompareLt Call NameLoad NameLoad AttributeLoad NameLoad attr CompareEq NameLoad Num body Assign NameStore Call NameLoad NameLoad NameLoad Return Call NameLoad ListLoad Call NameLoad NameLoad Call NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad NameLoad Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad If BoolOpOr CompareEq Call NameLoad NameLoad Num CompareEq Call NameLoad NameLoad Num body Return Call NameLoad ListLoad Call NameLoad Call NameLoad NameLoad NameLoad Call NameLoad NameLoad Assign NameStore BinOpSub NameLoad Num Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad Assign NameStore AttributeLoad NameLoad attr Assign NameStore AttributeLoad NameLoad attr Assign NameStore BinOpDiv BinOpAdd BinOpMult Call NameLoad NameLoad AttributeLoad SubscriptLoad NameLoad Index Num attr BinOpMult Call NameLoad NameLoad AttributeLoad SubscriptLoad NameLoad Index Num attr BinOpAdd Call NameLoad NameLoad Call NameLoad NameLoad Return Call NameLoad BinOpAdd BinOpAdd ListLoad Call AttributeLoad NameLoad attr NameLoad Num BinOpAdd Num Call NameLoad NameLoad NameLoad NameLoad NameLoad Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body FunctionDef arguments args NameParam NameParam defaults body Assign NameStore Call NameLoad SubscriptLoad AttributeLoad NameLoad attr ExtSlice Slice Index NameLoad NameLoad Assign NameStore Call NameLoad NameLoad If CompareEq NameLoad Num body Return Call NameLoad Str Return BinOpDiv Call NameLoad NameLoad Call NameLoad NameLoad decorator_list Return NameLoad decorator_list NameLoad FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Str Return Call AttributeLoad Call NameLoad NameLoad AttributeLoad NameLoad attr NameLoad attr NameLoad NameLoad decorator_list NameLoad decorator_list ClassDef bases body FunctionDef arguments args NameParam NameParam NameParam defaults body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Return SubscriptLoad AttributeLoad NameLoad attr Index SubscriptLoad AttributeLoad NameLoad attr Index NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return Call NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body For NameStore Call NameLoad Call NameLoad NameLoad body Expr Yield SubscriptLoad NameLoad Index NameLoad decorator_list decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore SubscriptLoad NameLoad Index Num Assign NameStore Num For NameStore Call NameLoad Call NameLoad NameLoad body Assign NameStore SubscriptLoad NameLoad Index NameLoad If CompareGt SubscriptLoad NameLoad Index NameLoad NameLoad body Assign NameStore NameLoad Assign NameStore NameLoad Return NameLoad decorator_list
N/A N/A pyfora.pure_modules.pure_pandas PurePandas N/A Base RegressionTree N/A N/A N/A A class representing a regression tree.

    A regression tree is represented, essentially, as a list of "rules",
    which are either :class:`~pyfora.algorithms.regressionTrees.Base.SplitRule`, giving
    "split" nodes, which divide the domain by a hyperplane, or
    :class:`~pyfora.algorithms.regressionTrees.RegressionTree.RegressionLeafRule`,
    which just hold a prediction value.

    Note:
        This class is not generally instantiated directly by users. Instead,
        they are normally returned by
        :class:`~pyfora.algorithms.regressionTrees.RegressionTree.RegressionTreeBuilder`.
     __init__ N/A N/A self rules numDimensions columnNames N/A None None N/A N/A N/A self rules rules N/A N/A self numDimensions numDimensions N/A N/A self columnNames columnNames N/A featureImportances N/A N/A self N/A N/A N/A N/A NotImplementedError N/A rawFeatureImportances N/A N/A self N/A N/A N/A N/A NotImplementedError N/A predict N/A N/A self x depth N/A None N/A N/A 
        Predicts the responses corresponding to :class:`pandas.DataFrame` ``x``.

        Returns:
            A :class:`pandas.Series` giving the predictions of the rows of ``x``.

        Examples::

            from pyfora.algorithms import RegressionTreeBuilder

            builder = RegressionTreeBuilder(2)
            x = pandas.DataFrame({'x0': [-1,0,1], 'x1': [0,1,1]})
            y = pandas.DataFrame({'y': [0,1,1]})
            regressionTree = builder.fit(x, y)

            # predict `regressionTree` on `x` itself
            regressionTree.predict(x)

         N/A N/A isinstance x N/A PurePandas PurePythonDataFrame N/A N/A N/A N/A x apply N/A N/A N/A row N/A N/A N/A self _predictionFunction row depth 1 N/A N/A N/A N/A self _predictionFunction x depth N/A _predictionFunction N/A N/A self row depth N/A None N/A N/A N/A depth None N/A N/A depth 1000000 N/A ix 0 N/A currentDepth 0 N/A True N/A N/A rule N/A N/A self rules N/A ix N/A N/A isinstance rule N/A Base SplitRule N/A N/A N/A currentDepth depth N/A N/A N/A rule leafValue N/A N/A N/A N/A rule rule isLess row N/A N/A ix N/A ix N/A rule jumpIfLess N/A N/A ix N/A ix N/A rule jumpIfHigher N/A N/A N/A rule leafValue N/A score N/A N/A self x yTrue N/A N/A N/A 
        Returns the coefficient of determination R\ :sup:`2` of the prediction.

        The coefficient R\ :sup:`2` is defined as ``(1 - u / v)``, where ``u`` is
        the regression sum of squares ``((yTrue - yPredicted) ** 2).sum()`` and ``v``
        is the residual sum of squares ``((yTrue - yTrue.mean()) ** 2).sum()``.
        Best possible score is ``1.0``, lower values are worse.

        Returns:
            (float) the R\ :sup:`2` value

        Examples::

            from pyfora.algorithms import RegressionTreeBuilder

            builder = RegressionTreeBuilder(2)
            x = pandas.DataFrame({'x0': [-1,0,1], 'x1': [0,1,1]})
            y = pandas.DataFrame({'y': [0,1,1]})
            regressionTree = builder.fit(x, y)

            # predict `regressionTree` on `x` itself
            regressionTree.score(x, y)

         N/A sz N/A len x N/A N/A sz N/A len yTrue N/A N/A isinstance yTrue N/A PurePandas PurePythonDataFrame N/A N/A yTrue N/A N/A yTrue iloc N/A N/A N/A 0 N/A yPredicted N/A N/A self predict x N/A u N/A sum N/A N/A N/A N/A yTrue N/A ix N/A yPredicted N/A ix 2.0 N/A ix N/A xrange sz N/A mean N/A N/A sum yTrue sz N/A v N/A sum N/A N/A N/A N/A yTrue N/A ix mean 2.0 N/A ix N/A xrange sz N/A N/A 1.0 N/A u v N/A N/A RegressionLeafRule N/A N/A __init__ N/A N/A self leafValue N/A N/A N/A N/A self leafValue leafValue N/A __str__ N/A N/A self N/A N/A N/A N/A N/A RegressionLeafRule(leafValue:  N/A str N/A self leafValue ) N/A predict N/A N/A self _ N/A N/A N/A N/A self leafValue N/A N/A RegressionTreeBuilder N/A N/A N/A Fits regression trees to data using specified tree parameters.

    Args:
        maxDepth (int): The maximum depth of a fit tree
        minSamplesSplit (int): The minimum number of samples required to split  a node
        numBuckets (int): The number of buckets used in the estimation of optimal
            column splits.
        minSplitThresh (int): an "internal" argument, not generally of interest to
            casual users, giving the splitting rule in ``computeBucketedSampleSummaries``.

    Returns:
        A :class:`~pyfora.algorithms.regressionTrees.RegressionTree.RegressionTree`
        instance.

    Examples::

        from pyfora.algorithms import RegressionTreeBuilder

        builder = RegressionTreeBuilder(2)
        x = pandas.DataFrame({'x0': [-1,0,1], 'x1': [0,1,1]})
        y = pandas.DataFrame({'y': [0,1,1]})
        regressionTree = builder.fit(x, y)

     __init__ N/A N/A self maxDepth minSamplesSplit numBuckets minSplitThresh N/A 2 10000 1000000 N/A N/A N/A self maxDepth maxDepth N/A N/A self impurityMeasure N/A Base SampleSummary N/A N/A self minSamplesSplit minSamplesSplit N/A N/A self minSplitThresh minSplitThresh N/A N/A self numBuckets numBuckets N/A samplesummary N/A N/A xVec N/A N/A N/A N/A sum N/A N/A N/A Base SampleSummary N/A xVec N/A ix N/A ix N/A xrange N/A len xVec N/A N/A Base SampleSummary N/A staticmethod bestRule N/A N/A self df yDim xDimensions activeIndices N/A N/A N/A bestRuleByDimension N/A N/A N/A self bestRuleForXDimension df yDim ix activeIndices N/A ix xDimensions N/A bestRuleIx N/A argmax N/A N/A rule impurityImprovement N/A rule bestRuleByDimension N/A N/A bestRuleByDimension N/A bestRuleIx N/A sampleSummary N/A N/A xVec N/A N/A N/A N/A sum N/A N/A N/A Base SampleSummary N/A xVec N/A ix N/A ix N/A xrange N/A len xVec N/A N/A Base SampleSummary N/A staticmethod bestRuleForXDimension N/A N/A self df yDim xDim activeIndices N/A N/A N/A xColumn N/A OnDemandSelectedVector N/A N/A df iloc N/A N/A N/A xDim activeIndices N/A yColumn N/A OnDemandSelectedVector N/A N/A df iloc N/A N/A N/A yDim activeIndices N/A xColumnSampleSummary N/A N/A RegressionTreeBuilder sampleSummary xColumn N/A bucketedSampleSummaries N/A N/A self computeBucketedSampleSummaries xColumn yColumn N/A N/A xColumnSampleSummary mean N/A N/A xColumnSampleSummary stdev 3.0 N/A N/A xColumnSampleSummary mean N/A N/A xColumnSampleSummary stdev 3.0 N/A self numBuckets N/A N/A splitPoint impurityImprovement N/A N/A bucketedSampleSummaries bestSplitPointAndImpurityImprovement N/A N/A N/A Base Rule xDim splitPoint impurityImprovement N/A len activeIndices N/A computeBucketedSampleSummaries N/A N/A self xCol yCol x0 x1 count low high N/A 0 None N/A N/A N/A high None N/A N/A high N/A len xCol N/A N/A N/A high low N/A self minSplitThresh N/A N/A hist N/A N/A Base SampleSummaryHistogram x0 x1 count False N/A ix N/A xrange low high N/A N/A N/A N/A hist observe N/A xCol N/A ix N/A N/A Base SampleSummary N/A yCol N/A ix N/A N/A N/A hist freeze N/A mid N/A N/A low high 2 N/A N/A N/A N/A self computeBucketedSampleSummaries xCol yCol x0 x1 count low mid N/A N/A self computeBucketedSampleSummaries xCol yCol x0 x1 count mid high N/A fit N/A N/A self x y N/A N/A N/A Using a :class:`~pyfora.algorithms.regressionTrees.RegressionTree.RegressionTreeBuilder`,
        fit a regression tree to predictors `x` and responses `y`.

        Args:
            x (:class:`pandas.DataFrame`): of the predictors.
            y (:class:`pandas.DataFrame`): giving the responses.

        Returns:
            a :class:`~pyfora.algorithms.regressionTrees.RegressionTree.RegressionTree`
            instance.

        Examples::

            builder = pyfora.algorithms.regressionTrees.RegressionTree.RegressionTreeBuilder(2)
            x = pandas.DataFrame({'x0': [-1,0,1], 'x1': [0,1,1]})
            y = pandas.DataFrame({'y': [0,1,1]})
            regressionTree = builder.fit(x, y)

         N/A N/A isinstance y N/A PurePandas PurePythonDataFrame N/A N/A N/A N/A N/A y shape N/A 1 1 N/A y N/A N/A y iloc N/A N/A N/A 0 N/A N/A N/A self fit_ N/A N/A x pyfora_addColumn __target y N/A N/A x shape N/A 1 N/A self maxDepth N/A range N/A N/A x shape N/A 1 N/A fit_ N/A N/A self df yDim maxDepth xDimensions leafValueFun activeIndices N/A None None None None N/A N/A N/A maxDepth None N/A N/A maxDepth N/A self maxDepth N/A N/A xDimensions None N/A N/A xDimensions N/A ix N/A ix N/A xrange N/A N/A df shape N/A 1 N/A ix yDim N/A N/A leafValueFun None N/A N/A leafValueFun N/A N/A RegressionTreeBuilder defaultLeafValueFun yDim N/A N/A activeIndices None N/A N/A activeIndices N/A range N/A len df N/A N/A N/A N/A len activeIndices N/A self minSamplesSplit N/A maxDepth 0 N/A N/A leafValue N/A leafValueFun df activeIndices N/A N/A RegressionTree N/A N/A RegressionLeafRule leafValue N/A len xDimensions N/A bestRule N/A N/A self bestRule df yDim xDimensions activeIndices N/A N/A leftIndices rightIndices N/A N/A bestRule splitDataframe df activeIndices N/A N/A N/A N/A len leftIndices 0 N/A N/A len rightIndices 0 N/A N/A N/A RegressionTree N/A N/A RegressionLeafRule N/A leafValueFun df activeIndices N/A len xDimensions N/A nextDepth N/A maxDepth 1 N/A treeLeft N/A N/A self fit_ df yDim nextDepth xDimensions leafValueFun leftIndices N/A treeRight N/A N/A self fit_ df yDim nextDepth xDimensions leafValueFun rightIndices N/A treeLeft N/A treeLeft rules N/A treeRight N/A treeRight rules N/A leafValue N/A N/A N/A N/A len leftIndices N/A N/A treeLeft N/A 0 leafValue N/A N/A len rightIndices N/A N/A treeRight N/A 0 leafValue N/A N/A len leftIndices N/A len rightIndices N/A N/A RegressionTree N/A N/A N/A N/A N/A Base SplitRule bestRule 1 N/A 1 N/A len treeLeft leafValue treeLeft treeRight N/A len xDimensions N/A defaultLeafValueFun N/A N/A yDim N/A N/A tr N/A N/A values activeIndices N/A N/A N/A selectedValues N/A OnDemandSelectedVector N/A N/A values iloc N/A N/A N/A yDim activeIndices N/A sz N/A len selectedValues N/A N/A sz 0 N/A N/A N/A float nan N/A N/A N/A sum selectedValues N/A float sz N/A N/A tr N/A staticmethod buildTree N/A N/A x y minSamplesSplit maxDepth N/A N/A N/A Fit a regression tree to predictors `x` and responses `y` using
        parameters `minSamplesSplit` and `maxDepth`.

        Args:
            x (:class:`pandas.DataFrame`): of the predictors.
            y (:class:`pandas.DataFrame`): giving the responses.
            maxDepth: The maximum depth of a fit tree
            minSamplesSplit: The minimum number of samples required to split  a node
         N/A N/A N/A N/A RegressionTreeBuilder maxDepth N/A Base SampleSummary minSamplesSplit fit x y N/A staticmethod N/A OnDemandSelectedVector N/A N/A __init__ N/A N/A self vectorToSelectFrom selectingIndices N/A N/A N/A N/A self vectorToSelectFrom vectorToSelectFrom N/A N/A self selectingIndices selectingIndices N/A __getitem__ N/A N/A self ix N/A N/A N/A N/A N/A self vectorToSelectFrom N/A N/A N/A self selectingIndices N/A ix N/A __len__ N/A N/A self N/A N/A N/A N/A len N/A self selectingIndices N/A __iter__ N/A N/A self N/A N/A N/A ix N/A xrange N/A len self N/A N/A N/A N/A self N/A ix N/A N/A argmax N/A N/A vec N/A N/A N/A curMax N/A vec N/A 0 N/A curMaxIx 0 N/A ix N/A xrange N/A len vec N/A N/A val N/A vec N/A ix N/A N/A N/A vec N/A ix curMax N/A N/A curMax val N/A curMaxIx ix N/A curMaxIx N/A