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.5)heuristica_1.0.3.9000.zip(r-4.4)heuristica_1.0.3.9000.zip(r-4.3)
heuristica_1.0.3.9000.tgz(r-4.4-any)heuristica_1.0.3.9000.tgz(r-4.3-any)
heuristica_1.0.3.9000.tar.gz(r-4.5-noble)heuristica_1.0.3.9000.tar.gz(r-4.4-noble)
heuristica_1.0.3.9000.tgz(r-4.4-emscripten)heuristica_1.0.3.9000.tgz(r-4.3-emscripten)
heuristica.pdf |heuristica.html
heuristica/json (API)
NEWS

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

Peer review:

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

Datasets:

On CRAN:

39 exports 5 stars 1.26 score 65 dependencies 44 scripts 211 downloads

Last updated 8 months agofrom:441d5b9e4e. Checks:OK: 3 NOTE: 4. Indexed: yes.

TargetResultDate
Doc / VignettesOKSep 17 2024
R-4.5-winNOTESep 17 2024
R-4.5-linuxNOTESep 17 2024
R-4.4-winNOTESep 17 2024
R-4.4-macNOTESep 17 2024
R-4.3-winOKSep 17 2024
R-4.3-macOKSep 17 2024

Exports:accuracyFromConfusionMatrix3x3collapseConfusionMatrix3x3To2x2conditionalCueValidityCompleteconfusionMatrixFor_Neg1_0_1correctGreatercreateFunctioncueAccuracycueValiditycueValidityAppliedToColumnscueValidityCompletedistributeGuessAsExpectedValueheuristicsheuristicsListheuristicsProblogRegModelminModeloneRowpercentCorrectpercentCorrectListpercentCorrectListNonSymmetricpercentCorrectListReturnMatrixpredictPairpredictPairInternalpredictPairProbpredictPairSummarypredictProbInternalprobGreaterregInterceptModelregModelreverseRowsAndReverseColumnsrowIndexesrowPairApplyrowPairApplyListsingleCueModelstatsFromConfusionMatrixttbGreedyModelttbModelunitWeightModelvalidityWeightModel

Dependencies:backportsbase64encbslibcachemcheckmatecliclustercolorspacedata.tabledigestevaluatefansifarverfastmapfontawesomeforeignFormulafsggplot2gluegridExtragtablehighrHmischtmlTablehtmltoolshtmlwidgetsisobandjquerylibjsonliteknitrlabelinglatticelifecyclemagrittrMASSMatrixmemoisemgcvmimemunsellnlmennetpillarpkgconfigR6rappdirsRColorBrewerrlangrmarkdownrpartrstudioapisassscalesstringistringrtibbletinytexutf8vctrsviridisviridisLitewithrxfunyaml

Comparing the performance of simple heuristics using the Heuristica R package

Rendered fromcross-validation.Rmdusingknitr::rmarkdownon Sep 17 2024.

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

Confusion Matrix

Rendered fromconfusion-matrix.Rmdusingknitr::rmarkdownon Sep 17 2024.

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

How to make your own heuristic

Rendered fromhow-to-make-heuristic.Rmdusingknitr::rmarkdownon Sep 17 2024.

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

README

Rendered fromREADME.Rmdusingknitr::rmarkdownon Sep 17 2024.

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

Reproducing Results

Rendered fromreproducing-results.Rmdusingknitr::rmarkdownon Sep 17 2024.

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

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