paramonte._AutoCorr
¶
Module Contents¶
Classes¶
|
This is the base class for generating object of type |
-
paramonte._AutoCorr.
newline
¶
-
class
paramonte._AutoCorr.
AutoCorr
(dataFrame, columns=None, methodName='ParaMonte', reportEnabled=True)[source]¶ This is the base class for generating object of type
AutoCorr
. Upon construction, it will provide methods to compute and plot the autocorrelations of the selected columns of the input dataFrame.Parameters
dataFrame
A Pandas dataframe based upon the selected columns of which the autocorrelations will be computed.
columns (optional)
A list that determines the columns of the input dataFrame to be used in the computation of the autocorrelations. It can have three forms:
A list of column indices from the input dataFrame.
A list of column names from dataFrame.columns.
A
range(start,stop,step)
of column indices.
Examples:
columns = [0,1,4,3]
columns = ["SampleLogFunc","SampleVariable1"]
columns = range(17,7,-2)
The default behavior includes all columns of the dataFrame.
Attributes
All of the parameters described above, except dataFrame.
A weak reference to the dataFrame will be implicitly stored in the object.
df
A pandas dataframe containing the computed autocorrelations.
rows
A list of the dataFrame indices that determines the rows of the input dataFrame to be used in the computation of the autocorrelations. It can be either:
A
range(start,stop,step)
, or,A list of row indices from
dataFrame.index
.
Examples:
rows = range(17,7,-2)
rows = [i for i in range(7,17)]
The default behavior includes all rows of the dataFrame.
plot
A structure containing the following plotting tools:
heatmap
A callable object of class HeatMap which will enable plotting of the correlation matrix.
Returns
self
an object of type class CorMat.
-
__call__
(self, reself: tp.Optional[bool] = False, **kwargs)[source]¶ Call the
get()
method of the current instance of the class.Parameters
Any arguments that can be passed to the
get()
method of the object.Returns
Any return value from the
get()
method of the object.
-
get
(self, reself: tp.Optional[bool] = False, **kwargs)[source]¶ Compute the autocorrelations of the selected columns of the input dataframe to the object’s constructor.
Parameters
reself
A logical variable. When
True
, an instance of the object will be returned to the calling routine upon exit. The default value isFalse
.Returns
The object if
reself = True
otherwise,None
.NOTE
This method causes side-effects by manipulating the existing attributes of the object.
-
_resetPlot
(self, resetType='soft', plotNames='all')[source]¶ Reset the properties of the plot to the original default settings. Use this method when you change many attributes of the plot and you want to clean up and go back to the default settings.
Parameters
resetType (optional)
An optional string with possible value of
"hard"
. If provided, the plot object will be regenerated from scratch. This includes reading the original data frame again and resetting everything. If not provided, then only the plot settings will be reset without reseting the dataFrame.plotNames (optional)
An optional string value or list of string values representing the names of plots to reset. If no value is provided, then all plots will be reset.
Returns
None
Example
reset("hard") # regenerate all plots from scratch reset("hard","line") # regenerate line plot from scratch reset("hard",["line","scatter"]) # regenerate line and scatter plots