Package: heuristica 1.0.3.9000

heuristica: Heuristics Including Take the Best and Unit-Weight Linear

Implements various heuristics like Take The Best and unit-weight linear, which do two-alternative choice: which of two objects will have a higher criterion? Also offers functions to assess performance, e.g. percent correct across all row pairs in a data set and finding row pairs where models disagree. New models can be added by implementing a fit and predict function-- see vignette. Take The Best was first described in: Gigerenzer, G. & Goldstein, D. G. (1996) <doi:10.1037/0033-295X.103.4.650>. All of these heuristics were run on many data sets and analyzed in: Gigerenzer, G., Todd, P. M., & the ABC Group (1999). <ISBN:978-0195143812>.

Authors:Jean Whitmore [aut, cre], Daniel Barkoczi [aut]

heuristica_1.0.3.9000.tar.gz
heuristica_1.0.3.9000.zip(r-4.7-any)heuristica_1.0.3.9000.zip(r-4.6-any)heuristica_1.0.3.9000.zip(r-4.5-any)
heuristica_1.0.3.9000.tgz(r-4.6-any)heuristica_1.0.3.9000.tgz(r-4.5-any)
heuristica_1.0.3.9000.tar.gz(r-4.7-any)heuristica_1.0.3.9000.tar.gz(r-4.6-any)
heuristica_1.0.3.9000.tgz(r-4.6-emscripten)
manual.pdf |manual.html✨
DESCRIPTION |NEWS
card.svg |card.png
heuristica/json (API)

# Install 'heuristica' in R:
install.packages('heuristica', repos = c('https://jeanimal.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/jeanimal/heuristica/issues

Datasets:

On CRAN:

Conda:

5.69 score 4 stars 49 scripts 376 downloads 39 exports 55 dependencies

Last updated from:441d5b9e4e. Checks:7 NOTE, 2 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-develNOTE147
source / vignettesOK238
linux-releaseNOTE137
macos-releaseNOTE110
macos-oldrelNOTE145
windows-develNOTE86
windows-releaseNOTE82
windows-oldrelNOTE75
wasm-releaseOK133

Exports:accuracyFromConfusionMatrix3x3collapseConfusionMatrix3x3To2x2conditionalCueValidityCompleteconfusionMatrixFor_Neg1_0_1correctGreatercreateFunctioncueAccuracycueValiditycueValidityAppliedToColumnscueValidityCompletedistributeGuessAsExpectedValueheuristicsheuristicsListheuristicsProblogRegModelminModeloneRowpercentCorrectpercentCorrectListpercentCorrectListNonSymmetricpercentCorrectListReturnMatrixpredictPairpredictPairInternalpredictPairProbpredictPairSummarypredictProbInternalprobGreaterregInterceptModelregModelreverseRowsAndReverseColumnsrowIndexesrowPairApplyrowPairApplyListsingleCueModelstatsFromConfusionMatrixttbGreedyModelttbModelunitWeightModelvalidityWeightModel

Dependencies:backportsbase64encbslibcachemcheckmatecliclustercolorspacecpp11data.tabledigestevaluatefarverfastmapfontawesomeforeignFormulafsggplot2gluegridExtragtablehighrHmischtmlTablehtmltoolshtmlwidgetsisobandjquerylibjsonliteknitrlabelinglifecyclemagrittrmemoisemimennetR6rappdirsRColorBrewerrlangrmarkdownrpartrstudioapiS7sassscalesstringistringrtinytexvctrsviridisLitewithrxfunyaml

Confusion Matrix
Running reverse row pairs | Analyzing just "forward" row pairs | Generating "reverse" row pairs | Analyzing output of the three models | Distributing guesses and ties | Alternatives | Statistics | Heuristica's deterministic percent correct

Last update: 2021-08-23
Started: 2016-06-11

How to make your own heuristic
A toy model | Fitting function | Prediction functions | Writing PredictPairInternal | Using PredictPair | Performance | Wrapping lasso regression | Predicting function | Using the new model | Improving performance

Last update: 2021-08-23
Started: 2016-01-08

README
The Task | A Simple Example | Fitting | Predicting the fitted data | All rows | Assessing Overall Performance | Models | Data | Citations | Acknowledgements

Last update: 2021-08-23
Started: 2016-06-08

Reproducing Results
Prior results | Getting the same data and models | Data set | Models | Simulation | Prediction | Citations

Last update: 2021-08-23
Started: 2016-06-15

Comparing the performance of simple heuristics using the Heuristica R package

Last update: 2019-08-11
Started: 2015-08-25

Readme and manuals

Help Manual

Help pageTopics
Accuracy based on a predictPair confusion matrix.accuracyFromConfusionMatrix3x3
Population size of the 83 largest German cities.city_population
Original, uncorrected Population size of the 83 largest German cities.city_population_original
Collapses a 3x3 confusion matrix to a 2x2 confusion matrix.collapseConfusionMatrix3x3To2x2
Calculate conditional cue validity, which includes reversing and ranks.conditionalCueValidityComplete
Confusion matrix for categories -1, 0, 1 (the output of predictPair).confusionMatrixFor_Neg1_0_1
Creates function indicating whether row1[col] > row2[col].correctGreater
Calculate the accuracy of using a cue to predict a criterion.cueAccuracy
Calculate the cue validity.cueValidity
Calculate the cue validity for the cols_to_fit columns.cueValidityAppliedToColumns
Calculate cue validity with reverse, cue directions, and cue ranks.cueValidityComplete
Distributes guesses of 3x3 confusion matrix to expected value of 1 and -1.distributeGuessAsExpectedValue
Wrap fitted heuristics to pass to rowPairApply to call predictPair.heuristics
Wrapper for fitted heuristics to generate predictions with rowPairApply.heuristicsList
Wrap fitted heuristics to pass to rowPairApply to call predictProb.heuristicsProb
Chicago high school dropout rates.highschool_dropout
Logistic Regression model using cue differences as predictorslogRegModel
Minimalist ModelminModel
Convenience function to get one row from a matrix or data frame.oneRow
Apply a function to all unique pairs of row indices up to num_row.pairMatrix
Percent correct of heuristics' predictPair on test_data.percentCorrect
Percent correct of a list of heuristics' predictPair on test_data.percentCorrectList
percentCorrectList for non-symmetric heuristicspercentCorrectListNonSymmetric
Percent correct of heuristics' predictPair on test_data, returning a matrix.percentCorrectListReturnMatrix
Predict which of a pair of rows has a higher criterion.predictPair
Predict the probability that row1 has a higher criterion than row2.predictPairProb
Returns the row indices, correct answer, and predictions for all row pairs.predictPairSummary
Creates function for one column with correct probability row1 is greater.probGreater
Linear regression wrapper for hueristicaregInterceptModel
Linear regression (no intercept) wrapper for hueristicaregModel
Reverse rows and columns of datareverseRowsAndReverseColumns
Wrapper to output two columns, row 1 and row 2.rowIndexes
Apply functions to all row pairs.rowPairApply
Apply list of functions to all row pairs.rowPairApplyList
Single Cue ModelsingleCueModel
Accuracy, sensitivity, specificity, and precision of 2x2 confusion matrix.statsFromConfusionMatrix
Greedy Take The BestttbGreedyModel
Take The BestttbModel
Unit-weight linear modelunitWeightModel
Validity Weight Model, a linear model weighted by cue validitiesvalidityWeightModel