From 42fb06c03119c0109594bd96a9b8b1a943f50880 Mon Sep 17 00:00:00 2001 From: Drew Herren Date: Fri, 5 Jul 2024 02:34:38 -0300 Subject: [PATCH 1/4] Removed some duplicated source code and updated workflows / README / gitmodules --- .github/workflows/docs.yml | 1 + .gitmodules | 7 - CMakeLists.txt | 79 --- LICENSE | 2 +- README.md | 55 +- demo/data/python_r_debug_test.csv | 501 -------------- demo/data/python_r_debug_train.csv | 501 -------------- demo/debug/causal_inference.py | 105 --- demo/debug/supervised_learning.py | 118 ---- demo/notebooks/causal_inference.ipynb | 205 ------ demo/notebooks/prototype_interface.ipynb | 788 ----------------------- demo/notebooks/supervised_learning.ipynb | 341 ---------- docs/Makefile | 20 - docs/make.bat | 35 - docs/requirements.txt | 38 -- docs/source/api.rst | 14 - docs/source/causal.rst | 64 -- docs/source/conf.py | 35 - docs/source/index.rst | 19 - docs/source/install.rst | 52 -- docs/source/supervised.rst | 71 -- pyproject.toml | 12 - setup.py | 142 ---- stochtree/__init__.py | 11 - stochtree/bart.py | 316 --------- stochtree/bcf.py | 638 ------------------ stochtree/data.py | 50 -- stochtree/forest.py | 44 -- stochtree/sampler.py | 55 -- stochtree/serialization.py | 183 ------ stochtree/utils.py | 10 - test/test_json.py | 71 -- 32 files changed, 6 insertions(+), 4577 deletions(-) delete mode 100644 CMakeLists.txt delete mode 100644 demo/data/python_r_debug_test.csv delete mode 100644 demo/data/python_r_debug_train.csv delete mode 100644 demo/debug/causal_inference.py delete mode 100644 demo/debug/supervised_learning.py delete mode 100644 demo/notebooks/causal_inference.ipynb delete mode 100644 demo/notebooks/prototype_interface.ipynb delete mode 100644 demo/notebooks/supervised_learning.ipynb delete mode 100644 docs/Makefile delete mode 100644 docs/make.bat delete mode 100644 docs/requirements.txt delete mode 100644 docs/source/api.rst delete mode 100644 docs/source/causal.rst delete mode 100644 docs/source/conf.py delete mode 100644 docs/source/index.rst delete mode 100644 docs/source/install.rst delete mode 100644 docs/source/supervised.rst delete mode 100644 pyproject.toml delete mode 100644 setup.py delete mode 100644 stochtree/__init__.py delete mode 100644 stochtree/bart.py delete mode 100644 stochtree/bcf.py delete mode 100644 stochtree/data.py delete mode 100644 stochtree/forest.py delete mode 100644 stochtree/sampler.py delete mode 100644 stochtree/serialization.py delete mode 100644 stochtree/utils.py delete mode 100644 test/test_json.py diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index c759f1d..a8eb5a1 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -23,6 +23,7 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 with: + repository: 'StochasticTree/stochtree' submodules: 'recursive' - name: Setup Python 3.10 diff --git a/.gitmodules b/.gitmodules index f63642d..e69de29 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,7 +0,0 @@ -[submodule "pybind11"] - path = pybind11 - url = https://github.com/pybind/pybind11 - branch = stable -[submodule "src/stochtree-cpp"] - path = src/stochtree-cpp - url = https://github.com/StochasticTree/stochtree-cpp/ diff --git a/CMakeLists.txt b/CMakeLists.txt deleted file mode 100644 index 02f20a5..0000000 --- a/CMakeLists.txt +++ /dev/null @@ -1,79 +0,0 @@ -# Build options -option(USE_DEBUG "Set to ON for Debug mode" ON) -option(USE_SANITIZER "Use santizer flags" OFF) - -# Require at least C++17 -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_CXX_STANDARD_REQUIRED ON) - -# Default to CMake 3.20 -cmake_minimum_required(VERSION 3.20) - -# Define the project -project(pystochtree LANGUAGES C CXX) - -# Debug flags -if(USE_DEBUG) - add_definitions(-DDEBUG) -endif() -if(UNIX OR MINGW OR CYGWIN) - set( - CMAKE_CXX_FLAGS - "${CMAKE_CXX_FLAGS} -pthread -w -fPIC" - ) - if(USE_DEBUG) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0") - else() - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3") - endif() - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unknown-pragmas -Wno-unused-private-field") -endif() - -# stochtree-cpp submodule directory -set(STOCHTREECPP_DIR ${PROJECT_SOURCE_DIR}/src/stochtree-cpp) - -# stochtree-cpp header file directory -set(StochTreeCpp_HEADER_DIR ${STOCHTREECPP_DIR}/include) - -# boost.math header file directory -set(BOOSTMATH_HEADER_DIR ${STOCHTREECPP_DIR}/dependencies/boost_math/include) - -# Eigen header file directory -set(EIGEN_HEADER_DIR ${STOCHTREECPP_DIR}/dependencies/eigen) - -# Aggregate the source files underpinning the implementation in the C++ library -file( - GLOB - SOURCES - ${STOCHTREECPP_DIR}/src/container.cpp - ${STOCHTREECPP_DIR}/src/cutpoint_candidates.cpp - ${STOCHTREECPP_DIR}/src/data.cpp - ${STOCHTREECPP_DIR}/src/io.cpp - ${STOCHTREECPP_DIR}/src/json11.cpp - ${STOCHTREECPP_DIR}/src/leaf_model.cpp - ${STOCHTREECPP_DIR}/src/partition_tracker.cpp - ${STOCHTREECPP_DIR}/src/random_effects.cpp - ${STOCHTREECPP_DIR}/src/tree.cpp -) - -# Define the C++ source code as a target -add_library(stochtree_objs OBJECT ${SOURCES}) - -# Include the headers in the source library -target_include_directories(stochtree_objs PRIVATE ${StochTreeCpp_HEADER_DIR} ${BOOSTMATH_HEADER_DIR} ${EIGEN_HEADER_DIR}) - -if(APPLE) - set(CMAKE_SHARED_LIBRARY_SUFFIX ".so") -endif() - -# Add pybind11 module -add_subdirectory(pybind11) -pybind11_add_module(stochtree_cpp src/stochtree.cpp) - -# Link to C++ source and headers -target_include_directories(stochtree_cpp PRIVATE ${StochTreeCpp_HEADER_DIR} ${BOOSTMATH_HEADER_DIR} ${EIGEN_HEADER_DIR}) -target_link_libraries(stochtree_cpp PRIVATE stochtree_objs) - -# EXAMPLE_VERSION_INFO is defined by setup.py and passed into the C++ code as a -# define (VERSION_INFO) here. -target_compile_definitions(stochtree_cpp PRIVATE VERSION_INFO=${EXAMPLE_VERSION_INFO}) diff --git a/LICENSE b/LICENSE index 2d82bba..2f52bdd 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2024 StochasticTree +Copyright (c) 2024 stochtree authors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index e8c3303..332fe98 100644 --- a/README.md +++ b/README.md @@ -1,52 +1,5 @@ -# StochasticTree Python Package +# StochasticTree Python Package Documentation -## Getting started - -The python package can be installed from source. Before you begin, make sure you have [conda](https://www.anaconda.com/download) installed. -Clone the repo recursively (including git submodules) by running - -```{bash} -git clone --recursive https://github.com/StochasticTree/stochtree-python.git -``` - -### Conda-based installation - -Conda provides a straightforward experience in managing python dependencies, avoiding version conflicts / ABI issues / etc. - -To build stochtree using a `conda` based workflow, first create and activate a conda environment with the requisite dependencies - -```{bash} -conda create -n stochtree-dev -c conda-forge python=3.10 numpy scipy pytest pandas pybind11 scikit-learn matplotlib seaborn -conda activate stochtree-dev -pip install jupyterlab -``` - -Then, navigate to the main `stochtree-python` project folder (i.e. `cd /path/to/stochtree-python`) and install the package locally via pip - -```{bash} -pip install . -``` - -### Pip-based installation - -If you would rather avoid installing and setting up conda, you can alternatively setup the dependencies and install `stochtree` using only `pip` (caveat: this has not been extensively tested -across platforms and python versions). - -First, navigate to the main `stochtree-python` project folder (i.e. `cd /path/to/stochtree-python`) and create and activate a virtual environment as a subfolder of the repo - -```{bash} -python -m venv venv -source venv/bin/activate -``` - -Install all of the package (and demo notebook) dependencies - -```{bash} -pip install numpy scipy pytest pandas scikit-learn pybind11 matplotlib seaborn jupyterlab -``` - -Then install stochtree via - -```{bash} -pip install . -``` +This is documentation repository, which builds and publishes +docs for the [stochtree python package](https://stochastictree.github.io/stochtree-python/). +The source code for the python (and R and C++) is available at https://github.com/StochasticTree/stochtree diff --git a/demo/data/python_r_debug_test.csv b/demo/data/python_r_debug_test.csv deleted file mode 100644 index 0a9be94..0000000 --- a/demo/data/python_r_debug_test.csv +++ /dev/null @@ -1,501 +0,0 @@ -"","X1","X2","X3","X4","X5","Z","y","pi","mu","tau" -"1",0.197517396416515,0.117339436663315,0.0930100954137743,0.236398870591074,0.774611575063318,0,1.10001594923482,0.348758698208258,1.74379349104129,0.234678873326629 -"2",0.9561649907846,0.242776960600168,0.879552544094622,0.420042700134218,0.140965570462868,0,2.09772821791245,0.7280824953923,3.6404124769615,0.485553921200335 -"3",0.0142586089204997,0.290592583129182,0.785654939012602,0.455139809753746,0.149278258206323,0,-0.58538020642613,0.25712930446025,1.28564652230125,0.581185166258365 -"4",0.0232237682212144,0.364482447039336,0.777769633801654,0.116204376332462,0.0963578359223902,0,1.15243857099442,0.261611884110607,1.30805942055304,0.728964894078672 -"5",0.091446271399036,0.954578491393477,0.623011768097058,0.607441175496206,0.321704446570948,0,3.53871951896815,0.295723135699518,1.47861567849759,1.90915698278695 -"6",0.783815175294876,0.557832994498312,0.539253461873159,0.030115254689008,0.927631911356002,0,3.94290180943843,0.641907587647438,3.20953793823719,1.11566598899662 -"7",0.334717926802114,0.0270787819754332,0.0760608138516545,0.759214064106345,0.305233920225874,1,2.55099500048309,0.417358963401057,2.08679481700528,0.0541575639508665 -"8",0.154698197962716,0.0868284071329981,0.0369487120769918,0.490142017137259,0.572555423947051,0,2.25179765075888,0.327349098981358,1.63674549490679,0.173656814265996 -"9",0.034534576581791,0.647642838070169,0.884114194195718,0.350975442444906,0.461842194199562,0,2.06690129028071,0.267267288290896,1.33633644145448,1.29528567614034 -"10",0.256900626700372,0.794590398203582,0.73115194728598,0.839911272516474,0.556320106610656,1,2.52258017309762,0.378450313350186,1.89225156675093,1.58918079640716 -"11",0.330261774826795,0.258742067730054,0.111085725948215,0.107426304835826,0.0738664655946195,1,3.34424464387105,0.415130887413397,2.07565443706699,0.517484135460109 -"12",0.49397540721111,0.949796958826482,0.520227366825566,0.146292930934578,0.437487719580531,0,2.9741088849539,0.496987703605555,2.48493851802777,1.89959391765296 -"13",0.892264776397496,0.587715500034392,0.294616488972679,0.807425243780017,0.9933448494412,0,4.67093221580141,0.696132388198748,3.48066194099374,1.17543100006878 -"14",0.805720356060192,0.28904120856896,0.717814727686346,0.0460441540926695,0.16633836645633,1,4.22051071036659,0.652860178030096,3.26430089015048,0.578082417137921 -"15",0.591914961114526,0.890734088374302,0.19213048950769,0.414388614008203,0.276181097142398,0,2.86689858675429,0.545957480557263,2.72978740278631,1.7814681767486 -"16",0.32089075143449,0.939873021794483,0.285641099559143,0.848659314913675,0.445020871935412,0,3.32235690396668,0.410445375717245,2.05222687858623,1.87974604358897 -"17",0.391019239556044,0.32935430505313,0.492687454912812,0.697801429778337,0.461813111091033,1,2.72128999443363,0.445509619778022,2.22754809889011,0.65870861010626 -"18",0.0954442657530308,0.47906687669456,0.174557705409825,0.27997531555593,0.576403682352975,0,0.566208109710804,0.297722132876515,1.48861066438258,0.95813375338912 -"19",0.280669358093292,0.474580837413669,0.96643281285651,0.0136728975921869,0.867738731671125,1,2.98031369839879,0.390334679046646,1.95167339523323,0.949161674827337 -"20",0.616271518636495,0.881589086260647,0.479929571039975,0.151563906343654,0.351102629676461,1,3.94975620334506,0.558135759318247,2.79067879659124,1.76317817252129 -"21",0.76484706858173,0.117391550680622,0.275404492393136,0.0232986374758184,0.442427600268275,1,2.75765224788128,0.632423534290865,3.16211767145433,0.234783101361245 -"22",0.747321628732607,0.520179912215099,0.525138556258753,0.863874163478613,0.777417518896982,0,4.017057590983,0.623660814366303,3.11830407183152,1.0403598244302 -"23",0.00664129271171987,0.878448517527431,0.365855834679678,0.183825371786952,0.257310926681384,0,2.15365837167183,0.25332064635586,1.2666032317793,1.75689703505486 -"24",0.628509899135679,0.994009547866881,0.818444058764726,0.413251097779721,0.217852202476934,0,1.8518540702002,0.56425494956784,2.8212747478392,1.98801909573376 -"25",0.285418878542259,0.720634955912828,0.478208265965804,0.997712803771719,0.948558378499001,0,1.69794427897017,0.39270943927113,1.96354719635565,1.44126991182566 -"26",0.174714560387656,0.525234333239496,0.787838894641027,0.53644523024559,0.40489288023673,1,3.89188703816203,0.337357280193828,1.68678640096914,1.05046866647899 -"27",0.219363802112639,0.425493872491643,0.645894889719784,0.202098348876461,0.476035880856216,0,1.49605471312349,0.35968190105632,1.7984095052816,0.850987744983286 -"28",0.54408609867096,0.656023590127006,0.14229371631518,0.45802055997774,0.286313181277364,0,2.09799616150651,0.52204304933548,2.6102152466774,1.31204718025401 -"29",0.320789852645248,0.88194816163741,0.628925861790776,0.963593757944182,0.459059704327956,0,4.46068227115999,0.410394926322624,2.05197463161312,1.76389632327482 -"30",0.833661240525544,0.343847293872386,0.831450007855892,0.136427079793066,0.422466366551816,1,2.4277137511938,0.666830620262772,3.33415310131386,0.687694587744772 -"31",0.146316372556612,0.318532224511728,0.701707063475624,0.243435479700565,0.333033127011731,0,2.505030922217,0.323158186278306,1.61579093139153,0.637064449023455 -"32",0.0255189496092498,0.329213211778551,0.837793225888163,0.775685779284686,0.544494241010398,0,0.769615310239352,0.262759474804625,1.31379737402312,0.658426423557103 -"33",0.993690527044237,0.749732984229922,0.95298267621547,0.340682541718706,0.345184807898477,0,2.36361958097154,0.746845263522118,3.73422631761059,1.49946596845984 -"34",0.60410621878691,0.149578081211075,0.217846756568179,0.861408502329141,0.654160653939471,0,4.5707533449567,0.552053109393455,2.76026554696728,0.29915616242215 -"35",0.842162900371477,0.714898634701967,0.440506611717865,0.952673386316746,0.852786389179528,1,5.17335127861537,0.671081450185739,3.35540725092869,1.42979726940393 -"36",0.999924746807665,0.989419219549745,0.857513866852969,0.123453578911722,0.480318626388907,1,5.91091186276946,0.749962373403832,3.74981186701916,1.97883843909949 -"37",0.502718350151554,0.568586770445108,0.224750046851113,0.330574880354106,0.66170699079521,0,1.93160507531682,0.501359175075777,2.50679587537888,1.13717354089022 -"38",0.210022261133417,0.770579332718626,0.919302982045338,0.218786625191569,0.255305246915668,0,2.66329586313095,0.355011130566709,1.77505565283354,1.54115866543725 -"39",0.742465863935649,0.175157436635345,0.757003855658695,0.649634423432872,0.0951400296762586,1,3.59239880891973,0.621232931967825,3.10616465983912,0.35031487327069 -"40",0.676400287309662,0.497462300118059,0.218059848761186,0.680505918804556,0.773920155130327,1,3.93400824116181,0.588200143654831,2.94100071827415,0.994924600236118 -"41",0.800209173001349,0.304359928937629,0.498253246303648,0.54142054147087,0.966448077466339,1,4.98053109330724,0.650104586500674,3.25052293250337,0.608719857875258 -"42",0.237374935066327,0.00566949625499547,0.794091942254454,0.851480718003586,0.398418147815391,1,2.36047241676947,0.368687467533164,1.84343733766582,0.0113389925099909 -"43",0.352570676477626,0.604142935015261,0.349428734509274,0.83404015051201,0.372050034347922,0,2.39377283686592,0.426285338238813,2.13142669119406,1.20828587003052 -"44",0.00808307901024818,0.411069945199415,0.601044496521354,0.764503237092867,0.131094319978729,1,1.22268700213981,0.254041539505124,1.27020769752562,0.82213989039883 -"45",0.285934182349592,0.335055733798072,0.518242312129587,0.384791902033612,0.392723730998114,1,2.43452255664556,0.392967091174796,1.96483545587398,0.670111467596143 -"46",0.271867898991331,0.0935337545815855,0.402976046781987,0.857604162069038,0.749338582158089,1,2.47116230089969,0.385933949495666,1.92966974747833,0.187067509163171 -"47",0.579850622452796,0.272460908163339,0.445760910399258,0.704112784005702,0.909796829335392,1,2.74637414203314,0.539925311226398,2.69962655613199,0.544921816326678 -"48",0.130450568161905,0.612595695769414,0.958310462068766,0.358124091522768,0.539624479133636,0,2.7888642374856,0.315225284080952,1.57612642040476,1.22519139153883 -"49",0.808170417556539,0.621217236155644,0.900709897978231,0.15148733719252,0.35039927251637,0,4.39399713399442,0.65408520877827,3.27042604389135,1.24243447231129 -"50",0.186113995267078,0.914724591653794,0.301122421398759,0.0992747060954571,0.39060451160185,0,2.02250278224882,0.343056997633539,1.7152849881677,1.82944918330759 -"51",0.271697212476283,0.0307466443628073,0.050595483975485,0.347534031607211,0.927170698065311,0,3.33903673545695,0.385848606238142,1.92924303119071,0.0614932887256145 -"52",0.573498534271494,0.500110371503979,0.0177544448524714,0.879789256723598,0.101647594245151,1,2.93488643232343,0.536749267135747,2.68374633567873,1.00022074300796 -"53",0.590750335715711,0.763201971771196,0.805364269064739,0.735080415150151,0.325285320403054,1,4.04470836927551,0.545375167857856,2.72687583928928,1.52640394354239 -"54",0.865495237754658,0.358501542592421,0.0170852390583605,0.388316825265065,0.563450698973611,0,4.77157652450903,0.682747618877329,3.41373809438664,0.717003085184842 -"55",0.576256622560322,0.765439677983522,0.0204559296835214,0.422433181898668,0.272203334374353,0,2.13596699898171,0.538128311280161,2.69064155640081,1.53087935596704 -"56",0.971020794473588,0.220560332760215,0.0716502878349274,0.0655470411293209,0.309661811217666,1,5.32966174334506,0.735510397236794,3.67755198618397,0.44112066552043 -"57",0.922880550147966,0.412607608363032,0.44029696774669,0.459260861855,0.141176951350644,0,3.46064461974645,0.711440275073983,3.55720137536991,0.825215216726065 -"58",0.491027158917859,0.817200125195086,0.937331908615306,0.664017652859911,0.0452567622996867,1,3.86145631279896,0.49551357945893,2.47756789729465,1.63440025039017 -"59",0.910806262865663,0.0761134820058942,0.569208965171129,0.319621638860554,0.587668878724799,1,4.28041950806559,0.705403131432831,3.52701565716416,0.152226964011788 -"60",0.600545288063586,0.61215847893618,0.366312421858311,0.688584429211915,0.759400238515809,1,6.3551762132338,0.550272644031793,2.75136322015896,1.22431695787236 -"61",0.675324958749115,0.989869543584064,0.572834115708247,0.765015207463875,0.194699722807854,1,3.50292022872998,0.587662479374558,2.93831239687279,1.97973908716813 -"62",0.16022746427916,0.944553940091282,0.836173582123592,0.201826667180285,0.739047154085711,0,1.5758162952728,0.33011373213958,1.6505686606979,1.88910788018256 -"63",0.163270678604022,0.992469182005152,0.632578305434436,0.943704664940014,0.140569986775517,0,1.66605765089757,0.331635339302011,1.65817669651005,1.9849383640103 -"64",0.764223949518055,0.194127701921389,0.0562924672849476,0.901220615254715,0.623224427457899,0,2.15340481925376,0.632111974759027,3.16055987379514,0.388255403842777 -"65",0.453736513620242,0.606051916955039,0.458244322100654,0.804418032756075,0.784590260358527,1,3.89267773724428,0.476868256810121,2.38434128405061,1.21210383391008 -"66",0.679404404945672,0.980140886968002,0.500741733936593,0.325599918141961,0.568768826778978,1,5.43912944505707,0.589702202472836,2.94851101236418,1.960281773936 -"67",0.701212810585275,0.530354550573975,0.834900298621505,0.342402608133852,0.107044762000442,1,4.87728385569959,0.600606405292638,3.00303202646319,1.06070910114795 -"68",0.371923522558063,0.687728185672313,0.308143968461081,0.456378867151216,0.591113172937185,1,1.10186720944221,0.435961761279032,2.17980880639516,1.37545637134463 -"69",0.994014076888561,0.153836323413998,0.970038293395191,0.0323439876083285,0.534175944747403,0,5.82212264029704,0.747007038444281,3.7350351922214,0.307672646827996 -"70",0.320992473047227,0.120280493283644,0.178886930458248,0.436751269036904,0.896314804907888,0,1.12295086211483,0.410496236523613,2.05248118261807,0.240560986567289 -"71",0.577314193826169,0.675581728108227,0.401080869603902,0.275819190079346,0.995724802371114,0,1.80787847816631,0.538657096913084,2.69328548456542,1.35116345621645 -"72",0.51396539225243,0.18765724520199,0.32045204914175,0.757929569110274,0.19639479694888,1,1.6705319684575,0.506982696126215,2.53491348063108,0.37531449040398 -"73",0.905632726149634,0.563499934505671,0.391756123863161,0.288158355280757,0.429735420970246,1,3.77996531631241,0.702816363074817,3.51408181537408,1.12699986901134 -"74",0.230650877812877,0.866280745482072,0.746999359689653,0.0817181379534304,0.284859287552536,1,4.55284686122416,0.365325438906439,1.82662719453219,1.73256149096414 -"75",0.103302764939144,0.246421576011926,0.890253966907039,0.477701453492045,0.130213982192799,0,1.55439607318586,0.301651382469572,1.50825691234786,0.492843152023852 -"76",0.843321969499812,0.351921387948096,0.208685890305787,0.037999706575647,0.68439780571498,0,4.99143212849174,0.671660984749906,3.35830492374953,0.703842775896192 -"77",0.503697977168486,0.370013192063197,0.0960672514047474,0.812250652350485,0.321204179897904,0,2.17765064275921,0.501848988584243,2.50924494292121,0.740026384126395 -"78",0.126032412284985,0.921695334138349,0.613618080737069,0.432004140689969,0.424902356695384,0,1.06929168633818,0.313016206142493,1.56508103071246,1.8433906682767 -"79",0.86424918146804,0.588307529455051,0.637814634013921,0.748693593079224,0.873595660552382,0,2.47985423450211,0.68212459073402,3.4106229536701,1.1766150589101 -"80",0.586248396662995,0.917082593776286,0.138010484632105,0.0225542197003961,0.691050003981218,0,3.83274871108095,0.543124198331498,2.71562099165749,1.83416518755257 -"81",0.16802120488137,0.827350598294288,0.918263050727546,0.468135859584436,0.604291504481807,0,1.9951123453393,0.334010602440685,1.67005301220343,1.65470119658858 -"82",0.477286636363715,0.744740881957114,0.871976912021637,0.109641333110631,0.386096347589046,0,2.70868590449934,0.488643318181857,2.44321659090929,1.48948176391423 -"83",0.495083515532315,0.75018212897703,0.63229302293621,0.666567407082766,0.755153017351404,1,3.7814907699087,0.497541757766157,2.48770878883079,1.50036425795406 -"84",0.606815575622022,0.926295056473464,0.50062626064755,0.614131722366437,0.986417296575382,0,2.10055071978796,0.553407787811011,2.76703893905506,1.85259011294693 -"85",0.283017039299011,0.716227862983942,0.988517796155065,0.831587212858722,0.916664596647024,0,2.35938577321148,0.391508519649506,1.95754259824753,1.43245572596788 -"86",0.213879592716694,0.372340731322765,0.802027248311788,0.827932850457728,0.206658275565132,1,1.83585211623447,0.356939796358347,1.78469898179173,0.744681462645531 -"87",0.00432229461148381,0.689183544600382,0.518901214236394,0.4557535124477,0.0339706765953451,0,1.16376951507158,0.252161147305742,1.26080573652871,1.37836708920076 -"88",0.924222262343392,0.150410424219444,0.81758457957767,0.741457561729476,0.340127334930003,1,5.09179853422373,0.712111131171696,3.56055565585848,0.300820848438889 -"89",0.474546026205644,0.831703963223845,0.305132812354714,0.657902447273955,0.366440627723932,0,2.68205221117854,0.487273013102822,2.43636506551411,1.66340792644769 -"90",0.432147963438183,0.869952576002106,0.981175870168954,0.809286043280736,0.137477767886594,0,2.66502712512454,0.466073981719092,2.33036990859546,1.73990515200421 -"91",0.724459506804124,0.692439740756527,0.190087283030152,0.0971305242273957,0.457895498722792,1,5.84500750128406,0.612229753402062,3.06114876701031,1.38487948151305 -"92",0.772898077499121,0.76912956032902,0.17007769504562,0.706383451120928,0.24654020415619,1,2.98105110921461,0.636449038749561,3.1822451937478,1.53825912065804 -"93",0.562126172473654,0.152162028010935,0.161416996037588,0.674177657812834,0.416954542277381,1,2.49831703992242,0.531063086236827,2.65531543118414,0.304324056021869 -"94",0.164132035570219,0.930516294203699,0.702753626508638,0.609601313713938,0.812171954195946,0,1.48856164781294,0.33206601778511,1.66033008892555,1.8610325884074 -"95",0.183478637598455,0.641813141759485,0.100504850270227,0.826499711256474,0.859718274092302,1,2.83907597400119,0.341739318799227,1.70869659399614,1.28362628351897 -"96",0.081199524924159,0.62143090646714,0.557446798542514,0.622191465692595,0.439234944526106,0,0.268888373278455,0.29059976246208,1.4529988123104,1.24286181293428 -"97",0.32305986341089,0.203250005841255,0.239347626920789,0.0560686320532113,0.169897182378918,0,2.60205400004361,0.411529931705445,2.05764965852723,0.40650001168251 -"98",0.798853953834623,0.489931957563385,0.965644363779575,0.33640802744776,0.911895419936627,1,3.30864710937678,0.649426976917312,3.24713488458656,0.979863915126771 -"99",0.78539539151825,0.00896435417234898,0.230225023347884,0.853809036547318,0.0654530136380345,1,2.28120971111197,0.642697695759125,3.21348847879563,0.017928708344698 -"100",0.0326984238345176,0.240476835286245,0.681111531797796,0.718274844577536,0.319693029625341,0,0.502593505473699,0.266349211917259,1.33174605958629,0.48095367057249 -"101",0.43386053852737,0.867364229168743,0.732845429331064,0.22634964552708,0.774276686133817,0,3.30233615597996,0.466930269263685,2.33465134631842,1.73472845833749 -"102",0.37919854791835,0.73746418976225,0.638139456510544,0.271394054638222,0.679261847166345,0,4.01774259686211,0.439599273959175,2.19799636979587,1.4749283795245 -"103",0.367846393259242,0.469905594130978,0.397121821530163,0.110122226178646,0.88102463260293,0,1.37720306527021,0.433923196629621,2.16961598314811,0.939811188261956 -"104",0.0540117686614394,0.944239290198311,0.312969320453703,0.77954108454287,0.367033671122044,1,4.12093342552967,0.27700588433072,1.3850294216536,1.88847858039662 -"105",0.621562824351713,0.248562143184245,0.602146310731769,0.00611538346856833,0.709038148866966,1,2.77458619349945,0.560781412175857,2.80390706087928,0.497124286368489 -"106",0.389473052928224,0.0260818167589605,0.101483585778624,0.625591032439843,0.542536879889667,0,4.03048716272709,0.444736526464112,2.22368263232056,0.052163633517921 -"107",0.980199688347057,0.591709046857432,0.195942639838904,0.460429033497348,0.041647364385426,1,6.86637141796195,0.740099844173528,3.70049922086764,1.18341809371486 -"108",0.774614179739729,0.404183407546952,0.592375162988901,0.0900069747585803,0.466791994171217,1,5.14584401711403,0.637307089869864,3.18653544934932,0.808366815093905 -"109",0.350354525027797,0.233884196728468,0.595253333216533,0.340470778755844,0.364400528604165,0,2.98645042542217,0.425177262513898,2.12588631256949,0.467768393456936 -"110",0.679212898015976,0.196092567872256,0.0481539887841791,0.591728568309918,0.531742595834658,0,4.13585199363984,0.589606449007988,2.94803224503994,0.392185135744512 -"111",0.000287041300907731,0.977463165065274,0.81982618290931,0.439715630142018,0.513540793443099,0,1.98101216512298,0.250143520650454,1.25071760325227,1.95492633013055 -"112",0.660090010846034,0.376196508528665,0.717353326734155,0.57712714583613,0.967048607766628,0,1.12648885524014,0.580045005423017,2.90022502711508,0.752393017057329 -"113",0.499407769413665,0.740583724109456,0.837526254588738,0.293117036344483,0.791318937437609,1,6.08701699796356,0.499703884706832,2.49851942353416,1.48116744821891 -"114",0.292748093605042,0.121486308751628,0.37085715169087,0.430454755667597,0.0914752576500177,0,2.37896409795564,0.396374046802521,1.9818702340126,0.242972617503256 -"115",0.599738088669255,0.989884592592716,0.154844588367268,0.194250920088962,0.233947286149487,0,2.25282815509655,0.549869044334628,2.74934522167314,1.97976918518543 -"116",0.259267108049244,0.858305562054738,0.59959231223911,0.818538857856765,0.503036589128897,1,3.62295398440724,0.379633554024622,1.89816777012311,1.71661112410948 -"117",0.0815161829814315,0.970607986673713,0.839089491637424,0.30052688694559,0.141421836800873,1,1.6404081129633,0.290758091490716,1.45379045745358,1.94121597334743 -"118",0.763053095433861,0.765081587713212,0.377911953488365,0.959563582437113,0.500065278494731,1,3.47739394686959,0.63152654771693,3.15763273858465,1.53016317542642 -"119",0.312488900497556,0.821939100045711,0.203178155468777,0.382162156747654,0.238651669351384,0,2.51999775272172,0.406244450248778,2.03122225124389,1.64387820009142 -"120",0.361327451886609,0.371934411348775,0.441240528132766,0.598822512663901,0.327389606274664,0,3.89282641863477,0.430663725943305,2.15331862971652,0.74386882269755 -"121",0.69812290254049,0.311586457304657,0.565230196109042,0.765554579673335,0.367294338997453,1,3.30753007329683,0.599061451270245,2.99530725635123,0.623172914609313 -"122",0.0777847229037434,0.226439930964261,0.768644340336323,0.143667977070436,0.216114825103432,0,2.08033421994815,0.288892361451872,1.44446180725936,0.452879861928523 -"123",0.805821613408625,0.417511221254244,0.361556126736104,0.400923416251317,0.274289397057146,0,3.04128876696009,0.652910806704313,3.26455403352156,0.835022442508489 -"124",0.352448536315933,0.835294531891122,0.894537538522854,0.935243944404647,0.270918580703437,1,1.95402629318083,0.426224268157966,2.13112134078983,1.67058906378224 -"125",0.834900399670005,0.493675275938585,0.240800444502383,0.437794487457722,0.178626431385055,0,4.96380859576623,0.667450199835002,3.33725099917501,0.987350551877171 -"126",0.587190122110769,0.514881095150486,0.844049421139061,0.0652309660799801,0.160630925325677,1,3.43693899781507,0.543595061055385,2.71797530527692,1.02976219030097 -"127",0.545628603547812,0.17499239067547,0.749661406036466,0.270404418697581,0.980631425045431,0,4.51363228911531,0.522814301773906,2.61407150886953,0.34998478135094 -"128",0.940241730073467,0.328270154539496,0.0154977790080011,0.486604845151305,0.847804532852024,1,4.97521574666083,0.720120865036733,3.60060432518367,0.656540309078991 -"129",0.127957409247756,0.705708888126537,0.133227542042732,0.00347317080013454,0.957931797020137,0,1.69670792387861,0.313978704623878,1.56989352311939,1.41141777625307 -"130",0.816777639091015,0.271574305603281,0.511160044232383,0.860615334706381,0.906896792817861,1,4.56010015513762,0.658388819545507,3.29194409772754,0.543148611206561 -"131",0.52372342417948,0.759992777137086,0.0904776828829199,0.864072112366557,0.235997061943635,1,4.49384728212806,0.51186171208974,2.5593085604487,1.51998555427417 -"132",0.0691438105423003,0.802744204644114,0.828265819931403,0.312237533275038,0.0397917474620044,0,0.962173660419023,0.28457190527115,1.42285952635575,1.60548840928823 -"133",0.202213907148689,0.337563079549,0.7858357722871,0.588981561595574,0.208532622782513,0,3.12773114980348,0.351106953574345,1.75553476787172,0.675126159097999 -"134",0.687446446623653,0.939034771174192,0.381281681125984,0.194918664172292,0.783999105449766,1,6.88587769454019,0.593723223311827,2.96861611655913,1.87806954234838 -"135",0.504655708791688,0.1899147790391,0.427089955192059,0.591087153181434,0.837626147549599,0,2.86474201763653,0.502327854395844,2.51163927197922,0.3798295580782 -"136",0.710300786187872,0.884064323501661,0.410324482712895,0.325955372070894,0.984958349727094,1,6.87830728231562,0.605150393093936,3.02575196546968,1.76812864700332 -"137",0.719209377886727,0.317106319358572,0.11361853661947,0.491073633311316,0.983862965367734,0,3.70257787496231,0.609604688943364,3.04802344471682,0.634212638717145 -"138",0.250258263200521,0.33857374987565,0.0907916114665568,0.991587444674224,0.137984599685296,0,1.90762896997608,0.375129131600261,1.8756456580013,0.6771474997513 -"139",0.620085427770391,0.357436260208488,0.928859118605033,0.542045808862895,0.754176016896963,0,3.20022232765071,0.560042713885196,2.80021356942598,0.714872520416975 -"140",0.599590486148372,0.20229854923673,0.000778817338868976,0.876007308484986,0.922270003473386,0,2.02780485660422,0.549795243074186,2.74897621537093,0.40459709847346 -"141",0.138682013843209,0.14413950801827,0.666146710515022,0.901975010056049,0.635341671528295,0,1.21900605670609,0.319341006921604,1.59670503460802,0.28827901603654 -"142",0.0104104329366237,0.0968034486286342,0.0312389605678618,0.293076589470729,0.285574656212702,0,2.39024071143774,0.255205216468312,1.27602608234156,0.193606897257268 -"143",0.927565691294149,0.885507920756936,0.0621012279298156,0.631865384988487,0.187399943824857,1,5.47407130121248,0.713782845647074,3.56891422823537,1.77101584151387 -"144",0.722492886940017,0.905598746845499,0.0544060117099434,0.973597233649343,0.188474069815129,0,3.53512804148346,0.611246443470009,3.05623221735004,1.811197493691 -"145",0.986924051539972,0.807507897960022,0.132872945163399,0.0263649763073772,0.841279432643205,1,4.42411423545936,0.743462025769986,3.71731012884993,1.61501579592004 -"146",0.557463898789138,0.377752638887614,0.840045994147658,0.418690832098946,0.0699967234395444,0,3.19830003157412,0.528731949394569,2.64365974697284,0.755505277775228 -"147",0.712910550413653,0.43633241369389,0.657180160284042,0.516071731457487,0.500241569010541,1,3.7681707353369,0.606455275206827,3.03227637603413,0.87266482738778 -"148",0.907677237410098,0.315878806868568,0.869634147034958,0.288873515324667,0.471632139757276,1,5.89344819601565,0.703838618705049,3.51919309352525,0.631757613737136 -"149",0.329498199978843,0.47626884537749,0.6785422724206,0.0347544979304075,0.175580413313583,1,3.99367864893489,0.414749099989422,2.07374549994711,0.95253769075498 -"150",0.631355919409543,0.51198085793294,0.96987566165626,0.77546007419005,0.35453873174265,1,2.78539754633807,0.565677959704772,2.82838979852386,1.02396171586588 -"151",0.369188599754125,0.906913130311295,0.167842207010835,0.87861180328764,0.429859436582774,1,3.7248841455055,0.434594299877062,2.17297149938531,1.81382626062259 -"152",0.35176794254221,0.48225637874566,0.0972627310547978,0.0231956935022026,0.797187025193125,1,3.59864291613414,0.425883971271105,2.12941985635553,0.96451275749132 -"153",0.387776643270627,0.136886700987816,0.362913755932823,0.558102075941861,0.509215405443683,0,3.34829323610687,0.443888321635313,2.21944160817657,0.273773401975632 -"154",0.841917625395581,0.15677209245041,0.290909252827987,0.904738164274022,0.822442338336259,1,4.03506386790768,0.670958812697791,3.35479406348895,0.31354418490082 -"155",0.429098419379443,0.762864052783698,0.286993986228481,0.819374597864226,0.0538080374244601,1,3.49531343081926,0.464549209689721,2.32274604844861,1.5257281055674 -"156",0.0831162834074348,0.555264782859012,0.371397141367197,0.181522227823734,0.777633234392852,1,3.241159017497,0.291558141703717,1.45779070851859,1.11052956571802 -"157",0.668870695400983,0.202763373265043,0.610843708971515,0.865046609425917,0.431153663434088,0,3.5855510550746,0.584435347700492,2.92217673850246,0.405526746530086 -"158",0.125361853279173,0.927742922212929,0.531778970733285,0.634053291287273,0.268097423482686,1,2.0390807792281,0.312680926639587,1.56340463319793,1.85548584442586 -"159",0.864161408273503,0.0297223839443177,0.074350903974846,0.994326440151781,0.210545205045491,1,1.49748254789108,0.682080704136752,3.41040352068376,0.0594447678886354 -"160",0.976758569246158,0.64534820872359,0.0221891144756228,0.517424193676561,0.443999835290015,1,5.74230450148597,0.738379284623079,3.6918964231154,1.29069641744718 -"161",0.733952105278149,0.339772395789623,0.972988926572725,0.443705671001226,0.850783756002784,1,4.1093088233102,0.616976052639075,3.08488026319537,0.679544791579247 -"162",0.634870107052848,0.19380169827491,0.762093725148588,0.158281390788034,0.0476875123567879,1,2.5425784763673,0.567435053526424,2.83717526763212,0.387603396549821 -"163",0.010152846807614,0.745346993673593,0.115390528924763,0.990634283749387,0.565348469186574,0,1.32569894591303,0.255076423403807,1.27538211701903,1.49069398734719 -"164",0.909361133351922,0.443913590395823,0.654298085952178,0.424528688425198,0.494781790766865,0,1.42787361303904,0.704680566675961,3.5234028333798,0.887827180791646 -"165",0.762690868228674,0.0769740776158869,0.37222972791642,0.824416307499632,0.824652211507782,0,3.00374683172787,0.631345434114337,3.15672717057168,0.153948155231774 -"166",0.489276308799163,0.915775754023343,0.301074925810099,0.391846610000357,0.145286316052079,1,3.87813230883266,0.494638154399581,2.47319077199791,1.83155150804669 -"167",0.826302991947159,0.0728684556670487,0.311931487172842,0.426842359127477,0.36105436226353,1,2.48094742952596,0.66315149597358,3.3157574798679,0.145736911334097 -"168",0.0230326342862099,0.954011573223397,0.814486660761759,0.239771810127422,0.443636921001598,0,2.13142004027604,0.261516317143105,1.30758158571552,1.90802314644679 -"169",0.473487180424854,0.326557490509003,0.0364119545556605,0.294961006380618,0.450639253482223,0,2.78015097825352,0.486743590212427,2.43371795106214,0.653114981018007 -"170",0.570025556487963,0.0244738315232098,0.269812224898487,0.248559420462698,0.836114467820153,1,3.72108428911101,0.535012778243981,2.67506389121991,0.0489476630464196 -"171",0.859608900267631,0.2371676703915,0.998732656706125,0.663869212847203,0.215076571796089,0,2.70548085097002,0.679804450133815,3.39902225066908,0.474335340783 -"172",0.566587642999366,0.727347584208474,0.226211444241926,0.663163237273693,0.134388989768922,0,3.33092596191013,0.533293821499683,2.66646910749841,1.45469516841695 -"173",0.599051593337208,0.21575666568242,0.352125284494832,0.549487333744764,0.300449070055038,1,3.44308229719813,0.549525796668604,2.74762898334302,0.43151333136484 -"174",0.745775330811739,0.24390999157913,0.352204371010885,0.13678835099563,0.438435832737014,1,3.87176216117962,0.62288766540587,3.11443832702935,0.487819983158261 -"175",0.637861484428868,0.499512929469347,0.735798085806891,0.858093718299642,0.105786896310747,1,2.81133061744338,0.568930742214434,2.84465371107217,0.999025858938694 -"176",0.462972064968199,0.750378779135644,0.643876469228417,0.116015852196142,0.777423558058217,1,4.43767617695022,0.481486032484099,2.4074301624205,1.50075755827129 -"177",0.752087426371872,0.217527766944841,0.270941890310496,0.229106356855482,0.827905929414555,0,4.33956217047814,0.626043713185936,3.13021856592968,0.435055533889681 -"178",0.0133645525202155,0.74878926970996,0.431748734787107,0.590395431499928,0.620448558591306,0,1.075706724768,0.256682276260108,1.28341138130054,1.49757853941992 -"179",0.379887447925285,0.943037748569623,0.639006758108735,0.579230362782255,0.0374863299075514,1,4.28801526577318,0.439943723962642,2.19971861981321,1.88607549713925 -"180",0.973994431551546,0.651092295069247,0.895451586926356,0.588892153697088,0.936914961785078,1,5.48133802020687,0.736997215775773,3.68498607887886,1.3021845901385 -"181",0.0288294176571071,0.503663720330223,0.416931696236134,0.861696265870705,0.749914214015007,0,1.83084347080222,0.264414708828554,1.32207354414277,1.00732744066045 -"182",0.357981903012842,0.423456053249538,0.565699978498742,0.169473924906924,0.496490178164095,0,3.48410957634262,0.428990951506421,2.1449547575321,0.846912106499076 -"183",0.875765696400777,0.288708258420229,0.40760336490348,0.692719369661063,0.695450886385515,1,3.60821215736461,0.687882848200388,3.43941424100194,0.577416516840458 -"184",0.756391895469278,0.481846172362566,0.162667607655749,0.543256057193503,0.93648869683966,0,3.64937580323784,0.628195947734639,3.1409797386732,0.963692344725132 -"185",0.396199076203629,0.50799493608065,0.75997883733362,0.600100293755531,0.700476961443201,0,2.65496562320765,0.448099538101815,2.24049769050907,1.0159898721613 -"186",0.313259261427447,0.498615181073546,0.108493277803063,0.510750274173915,0.805544945178553,1,2.91590619817729,0.406629630713724,2.03314815356862,0.997230362147093 -"187",0.275051347445697,0.412335179047659,0.375296301441267,0.0349093107506633,0.671865833224729,0,1.3540468566699,0.387525673722848,1.93762836861424,0.824670358095318 -"188",0.783332296414301,0.374372609890997,0.173182245343924,0.722993397619575,0.298594095744193,0,1.68571182068484,0.64166614820715,3.20833074103575,0.748745219781995 -"189",0.696467015426606,0.270517216296867,0.0400936116930097,0.773101457161829,0.973950977670029,1,3.27002887278549,0.598233507713303,2.99116753856651,0.541034432593733 -"190",0.11635629972443,0.908575931098312,0.620251676766202,0.407088551437482,0.0482147212605923,0,0.84739648024432,0.308178149862215,1.54089074931107,1.81715186219662 -"191",0.12712233280763,0.477940519805998,0.475716062588617,0.562679633032531,0.207947284681723,0,0.165555016795935,0.313561166403815,1.56780583201908,0.955881039611995 -"192",0.520603071898222,0.56710712169297,0.789851411245763,0.13854729081504,0.743786092149094,1,2.97463880668494,0.510301535949111,2.55150767974555,1.13421424338594 -"193",0.494407585589215,0.440140454331413,0.770260142628103,0.572564767906442,0.338985146256164,1,3.57511589965482,0.497203792794608,2.48601896397304,0.880280908662826 -"194",0.919332563877106,0.496568067930639,0.292400085832924,0.440510472049937,0.623540234286338,0,3.85212112709795,0.709666281938553,3.54833140969276,0.993136135861278 -"195",0.935434657614678,0.908146523404866,0.249678066466004,0.157551022479311,0.265986736631021,1,5.8010210862155,0.717717328807339,3.5885866440367,1.81629304680973 -"196",0.0347549018915743,0.999941248213872,0.37097058002837,0.91743744071573,0.456068178405985,0,0.532721845362206,0.267377450945787,1.33688725472894,1.99988249642774 -"197",0.344793731113896,0.214133392553777,0.958520259708166,0.725671262713149,0.286897673271596,0,2.94282788244272,0.422396865556948,2.11198432778474,0.428266785107553 -"198",0.703347659669816,0.20225699362345,0.572287622839212,0.438299882691354,0.786964236525819,1,3.59456465800596,0.601673829834908,3.00836914917454,0.404513987246901 -"199",0.0336006870493293,0.23828318179585,0.16860378626734,0.0977477952837944,0.0985034790355712,0,0.976481930544606,0.266800343524665,1.33400171762332,0.476566363591701 -"200",0.0504746993537992,0.115794497542083,0.79041383578442,0.827350883511826,0.776543791405857,0,-0.0865411227107553,0.2752373496769,1.3761867483845,0.231588995084167 -"201",0.899821031140164,0.593883663183078,0.407874462194741,0.641856194706634,0.614943398395553,1,7.12364803906082,0.699910515570082,3.49955257785041,1.18776732636616 -"202",0.219324165722355,0.541056961053982,0.492462455760688,0.258284396026284,0.876492651179433,1,3.47353600693069,0.359662082861178,1.79831041430589,1.08211392210796 -"203",0.0703069006558508,0.219970216508955,0.734574220376089,0.282609457848594,0.1696284590289,0,0.0369506202169954,0.285153450327925,1.42576725163963,0.43994043301791 -"204",0.074232640909031,0.204511029180139,0.936787255574018,0.0225501134991646,0.0463054303545505,0,2.49300419886619,0.287116320454516,1.43558160227258,0.409022058360279 -"205",0.215670469217002,0.810989398742095,0.760488163912669,0.69846237427555,0.489720314508304,1,3.81792373796299,0.357835234608501,1.78917617304251,1.62197879748419 -"206",0.263050560140982,0.166733108460903,0.413890307769179,0.992663032608107,0.359934179345146,0,2.79407225533901,0.381525280070491,1.90762640035246,0.333466216921806 -"207",0.0367950387299061,0.531244927318767,0.565955657046288,0.281705242116004,0.413373545976356,0,0.814545882489951,0.268397519364953,1.34198759682477,1.06248985463753 -"208",0.530582245672122,0.348710712976754,0.71462868177332,0.375639305217192,0.515748742967844,0,2.55966398284438,0.515291122836061,2.5764556141803,0.697421425953507 -"209",0.0633011816535145,0.108340573031455,0.0809118126053363,0.81850684992969,0.169858527136967,0,0.339860140236625,0.281650590826757,1.40825295413379,0.216681146062911 -"210",0.257824134780094,0.78136322600767,0.840226377826184,0.171457277378067,0.269061412895098,0,1.03135113597296,0.378912067390047,1.89456033695024,1.56272645201534 -"211",0.932312499266118,0.623790064360946,0.254821076756343,0.0242089463863522,0.344510610913858,1,3.85111299079255,0.716156249633059,3.58078124816529,1.24758012872189 -"212",0.547450596000999,0.887940856860951,0.122590170474723,0.720619803760201,0.587604383938015,0,0.988881175796288,0.5237252980005,2.6186264900025,1.7758817137219 -"213",0.884222959401086,0.353430046001449,0.583359381882474,0.08406000607647,0.798950168536976,1,3.88400438302603,0.692111479700543,3.46055739850271,0.706860092002898 -"214",0.490085966652259,0.964348297100514,0.964018723228946,0.884106095647439,0.0969044822268188,1,4.66446719615264,0.49504298332613,2.47521491663065,1.92869659420103 -"215",0.14695651573129,0.536384655861184,0.585062236757949,0.244350597960874,0.884453472448513,1,2.8867437878357,0.323478257865645,1.61739128932822,1.07276931172237 -"216",0.751487237866968,0.502439225325361,0.815349840559065,0.944897614652291,0.665307360701263,1,4.26704349131145,0.625743618933484,3.12871809466742,1.00487845065072 -"217",0.874019275652245,0.986859295517206,0.167932682903484,0.286446596030146,0.134997180663049,1,4.7088798284555,0.687009637826122,3.43504818913061,1.97371859103441 -"218",0.838522884296253,0.30105854710564,0.170920977368951,0.0428285931702703,0.16211214940995,0,5.02473203038874,0.669261442148127,3.34630721074063,0.60211709421128 -"219",0.156806648243219,0.510898179141805,0.861213547876105,0.147648649988696,0.186238544527441,1,2.89538806374435,0.328403324121609,1.64201662060805,1.02179635828361 -"220",0.197375434916466,0.156743455678225,0.193539138883352,0.0471021230332553,0.95187102816999,1,1.36696371362485,0.348687717458233,1.74343858729117,0.313486911356449 -"221",0.882071267580613,0.297896890668198,0.270532889058813,0.921419626101851,0.330615729093552,1,3.4325845810461,0.691035633790307,3.45517816895153,0.595793781336397 -"222",0.609739470062777,0.0115926961880177,0.233569762902334,0.786698189564049,0.0670711533166468,1,3.03034467980161,0.554869735031389,2.77434867515694,0.0231853923760355 -"223",0.554718128172681,0.98778018169105,0.109109612181783,0.897339832037687,0.673251299653202,0,1.77337541218385,0.52735906408634,2.6367953204317,1.9755603633821 -"224",0.737911276519299,0.341470676474273,0.0167195652611554,0.771151570370421,0.329096242319793,1,5.51212210033221,0.618955638259649,3.09477819129825,0.682941352948546 -"225",0.0485788935329765,0.567677768878639,0.407404868165031,0.0873066033236682,0.0648622515145689,1,1.68246609947837,0.274289446766488,1.37144723383244,1.13535553775728 -"226",0.757339102914557,0.208275747485459,0.854229382006451,0.291275818133727,0.708043777151033,1,6.40524693110892,0.628669551457278,3.14334775728639,0.416551494970918 -"227",0.317405100446194,0.118925794959068,0.858547020470724,0.524239505408332,0.113814766984433,0,1.20592786570227,0.408702550223097,2.04351275111549,0.237851589918137 -"228",0.73615427245386,0.468980162171647,0.264790678862482,0.603146816603839,0.189938658615574,1,3.32614912592536,0.61807713622693,3.09038568113465,0.937960324343294 -"229",0.148835278116167,0.861905274912715,0.935066670645028,0.482410304015502,0.57294079172425,1,3.92002402461907,0.324417639058083,1.62208819529042,1.72381054982543 -"230",0.566647925414145,0.0368269896134734,0.266327171586454,0.132966756587848,0.140493426704779,0,3.25718221414457,0.533323962707072,2.66661981353536,0.0736539792269468 -"231",0.0608025235123932,0.680273383157328,0.160200411919504,0.619789818534628,0.433936862042174,0,-0.176721795473271,0.280401261756197,1.40200630878098,1.36054676631466 -"232",0.376738747349009,0.561861278954893,0.678653753828257,0.387028053635731,0.519730004249141,0,3.3280084267178,0.438369373674504,2.19184686837252,1.12372255790979 -"233",0.721205963054672,0.535985609749332,0.80534098809585,0.323346832068637,0.245089870179072,1,4.74646029216578,0.610602981527336,3.05301490763668,1.07197121949866 -"234",0.806944211479276,0.760449231835082,0.675269671017304,0.633844279218465,0.104813126847148,1,5.87051632261185,0.653472105739638,3.26736052869819,1.52089846367016 -"235",0.21571608632803,0.382765798131004,0.604905374580994,0.541532076196745,0.124779423465952,1,1.75447894124479,0.357858043164015,1.78929021582007,0.765531596262008 -"236",0.942886221921071,0.376835954142734,0.399263358674943,0.223188683623448,0.295363052049652,1,3.44367877808131,0.721443110960536,3.60721555480268,0.753671908285469 -"237",0.638521680608392,0.692133161704987,0.131958311889321,0.850370846455917,0.977589252637699,0,2.69539161567435,0.569260840304196,2.84630420152098,1.38426632340997 -"238",0.391183206113055,0.136625955812633,0.787086982745677,0.657935572322458,0.124401357956231,0,1.37635512096944,0.445591603056528,2.22795801528264,0.273251911625266 -"239",0.780619778204709,0.249644193099812,0.352729776874185,0.953301514033228,0.323722229106352,1,4.44876901610446,0.640309889102355,3.20154944551177,0.499288386199623 -"240",0.631289531011134,0.103028473211452,0.902054619742557,0.409181062597781,0.756783628603444,0,2.21224082799786,0.565644765505567,2.82822382752784,0.206056946422905 -"241",0.529889440396801,0.238804260268807,0.883888429263607,0.852200900902972,0.104863733053207,0,2.89360712248235,0.5149447201984,2.574723600992,0.477608520537615 -"242",0.61911348765716,0.437078967224807,0.783249686704949,0.0810853117145598,0.902392733143643,1,3.78643116865802,0.55955674382858,2.7977837191429,0.874157934449613 -"243",0.507123813731596,0.259019042365253,0.180398088414222,0.59709191462025,0.36267759418115,1,0.83340224008027,0.503561906865798,2.51780953432899,0.518038084730506 -"244",0.729997722897679,0.303574197227135,0.12143788812682,0.718736341223121,0.904707291163504,0,3.41555489946328,0.614998861448839,3.0749943072442,0.607148394454271 -"245",0.0292596030049026,0.0856269979849458,0.0920283710584044,0.258886956842616,0.128722119145095,1,2.31739087680877,0.264629801502451,1.32314900751226,0.171253995969892 -"246",0.0629994536284357,0.346285457257181,0.710803654277697,0.168803036911413,0.254938918165863,1,1.77948515877727,0.281499726814218,1.40749863407109,0.692570914514363 -"247",0.7867690641433,0.613718610722572,0.628257071133703,0.95811992441304,0.904540106654167,1,1.86584003339778,0.64338453207165,3.21692266035825,1.22743722144514 -"248",0.968499195296317,0.359745044494048,0.799100665608421,0.0911272400990129,0.929617148591205,1,3.48923628487909,0.734249597648159,3.67124798824079,0.719490088988096 -"249",0.642073429888114,0.125034847529605,0.37991262669675,0.32126252958551,0.0157691119238734,1,2.32320657446871,0.571036714944057,2.85518357472029,0.25006969505921 -"250",0.0688544809818268,0.177162806270644,0.214105046121404,0.882861213060096,0.754231534199789,1,3.58888598680285,0.284427240490913,1.42213620245457,0.354325612541288 -"251",0.550064265029505,0.0642958893440664,0.095560067333281,0.996537575032562,0.97448641830124,0,0.90912185043261,0.525032132514752,2.62516066257376,0.128591778688133 -"252",0.0501834477763623,0.413807929493487,0.380957726156339,0.66424745391123,0.979277117643505,0,1.37744744699281,0.275091723888181,1.37545861944091,0.827615858986974 -"253",0.49223920959048,0.957197391195223,0.0875331670977175,0.256186719750986,0.926564805209637,1,3.67332773818198,0.49611960479524,2.4805980239762,1.91439478239045 -"254",0.90539386542514,0.852054739836603,0.697320133913308,0.112198191927746,0.668838579906151,0,3.02586711180253,0.70269693271257,3.51348466356285,1.70410947967321 -"255",0.00384662533178926,0.0323917511850595,0.477349169319496,0.21828461275436,0.0043143390212208,0,-0.481596330329273,0.251923312665895,1.25961656332947,0.0647835023701191 -"256",0.768266522558406,0.783969116630033,0.1362932510674,0.558201919309795,0.891019653761759,1,6.33451237964299,0.634133261279203,3.17066630639601,1.56793823326007 -"257",0.902265262790024,0.0669493356253952,0.394432219909504,0.921390696428716,0.949987604282796,1,3.19723574100041,0.701132631395012,3.50566315697506,0.13389867125079 -"258",0.195483320159838,0.605676750652492,0.775762019911781,0.384198633488268,0.281592773739249,1,3.96368714112689,0.347741660079919,1.73870830039959,1.21135350130498 -"259",0.247002701275051,0.63369398470968,0.434097362682223,0.175718660699204,0.918254341930151,0,1.25902490388363,0.373501350637525,1.86750675318763,1.26738796941936 -"260",0.681602994911373,0.0910812949296087,0.254335090052336,0.467348709702492,0.996321982238442,1,3.71208680304298,0.590801497455686,2.95400748727843,0.182162589859217 -"261",0.795236002421007,0.9068334097974,0.32862434675917,0.964976407587528,0.687448905548081,0,3.23036542818852,0.647618001210503,3.23809000605252,1.8136668195948 -"262",0.184791191248223,0.305022972868755,0.127280860673636,0.957058344036341,0.967578271636739,0,2.48159095645405,0.342395595624112,1.71197797812056,0.610045945737511 -"263",0.543723902432248,0.190873782848939,0.433054403867573,0.907907501561567,0.0556250640656799,1,2.15885149666049,0.521861951216124,2.60930975608062,0.381747565697879 -"264",0.506153165362775,0.812797519145533,0.146826863056049,0.825516554992646,0.699547603260726,1,2.95583809311932,0.503076582681388,2.51538291340694,1.62559503829107 -"265",0.187564418185502,0.00388951553031802,0.9579996697139,0.848231395008042,0.202934896573424,0,1.06564903108422,0.343782209092751,1.71891104546376,0.00777903106063604 -"266",0.885992548428476,0.675782974809408,0.295705776195973,0.412552178604528,0.336401432519779,0,4.79201160687051,0.692996274214238,3.46498137107119,1.35156594961882 -"267",0.0101384783629328,0.787846167804673,0.996069723041728,0.454100442118943,0.488190379925072,1,3.44810304156155,0.255069239181466,1.27534619590733,1.57569233560935 -"268",0.493493635673076,0.233178077498451,0.114665533415973,0.306498698424548,0.0950455558486283,1,4.00358537087736,0.496746817836538,2.48373408918269,0.466356154996902 -"269",0.808508486254141,0.743036359315738,0.801507564727217,0.349920463049784,0.31975830392912,1,5.26582551810099,0.65425424312707,3.27127121563535,1.48607271863148 -"270",0.107498885132372,0.0883548797573894,0.234127163421363,0.504339768318459,0.636440558591858,0,1.97881651240402,0.303749442566186,1.51874721283093,0.176709759514779 -"271",0.0432471646927297,0.511646857252344,0.748120300704613,0.800478756427765,0.0315804320853204,0,-0.416853813822435,0.271623582346365,1.35811791173182,1.02329371450469 -"272",0.461251358268782,0.591839547734708,0.561793730128556,0.120921064401045,0.892627025023103,0,2.06286177801815,0.480625679134391,2.40312839567196,1.18367909546942 -"273",0.818848268128932,0.717564678750932,0.390848642680794,0.845780744682997,0.146993735805154,1,2.66785670043534,0.659424134064466,3.29712067032233,1.43512935750186 -"274",0.0813572183251381,0.81348287477158,0.0948893264867365,0.552623082185164,0.493932057637721,0,0.293640347919392,0.290678609162569,1.45339304581285,1.62696574954316 -"275",0.68336055194959,0.934445407474414,0.616584330098704,0.380172382807359,0.0399598693475127,1,6.26602539796486,0.591680275974795,2.95840137987398,1.86889081494883 -"276",0.421716285170987,0.84213083377108,0.37991103506647,0.408049989724532,0.579932872438803,0,2.9315732778149,0.460858142585494,2.30429071292747,1.68426166754216 -"277",0.516818818636239,0.636034937342629,0.545690961647779,0.415742139331996,0.893058705376461,0,1.64887581133795,0.508409409318119,2.5420470465906,1.27206987468526 -"278",0.133888687938452,0.735277550527826,0.546215695794672,0.131170742213726,0.210895709926262,0,1.38350745362363,0.316944343969226,1.58472171984613,1.47055510105565 -"279",0.252559958025813,0.889426697045565,0.672707138583064,0.525403928244486,0.613177619641647,1,5.29488298400199,0.376279979012907,1.88139989506453,1.77885339409113 -"280",0.706887821899727,0.711627533193678,0.0593120802659541,0.594026871956885,0.995177620789036,1,3.89509903708599,0.603443910949863,3.01721955474932,1.42325506638736 -"281",0.668167003663257,0.773140912409872,0.147909809835255,0.821512112161145,0.850430716760457,0,3.40026510350253,0.584083501831628,2.92041750915814,1.54628182481974 -"282",0.308798423502594,0.695626468397677,0.54280500812456,0.717631190549582,0.262683968758211,1,2.8851830823655,0.404399211751297,2.02199605875649,1.39125293679535 -"283",0.692240205826238,0.137805373640731,0.216824283124879,0.349158767377958,0.332042834954336,0,2.75318266887244,0.596120102913119,2.98060051456559,0.275610747281462 -"284",0.776517247548327,0.852825619280338,0.0629134171176702,0.636721442453563,0.702120328554884,1,3.81478325678053,0.638258623774163,3.19129311887082,1.70565123856068 -"285",0.604637587908655,0.673709741327912,0.0228279868606478,0.236699832836166,0.147865205304697,1,3.84236767558524,0.552318793954328,2.76159396977164,1.34741948265582 -"286",0.858306520851329,0.335612001596019,0.454728212440386,0.196110517485067,0.259593422524631,0,2.42931044667628,0.679153260425664,3.39576630212832,0.671224003192037 -"287",0.533907583216205,0.309270842699334,0.487464176258072,0.608458057744429,0.0523834079504013,1,2.38931374418871,0.516953791608103,2.58476895804051,0.618541685398668 -"288",0.181364539312199,0.15553840319626,0.321431200951338,0.0905018872581422,0.489168686792254,0,3.0672433769954,0.340682269656099,1.7034113482805,0.311076806392521 -"289",0.842685909941792,0.460009703179821,0.549324522260576,0.882080938201398,0.731003952911124,0,2.19822462060004,0.671342954970896,3.35671477485448,0.920019406359643 -"290",0.355842544697225,0.0224534657318145,0.170036854920909,0.753118357388303,0.53504154109396,1,2.20347765136854,0.427921272348613,2.13960636174306,0.044906931463629 -"291",0.225998186506331,0.843823293922469,0.311825428856537,0.224254710366949,0.866095959674567,0,2.17253934522846,0.362999093253165,1.81499546626583,1.68764658784494 -"292",0.00817619706504047,0.388731393497437,0.295796520076692,0.299838072154671,0.635087494039908,0,0.91713443985763,0.25408809853252,1.2704404926626,0.777462786994874 -"293",0.389015585649759,0.7657475550659,0.657607306027785,0.981828197836876,0.28613411844708,0,3.73251265079095,0.444507792824879,2.2225389641244,1.5314951101318 -"294",0.80289482860826,0.750445641111583,0.824465148849413,0.845202207798138,0.172626029700041,0,3.58937471445212,0.65144741430413,3.25723707152065,1.50089128222317 -"295",0.257075820816681,0.920408036792651,0.636807371629402,0.86692945077084,0.498499973211437,1,3.35815311803208,0.37853791040834,1.8926895520417,1.8408160735853 -"296",0.806921129580587,0.930106783052906,0.466348831541836,0.16702447226271,0.0506695450749248,0,3.28250398965776,0.653460564790294,3.26730282395147,1.86021356610581 -"297",0.731770202284679,0.626744261244312,0.822500885929912,0.839960718527436,0.331253650365397,1,4.68286286404328,0.615885101142339,3.0794255057117,1.25348852248862 -"298",0.854105863021687,0.99136677547358,0.75114473560825,0.47394397505559,0.391038748901337,1,5.52440252073362,0.677052931510843,3.38526465755422,1.98273355094716 -"299",0.982910386053845,0.228804986225441,0.4118218482472,0.560412824386731,0.81129362876527,1,3.19874095243956,0.741455193026923,3.70727596513461,0.457609972450882 -"300",0.537260508397594,0.999866140075028,0.0544882146641612,0.0470792895648628,0.329533719224855,0,0.845646201846132,0.518630254198797,2.59315127099399,1.99973228015006 -"301",0.951090265531093,0.240685194497928,0.0119307597633451,0.162234526360407,0.587911347858608,1,3.67810454738133,0.725545132765546,3.62772566382773,0.481370388995856 -"302",0.379653593990952,0.266299263108522,0.519823413807899,0.545772253535688,0.875302264234051,0,2.34651898616079,0.439826796995476,2.19913398497738,0.532598526217043 -"303",0.590115331113338,0.736124120885506,0.520190973998979,0.354397727176547,0.30549456528388,0,3.73836448429314,0.545057665556669,2.72528832778335,1.47224824177101 -"304",0.969628035323694,0.426544003654271,0.114795058500022,0.521180084208027,0.433218924561515,0,3.77746085775115,0.734814017661847,3.67407008830924,0.853088007308543 -"305",0.089025997556746,0.729278782615438,0.302480868762359,0.204034158959985,0.550116128753871,0,2.13489154724476,0.294512998778373,1.47256499389187,1.45855756523088 -"306",0.281481198500842,0.839525948045775,0.477420801529661,0.787320669973269,0.203406882006675,0,0.0122427032036678,0.390740599250421,1.9537029962521,1.67905189609155 -"307",0.656620387220755,0.0473731714300811,0.0491078603081405,0.636265496257693,0.134204020723701,1,2.56263562523224,0.578310193610378,2.89155096805189,0.0947463428601623 -"308",0.00614054128527641,0.132069988176227,0.515548444585875,0.0181817889679223,0.359899426577613,0,0.642639963223346,0.253070270642638,1.26535135321319,0.264139976352453 -"309",0.0423079391475767,0.613647652324289,0.57533754198812,0.024236073018983,0.80559182795696,1,3.43322791797544,0.271153969573788,1.35576984786894,1.22729530464858 -"310",0.10972541407682,0.624485180480406,0.207020340487361,0.26339894765988,0.230778862722218,1,3.41303874699709,0.30486270703841,1.52431353519205,1.24897036096081 -"311",0.283243107609451,0.0420354255475104,0.147433743346483,0.459401674102992,0.804996724938974,0,0.957498227721102,0.391621553804725,1.95810776902363,0.0840708510950208 -"312",0.294656632468104,0.575674966676161,0.0535095110535622,0.889061949681491,0.110878354636952,0,0.381225917979951,0.397328316234052,1.98664158117026,1.15134993335232 -"313",0.549122500466183,0.142086069099605,0.630114018917084,0.897454280406237,0.69310928764753,0,3.07332147729054,0.524561250233091,2.62280625116546,0.28417213819921 -"314",0.0953036595601588,0.574961918173358,0.576329245930538,0.633044712711126,0.00452231615781784,0,1.72920175952098,0.297651829780079,1.4882591489004,1.14992383634672 -"315",0.138024045387283,0.520388139411807,0.594022506847978,0.441776280524209,0.405863631749526,1,3.8045682225959,0.319012022693641,1.59506011346821,1.04077627882361 -"316",0.106002369895577,0.737551183905452,0.695053569506854,0.0716310418210924,0.0948152265045792,1,2.35878539366581,0.303001184947789,1.51500592473894,1.4751023678109 -"317",0.672986483201385,0.0980243205558509,0.744554013712332,0.694448831491172,0.997615808621049,1,3.79185047522394,0.586493241600692,2.93246620800346,0.196048641111702 -"318",0.907714033033699,0.381092235213146,0.44775715097785,0.418023432139307,0.12073606881313,0,3.63612876237445,0.703857016516849,3.51928508258425,0.762184470426291 -"319",0.270245473831892,0.31328537594527,0.988566062645987,0.262660470092669,0.703098916215822,1,3.98192218068687,0.385122736915946,1.92561368457973,0.62657075189054 -"320",0.134018899872899,0.166398288682103,0.00982215139083564,0.170214051613584,0.27637414005585,1,2.6968386521438,0.31700944993645,1.58504724968225,0.332796577364206 -"321",0.975022162077948,0.869493109639734,0.426087243016809,0.697929904796183,0.170991741353646,1,3.67307199706628,0.737511081038974,3.68755540519487,1.73898621927947 -"322",0.781665129354224,0.616567953955382,0.241925346199423,0.00120615586638451,0.421946475747973,0,3.84316251696914,0.640832564677112,3.20416282338556,1.23313590791076 -"323",0.912099490407854,0.792621204163879,0.286722101969644,0.278838209342211,0.384778476553038,1,3.0865779007416,0.706049745203927,3.53024872601964,1.58524240832776 -"324",0.25459485175088,0.589965569088235,0.512280909577385,0.8536683304701,0.919637865386903,1,1.2504266355045,0.37729742587544,1.8864871293772,1.17993113817647 -"325",0.826360553270206,0.826305478112772,0.595339826773852,0.775191103573889,0.190496782073751,0,3.52857944384867,0.663180276635103,3.31590138317551,1.65261095622554 -"326",0.388102601049468,0.0567336070816964,0.249532017158344,0.659272507065907,0.404837652109563,0,3.56815836423182,0.444051300524734,2.22025650262367,0.113467214163393 -"327",0.209232805529609,0.959948918549344,0.573013059096411,0.481550401775166,0.129066357854754,1,5.04338955043296,0.354616402764805,1.77308201382402,1.91989783709869 -"328",0.804299844428897,0.866043715272099,0.547537572216243,0.513125028694049,0.872857553884387,1,5.61709780794855,0.652149922214448,3.26074961107224,1.7320874305442 -"329",0.703322411747649,0.324358053738251,0.419903033878654,0.139616106171161,0.891674882732332,1,4.96582203243572,0.601661205873825,3.00830602936912,0.648716107476503 -"330",0.830154821975157,0.822187565499917,0.65582298184745,0.678708988707513,0.499124753288925,0,1.22624272590279,0.665077410987578,3.32538705493789,1.64437513099983 -"331",0.601557670626789,0.364837052067742,0.856342217419297,0.569008991122246,0.295413479441777,0,3.37573225190906,0.550778835313395,2.75389417656697,0.729674104135484 -"332",0.726148881483823,0.492267406312749,0.410490918206051,0.850041142199188,0.0103327645920217,0,2.96196243324142,0.613074440741912,3.06537220370956,0.984534812625498 -"333",0.61913156718947,0.124362560687587,0.712123036151752,0.785178559366614,0.595321952831,0,2.57190487097095,0.559565783594735,2.79782891797367,0.248725121375173 -"334",0.545057364972308,0.63646461092867,0.36423223814927,0.71200033207424,0.723932961234823,1,4.60170988457166,0.522528682486154,2.61264341243077,1.27292922185734 -"335",0.841136327246204,0.839108285494149,0.946288217557594,0.127291325945407,0.0995339918881655,1,6.48606386725854,0.670568163623102,3.35284081811551,1.6782165709883 -"336",0.808218663092703,0.704315280076116,0.681308406405151,0.606498529436067,0.692840445321053,1,6.57744794575885,0.654109331546351,3.27054665773176,1.40863056015223 -"337",0.161330286180601,0.338603063719347,0.44788147858344,0.225034320959821,0.704113157000393,1,0.373223223500588,0.3306651430903,1.6533257154515,0.677206127438694 -"338",0.365940217860043,0.666050603846088,0.913228666642681,0.46120630716905,0.0641200500540435,0,2.51382177032539,0.432970108930022,2.16485054465011,1.33210120769218 -"339",0.315077417530119,0.928899886785075,0.559876169078052,0.253252518596128,0.0827359608374536,0,1.60747712259382,0.40753870876506,2.0376935438253,1.85779977357015 -"340",0.507182754809037,0.626388052711263,0.599952360149473,0.773287924006581,0.12877800129354,0,1.16269750099544,0.503591377404518,2.51795688702259,1.25277610542253 -"341",0.865430835401639,0.689031864749268,0.767114190617576,0.69353406666778,0.957698913058266,1,6.76792001511303,0.68271541770082,3.4135770885041,1.37806372949854 -"342",0.741071597440168,0.776507843052968,0.904065064154565,0.3251963108778,0.878434715094045,0,4.62097984442513,0.620535798720084,3.10267899360042,1.55301568610594 -"343",0.476938482606784,0.779822631040588,0.697856392711401,0.183056466514245,0.505403795978054,1,3.46912162564712,0.488469241303392,2.44234620651696,1.55964526208118 -"344",0.222817220259458,0.88527500955388,0.498659540200606,0.815977800637484,0.779861950082704,0,2.49236430556045,0.361408610129729,1.80704305064864,1.77055001910776 -"345",0.360866437898949,0.954922733129933,0.500324171502143,0.560912237968296,0.506739634554833,1,3.7554219116425,0.430433218949474,2.15216609474737,1.90984546625987 -"346",0.303051957162097,0.684135774848983,0.711536502232775,0.764745916007087,0.228150532348081,0,2.39133629547996,0.401525978581049,2.00762989290524,1.36827154969797 -"347",0.862907516537234,0.00040564127266407,0.139123826287687,0.789351645391434,0.813907435396686,1,2.75713558784801,0.681453758268617,3.40726879134309,0.00081128254532814 -"348",0.831188001437113,0.462873856537044,0.259545505046844,0.205888907425106,0.889464738313109,1,3.09911632210386,0.665594000718556,3.32797000359278,0.925747713074088 -"349",0.0706916199997067,0.0415107605513185,0.460683235898614,0.0902271615341306,0.943987163016573,0,0.634821742473187,0.285345809999853,1.42672904999927,0.083021521102637 -"350",0.177826434141025,0.145659624133259,0.0454481896013021,0.859437769511715,0.924233329016715,0,2.55439201717008,0.338913217070512,1.69456608535256,0.291319248266518 -"351",0.5816181730479,0.427712383447215,0.156637163599953,0.220339478459209,0.264315076638013,1,4.3252791764499,0.54080908652395,2.70404543261975,0.85542476689443 -"352",0.77407026826404,0.252608616603538,0.242002473445609,0.260108378250152,0.541603256715462,1,4.60709040334218,0.63703513413202,3.1851756706601,0.505217233207077 -"353",0.0937575129792094,0.766508494503796,0.838943650014699,0.375865200767294,0.292705729138106,0,2.82950887016096,0.296878756489605,1.48439378244802,1.53301698900759 -"354",0.278831913135946,0.778268935857341,0.783164529595524,0.896263047819957,0.494825140340254,0,0.0795625682544532,0.389415956567973,1.94707978283986,1.55653787171468 -"355",0.282923143124208,0.0262024172116071,0.0672583396080881,0.345006351592019,0.409500666894019,1,0.478800802798231,0.391461571562104,1.95730785781052,0.0524048344232142 -"356",0.0239673017058522,0.657536580460146,0.474840219365433,0.971692389808595,0.676089612301439,0,0.839580027928938,0.261983650852926,1.30991825426463,1.31507316092029 -"357",0.388988422229886,0.272344547556713,0.665587733732536,0.626075983280316,0.0689713656902313,0,2.50244417307737,0.444494211114943,2.22247105557472,0.544689095113426 -"358",0.352348478743806,0.363509304588661,0.128775952383876,0.63599091116339,0.379506427794695,1,4.21929559225941,0.426174239371903,2.13087119685952,0.727018609177321 -"359",0.861299303825945,0.278986109886318,0.791933934669942,0.783231460954994,0.859049616847187,1,4.42071081312068,0.680649651912972,3.40324825956486,0.557972219772637 -"360",0.362508659949526,0.509288799250498,0.284014051081613,0.705287326825783,0.445114272180945,1,3.4604074726149,0.431254329974763,2.15627164987382,1.018577598501 -"361",0.805736583424732,0.29118973063305,0.471574100665748,0.778244223445654,0.655882233986631,0,2.65899928121291,0.652868291712366,3.26434145856183,0.5823794612661 -"362",0.265658895019442,0.123212752165273,0.0437503724824637,0.642220637295395,0.373756965389475,1,4.63861112174185,0.382829447509721,1.9141472375486,0.246425504330546 -"363",0.565965244080871,0.676662751706317,0.130881867837161,0.421687172027305,0.970182379707694,0,2.64542554876429,0.532982622040436,2.66491311020218,1.35332550341263 -"364",0.878473561489955,0.00944132963195443,0.22818242944777,0.38994308677502,0.659020591992885,0,3.57803798537094,0.689236780744977,3.44618390372489,0.0188826592639089 -"365",0.434363611508161,0.396802364150062,0.200677347136661,0.261542631080374,0.493595563573763,0,2.14794109781816,0.46718180575408,2.3359090287704,0.793604728300124 -"366",0.766086756484583,0.580637731589377,0.625749722588807,0.49135489249602,0.156802373938262,0,6.23519456566427,0.633043378242292,3.16521689121146,1.16127546317875 -"367",0.509812908945605,0.703826816054061,0.133405298227444,0.584784402744845,0.216495289700106,1,3.88472376193447,0.504906454472803,2.52453227236401,1.40765363210812 -"368",0.541257249889895,0.322868996765465,0.307496052235365,0.713913602754474,0.60699145658873,0,2.64186124528192,0.520628624944948,2.60314312472474,0.645737993530929 -"369",0.45428684563376,0.198997497791424,0.959127367474139,0.317164421081543,0.631747860461473,1,2.72120831777463,0.47714342281688,2.3857171140844,0.397994995582849 -"370",0.198295878712088,0.549375360365957,0.49981462280266,0.569662395399064,0.656550409039482,1,4.08198610038263,0.349147939356044,1.74573969678022,1.09875072073191 -"371",0.307359770406038,0.392379238270223,0.864605492446572,0.59246674226597,0.469736489234492,0,1.73279528608242,0.403679885203019,2.01839942601509,0.784758476540446 -"372",0.892723977100104,0.00187661359086633,0.628764569060877,0.608044411521405,0.892230437835678,0,4.8997699796634,0.696361988550052,3.48180994275026,0.00375322718173265 -"373",0.0890243088360876,0.0168516524136066,0.0990659447852522,0.949705092934892,0.301645594416186,0,3.01297209226753,0.294512154418044,1.47256077209022,0.0337033048272133 -"374",0.310450689634308,0.727936681592837,0.0767395386938006,0.699923447100446,0.794604978524148,1,3.70686426393908,0.405225344817154,2.02612672408577,1.45587336318567 -"375",0.795365913305432,0.836391689488664,0.0904365191236138,0.390798190841451,0.448021547403187,1,4.88245474896013,0.647682956652716,3.23841478326358,1.67278337897733 -"376",0.394677695352584,0.349783918820322,0.494624897371978,0.711850363295525,0.146607585251331,0,2.68682638845674,0.447338847676292,2.23669423838146,0.699567837640643 -"377",0.911420639138669,0.246738431742415,0.0479880440980196,0.26907053287141,0.819651882629842,1,4.89798403678704,0.705710319569334,3.52855159784667,0.49347686348483 -"378",0.949506390839815,0.702948578866199,0.388637205818668,0.240803360007703,0.339176375418901,1,5.16301467898808,0.724753195419908,3.62376597709954,1.4058971577324 -"379",0.412258912343532,0.788880918640643,0.516194067429751,0.197082243161276,0.128450829768553,0,1.0492547256399,0.456129456171766,2.28064728085883,1.57776183728129 -"380",0.417886382900178,0.0628925480414182,0.621141175739467,0.137242559576407,0.294159235199913,0,1.71063099664887,0.458943191450089,2.29471595725045,0.125785096082836 -"381",0.503933370811865,0.300797851523384,0.0361010471824557,0.37766279396601,0.723136831307784,0,1.94286867150965,0.501966685405932,2.50983342702966,0.601595703046769 -"382",0.0379380285739899,0.526254535187036,0.104408830637112,0.481522649759427,0.603354678722098,0,1.32923631816092,0.268969014286995,1.34484507143497,1.05250907037407 -"383",0.618415978504345,0.392832584213465,0.580753338057548,0.209488528547809,0.633880793582648,0,3.25752914029588,0.559207989252172,2.79603994626086,0.785665168426931 -"384",0.83138853078708,0.187359802657738,0.923231810331345,0.192766719032079,0.628245181404054,1,3.95258822088312,0.66569426539354,3.3284713269677,0.374719605315477 -"385",0.645710269222036,0.243796636816114,0.159077663673088,0.938766736304387,0.294057695195079,1,4.88002357131881,0.572855134611018,2.86427567305509,0.487593273632228 -"386",0.425262235570699,0.910377248888835,0.663339147344232,0.288738673087209,0.252655067481101,1,2.3973585610011,0.46263111778535,2.31315558892675,1.82075449777767 -"387",0.5552146602422,0.563690923852846,0.464039043989033,0.106877294136211,0.109699301421642,1,3.9778618272601,0.5276073301211,2.6380366506055,1.12738184770569 -"388",0.265861401334405,0.0482580547686666,0.655661647208035,0.249526308616623,0.950353019637987,0,0.722909758467821,0.382930700667202,1.91465350333601,0.0965161095373333 -"389",0.681605912744999,0.288639592472464,0.00348554505035281,0.0194537241477519,0.598679418675601,1,6.08424340868877,0.5908029563725,2.9540147818625,0.577279184944928 -"390",0.411491381237283,0.631790591171011,0.835019583348185,0.0934106751810759,0.354717767098919,0,1.43239255675286,0.455745690618642,2.27872845309321,1.26358118234202 -"391",0.356342318467796,0.145982407964766,0.855479337042198,0.990079636918381,0.63968306267634,1,2.44840888902092,0.428171159233898,2.14085579616949,0.291964815929532 -"392",0.360560376895592,0.968532072613016,0.526466036681086,0.667839803500101,0.351197740994394,0,1.5786467230863,0.430280188447796,2.15140094223898,1.93706414522603 -"393",0.185270130168647,0.400395769160241,0.902563548181206,0.367530013434589,0.0891612509731203,0,0.0549271942261331,0.342635065084323,1.71317532542162,0.800791538320482 -"394",0.96749631408602,0.666152550606057,0.459106614347547,0.185601731995121,0.570790378376842,0,4.07274691040213,0.73374815704301,3.66874078521505,1.33230510121211 -"395",0.354194555431604,0.406625586561859,0.911240193992853,0.97237155563198,0.138165902346373,0,2.44793736921149,0.427097277715802,2.13548638857901,0.813251173123717 -"396",0.0503194171469659,0.788750543724746,0.50464509613812,0.182184803532436,0.353404327295721,0,-0.282664122564947,0.275159708573483,1.37579854286741,1.57750108744949 -"397",0.444590261206031,0.87932490487583,0.813274940475821,0.931223862338811,0.437882406404242,0,3.06311886820416,0.472295130603015,2.36147565301508,1.75864980975166 -"398",0.785999563289806,0.178986194776371,0.71884280955419,0.291352769825608,0.779946946771815,0,2.90413673181533,0.642999781644903,3.21499890822452,0.357972389552742 -"399",0.253135001286864,0.29857402574271,0.814680787734687,0.373685715487227,0.985365892061964,0,2.6024296924365,0.376567500643432,1.88283750321716,0.597148051485419 -"400",0.994968972634524,0.373501650057733,0.0816097436472774,0.627128246705979,0.217762788990512,1,4.73259971918907,0.747484486317262,3.73742243158631,0.747003300115466 -"401",0.0193438627757132,0.227533980505541,0.445106693310663,0.691090289736167,0.0932213987689465,0,1.38938580185962,0.259671931387857,1.29835965693928,0.455067961011082 -"402",0.953289694385603,0.378451777156442,0.997874758439139,0.303662179270759,0.230956965591758,1,2.99311007429738,0.726644847192802,3.63322423596401,0.756903554312885 -"403",0.554462141357362,0.104633574606851,0.959279675735161,0.874176078941673,0.60039582522586,1,3.9354921767356,0.527231070678681,2.63615535339341,0.209267149213701 -"404",0.547973468899727,0.527509810402989,0.234686770476401,0.982944427523762,0.284722389187664,1,2.96087410552722,0.523986734449863,2.61993367224932,1.05501962080598 -"405",0.364326368318871,0.479272672208026,0.979245533468202,0.0533934133127332,0.13441281253472,0,2.49576336604291,0.432163184159435,2.16081592079718,0.958545344416052 -"406",0.712159019429237,0.821850306354463,0.859344437951222,0.308145771501586,0.623811861732975,0,4.45444338224362,0.606079509714618,3.03039754857309,1.64370061270893 -"407",0.27350413124077,0.821865265257657,0.623734290944412,0.745313720777631,0.782684063538909,0,1.13976601499123,0.386752065620385,1.93376032810193,1.64373053051531 -"408",0.569795466726646,0.194721538573503,0.0359250844921917,0.493689125869423,0.960316363489255,1,2.59129631649819,0.534897733363323,2.67448866681661,0.389443077147007 -"409",0.120381637243554,0.162957149557769,0.601276575122029,0.218246417120099,0.0446215111296624,1,2.58100678128201,0.310190818621777,1.55095409310888,0.325914299115539 -"410",0.41345955664292,0.690478059696034,0.344639750663191,0.0897289463318884,0.00251253508031368,0,1.50569586435649,0.45672977832146,2.2836488916073,1.38095611939207 -"411",0.276478688465431,0.794163992395625,0.762876401888207,0.575784350279719,0.11027853237465,0,-0.532045752699104,0.388239344232716,1.94119672116358,1.58832798479125 -"412",0.0759497738908976,0.0329053215682507,0.34515516855754,0.693239893298596,0.248641916317865,1,2.16179000191009,0.287974886945449,1.43987443472724,0.0658106431365013 -"413",0.158961964538321,0.989397681318223,0.351843059062958,0.724765110760927,0.565614532213658,0,0.94174822081861,0.32948098226916,1.6474049113458,1.97879536263645 -"414",0.564555558143184,0.337435311172158,0.0913558606989682,0.612484135432169,0.876398465596139,1,3.35830279014666,0.532277779071592,2.66138889535796,0.674870622344315 -"415",0.887079048668966,0.775710348971188,0.399631261825562,0.792027531657368,0.507421017624438,1,4.48943440393387,0.693539524334483,3.46769762167241,1.55142069794238 -"416",0.967360644834116,0.467731426702812,0.59211598103866,0.525151872541755,0.419919028645381,1,4.81197739630927,0.733680322417058,3.66840161208529,0.935462853405625 -"417",0.50361267849803,0.497176293749362,0.761763734510168,0.996206158772111,0.408785302890465,1,3.24597737335951,0.501806339249015,2.50903169624507,0.994352587498724 -"418",0.619977360125631,0.772148923715577,0.954938276438043,0.507306759012863,0.372658810112625,1,5.86800822234543,0.559988680062816,2.79994340031408,1.54429784743115 -"419",0.455251320498064,0.53086285549216,0.0689128744415939,0.201223363401368,0.930786537472159,0,2.12741109127727,0.477625660249032,2.38812830124516,1.06172571098432 -"420",0.582971893716604,0.443752371706069,0.216429971856996,0.916839492507279,0.426354619208723,1,1.65820920503298,0.541485946858302,2.70742973429151,0.887504743412137 -"421",0.455711925635114,0.829713451908901,0.0983692889567465,0.0181640633381903,0.0855827571358532,1,1.92026479712865,0.477855962817557,2.38927981408779,1.6594269038178 -"422",0.361069493927062,0.989473655354232,0.655652553308755,0.923819182673469,0.248879450839013,0,2.41269411980433,0.430534746963531,2.15267373481765,1.97894731070846 -"423",0.534360493766144,0.715190173825249,0.36295795510523,0.27446274086833,0.759584740037099,0,1.09813629663052,0.517180246883072,2.58590123441536,1.4303803476505 -"424",0.900271317688748,0.0557814559433609,0.248304893961176,0.270966665353626,0.371046752436087,1,5.87685739885789,0.700135658844374,3.50067829422187,0.111562911886722 -"425",0.30056441295892,0.671046652831137,0.752619641134515,0.697342769708484,0.300100638763979,0,2.42314313952004,0.40028220647946,2.0014110323973,1.34209330566227 -"426",0.637644424801692,0.152200609911233,0.107265244936571,0.24504912388511,0.742373905377463,1,2.40735279643739,0.568822212400846,2.84411106200423,0.304401219822466 -"427",0.150998449651524,0.0529799903742969,0.378711574943736,0.852512163342908,0.789609213359654,1,1.45039809431336,0.325499224825762,1.62749612412881,0.105959980748594 -"428",0.170962878968567,0.621943197445944,0.106300054350868,0.521015076432377,0.812729798257351,0,2.1643674541412,0.335481439484283,1.67740719742142,1.24388639489189 -"429",0.73395320144482,0.0969044636003673,0.63128391164355,0.286466271383688,0.0379215185530484,1,2.57915564532628,0.61697660072241,3.08488300361205,0.193808927200735 -"430",0.371321473969147,0.883993113646284,0.997417732607573,0.879764921031892,0.963362285168841,0,3.73784472080575,0.435660736984573,2.17830368492287,1.76798622729257 -"431",0.680411833804101,0.258042868925259,0.727248293580487,0.5989761762321,0.300135859753937,0,3.2212545131059,0.59020591690205,2.95102958451025,0.516085737850517 -"432",0.59438065928407,0.774932909058407,0.867021781392395,0.879518706584349,0.660913916537538,0,2.02277949551315,0.547190329642035,2.73595164821018,1.54986581811681 -"433",0.997346180956811,0.320449473802,0.0991368158720434,0.621399980038404,0.854615872027352,0,3.84905215940322,0.748673090478405,3.74336545239203,0.640898947604001 -"434",0.369378035422415,0.75663315015845,0.403009441448376,0.687630071537569,0.525628365576267,1,1.93687702578823,0.434689017711207,2.17344508855604,1.5132663003169 -"435",0.330935712205246,0.117046632803977,0.170059501659125,0.0430930531583726,0.666761887958273,0,1.53408815100526,0.415467856102623,2.07733928051312,0.234093265607953 -"436",0.814849476795644,0.126905866432935,0.367484390968457,0.449729273328558,0.90036902972497,1,3.23888608837583,0.657424738397822,3.28712369198911,0.25381173286587 -"437",0.637828046223149,0.770851493580267,0.83216254436411,0.976859443122521,0.700336534064263,0,1.25587188647806,0.568914023111574,2.84457011555787,1.54170298716053 -"438",0.130352186737582,0.0642180196009576,0.703393461415544,0.036871375516057,0.789988011587411,0,3.73092470335273,0.315176093368791,1.57588046684396,0.128436039201915 -"439",0.739844334078953,0.722206817241386,0.165782148716971,0.943033574149013,0.545100413728505,1,5.77284382199987,0.619922167039476,3.09961083519738,1.44441363448277 -"440",0.459989474387839,0.884177645435557,0.455464424798265,0.0714083181228489,0.751047364901751,1,4.60976933509342,0.47999473719392,2.3999736859696,1.76835529087111 -"441",0.908886187477037,0.0810047236736864,0.059498994378373,0.0891480438876897,0.0331030555535108,1,3.76112931375182,0.704443093738519,3.52221546869259,0.162009447347373 -"442",0.756309910211712,0.00289116497151554,0.959334688028321,0.659266408532858,0.721593948081136,1,3.0789728599045,0.628154955105856,3.14077477552928,0.00578232994303107 -"443",0.873226168565452,0.646621975116432,0.783438071841374,0.696618270128965,0.764263566816226,0,2.95967311005463,0.686613084282726,3.43306542141363,1.29324395023286 -"444",0.0253882359247655,0.99956414476037,0.958762930706143,0.797130971215665,0.62200541771017,0,1.62103804571665,0.262694117962383,1.31347058981191,1.99912828952074 -"445",0.869213645812124,0.639925259863958,0.478849278297275,0.757647741353139,0.482655482366681,1,4.19039839507625,0.684606822906062,3.42303411453031,1.27985051972792 -"446",0.0247513616923243,0.781129661947489,0.583762978902087,0.350242912769318,0.353861210169271,0,2.02292208216127,0.262375680846162,1.31187840423081,1.56225932389498 -"447",0.442299452610314,0.91657841578126,0.106280611362308,0.209215251496062,0.811460655648261,0,2.39818796616773,0.471149726305157,2.35574863152578,1.83315683156252 -"448",0.415204493096098,0.618333098245785,0.563485078746453,0.240198645973578,0.196350867627189,1,4.91966709390123,0.457602246548049,2.28801123274025,1.23666619649157 -"449",0.60773200308904,0.930779248708859,0.704398131696507,0.00131905428133905,0.483123369980603,1,5.73194592996811,0.55386600154452,2.7693300077226,1.86155849741772 -"450",0.930234977276996,0.540626740083098,0.465786681510508,0.350452408427373,0.137255338951945,1,6.15821881784681,0.715117488638498,3.57558744319249,1.0812534801662 -"451",0.127602697582915,0.0558695567306131,0.330781152937561,0.207373080542311,0.554947857512161,1,0.968305154002758,0.313801348791458,1.56900674395729,0.111739113461226 -"452",0.717876924667507,0.60671681468375,0.304669470060617,0.30792368017137,0.942284513264894,1,4.67645669538492,0.608938462333754,3.04469231166877,1.2134336293675 -"453",0.144722659606487,0.476412805495784,0.656103776069358,0.330354306614026,0.958012863760814,0,-0.042798436127758,0.322361329803243,1.61180664901622,0.952825610991567 -"454",0.85262356325984,0.587901146383956,0.351678715785965,0.115588983055204,0.451179439201951,0,3.64596544479645,0.67631178162992,3.3815589081496,1.17580229276791 -"455",0.703266344498843,0.108856660081074,0.964430558262393,0.896629512310028,0.653426943346858,0,3.95622666120864,0.601633172249421,3.00816586124711,0.217713320162147 -"456",0.311140277422965,0.0658142247702926,0.477922098943964,0.506209451938048,0.576700931182131,0,3.48958921934303,0.405570138711482,2.02785069355741,0.131628449540585 -"457",0.0392473398242146,0.275339952670038,0.0326902826782316,0.349539371207356,0.143118519801646,0,2.1533915737899,0.269623669912107,1.34811834956054,0.550679905340075 -"458",0.532331014284864,0.517706297338009,0.552116203121841,0.634542036335915,0.610128585249186,1,2.66397322690764,0.516165507142432,2.58082753571216,1.03541259467602 -"459",0.525525304954499,0.473363523604348,0.576575064100325,0.55759806279093,0.248057540273294,1,3.04820072411688,0.51276265247725,2.56381326238625,0.946727047208697 -"460",0.051427987171337,0.345795891014859,0.895689832279459,0.605434295954183,0.85136452387087,1,1.46587323654516,0.275713993585669,1.37856996792834,0.691591782029718 -"461",0.0595177153591067,0.745864886790514,0.284952744143084,0.00978339673019946,0.598406190983951,0,1.60528576056273,0.279758857679553,1.39879428839777,1.49172977358103 -"462",0.481894623255357,0.5211433947552,0.637843113392591,0.179208822548389,0.419061944819987,1,2.46242610507079,0.490947311627679,2.45473655813839,1.0422867895104 -"463",0.840852348366752,0.180937018012628,0.600556087680161,0.996465008705854,0.123357111820951,0,5.04597756876093,0.670426174183376,3.35213087091688,0.361874036025256 -"464",0.331051747314632,0.329518865561113,0.791120466776192,0.718458274146542,0.91375184757635,1,4.94608249192317,0.415525873657316,2.07762936828658,0.659037731122226 -"465",0.197004708228633,0.0285514437127858,0.825824104249477,0.956137831322849,0.447319889673963,0,2.76418606565753,0.348502354114316,1.74251177057158,0.0571028874255717 -"466",0.87372547085397,0.21706982748583,0.131731783272699,0.221538365585729,0.928531624842435,0,3.63734296129473,0.686862735426985,3.43431367713492,0.434139654971659 -"467",0.897514114156365,0.780231661396101,0.710667701438069,0.624573635635898,0.249254932859913,0,2.05234214692018,0.698757057078183,3.49378528539091,1.5604633227922 -"468",0.655682831536978,0.53260591160506,0.0894102875608951,0.461335106287152,0.270821976009756,1,3.82196377041504,0.577841415768489,2.88920707884245,1.06521182321012 -"469",0.690395658835769,0.972873593680561,0.213475459255278,0.859144495101646,0.143865103600547,1,6.49732835666292,0.595197829417884,2.97598914708942,1.94574718736112 -"470",0.287291700253263,0.0627598117571324,0.215531161054969,0.263563216431066,0.893243331694975,0,1.32627759583531,0.393645850126632,1.96822925063316,0.125519623514265 -"471",0.67384275002405,0.780703308060765,0.468860692810267,0.799425067380071,0.788984526647255,0,1.33940854866401,0.586921375012025,2.93460687506013,1.56140661612153 -"472",0.677943942602724,0.989401749800891,0.349999363534153,0.332913731457666,0.336464385734871,1,4.76839977010026,0.588971971301362,2.94485985650681,1.97880349960178 -"473",0.872544852551073,0.541786924935877,0.463433532509953,0.0310588900465518,0.376853527035564,1,3.21789256195833,0.686272426275536,3.43136213137768,1.08357384987175 -"474",0.696583893848583,0.24322374840267,0.430946102598682,0.437928259605542,0.134838564088568,1,3.56689504678763,0.598291946924292,2.99145973462146,0.48644749680534 -"475",0.688666251022369,0.265209310455248,0.576991037931293,0.880168010015041,0.587966513587162,1,3.61188942808628,0.594333125511184,2.97166562755592,0.530418620910496 -"476",0.433970922604203,0.675321024376899,0.0268562552519143,0.0270932968705893,0.198432562174276,0,1.73747977561041,0.466985461302102,2.33492730651051,1.3506420487538 -"477",0.366330379620194,0.805977120064199,0.236985402880237,0.694312169682235,0.813063220819458,0,2.35508536287207,0.433165189810097,2.16582594905049,1.6119542401284 -"478",0.427709406474605,0.112375353928655,0.126061528455466,0.875598871149123,0.352637022500858,0,2.10835293948729,0.463854703237303,2.31927351618651,0.224750707857311 -"479",0.243581710848957,0.770853443536907,0.446398359490559,0.026275958865881,0.541982042370364,0,3.81494208939867,0.371790855424479,1.85895427712239,1.54170688707381 -"480",0.839887050213292,0.391083685681224,0.474718408193439,0.568788554985076,0.28004222526215,1,3.4870652723503,0.669943525106646,3.34971762553323,0.782167371362448 -"481",0.444456618046388,0.820927359629422,0.470646341098472,0.61852077813819,0.0675896543543786,1,4.5265950899164,0.472228309023194,2.36114154511597,1.64185471925884 -"482",0.790632214862853,0.129404314793646,0.0352762900292873,0.823443059809506,0.373108381871134,0,2.26652612176843,0.645316107431427,3.22658053715713,0.258808629587293 -"483",0.901773805497214,0.422414130764082,0.428075906354934,0.178079024422914,0.84092893707566,1,4.05342348176391,0.700886902748607,3.50443451374304,0.844828261528164 -"484",0.79214180028066,0.678069558925927,0.689726029755548,0.882839775877073,0.239851669874042,0,2.67517118109905,0.64607090014033,3.23035450070165,1.35613911785185 -"485",0.701396161457524,0.673773366492242,0.418573983246461,0.0620387913659215,0.655037712538615,1,5.53337788184307,0.600698080728762,3.00349040364381,1.34754673298448 -"486",0.420755500439554,0.736716542392969,0.0728139316197485,0.383626129245386,0.0247272602282465,0,2.24455818795122,0.460377750219777,2.30188875109889,1.47343308478594 -"487",0.639726703055203,0.203791120089591,0.999097311869264,0.442477701697499,0.396363699808717,1,2.11837056533407,0.569863351527601,2.84931675763801,0.407582240179181 -"488",0.438332027290016,0.789340883726254,0.618685338879004,0.0764902497176081,0.0802225326187909,1,5.5798624101317,0.469166013645008,2.34583006822504,1.57868176745251 -"489",0.0927530841436237,0.317418109159917,0.345373672200367,0.0753946285694838,0.461847720202059,1,3.05094407019605,0.296376542071812,1.48188271035906,0.634836218319833 -"490",0.275660305051133,0.163084955653176,0.909786247182637,0.708623356185853,0.224677380407229,0,3.31099877749933,0.387830152525567,1.93915076262783,0.326169911306351 -"491",0.781232541427016,0.250545394141227,0.486028987448663,0.479252609889954,0.289446449372917,1,5.07190831797063,0.640616270713508,3.20308135356754,0.501090788282454 -"492",0.553667096188292,0.592042733449489,0.917545152595267,0.525464068399742,0.590659336885437,0,3.81290487493768,0.526833548094146,2.63416774047073,1.18408546689898 -"493",0.844582659658045,0.54203152609989,0.0360506179276854,0.0798034318722785,0.43651577248238,1,5.14523482480702,0.672291329829022,3.36145664914511,1.08406305219978 -"494",0.872151838615537,0.268635798478499,0.208411998813972,0.981985778547823,0.613215571735054,1,3.03403025276077,0.686075919307768,3.43037959653884,0.537271596956998 -"495",0.17298135929741,0.428171434206888,0.696825480321422,0.568769177887589,0.6703648311086,0,0.621398283413626,0.336490679648705,1.68245339824352,0.856342868413776 -"496",0.415759210474789,0.654080594656989,0.431365928612649,0.426479264162481,0.291782398940995,1,2.93259594066205,0.457879605237395,2.28939802618697,1.30816118931398 -"497",0.830742046236992,0.826790298800915,0.0667537737172097,0.680378813762218,0.525312107754871,0,3.73392523748534,0.665371023118496,3.32685511559248,1.65358059760183 -"498",0.992772911908105,0.696126987924799,0.531542483251542,0.827448946190998,0.782364560524002,0,3.84118842194466,0.746386455954053,3.73193227977026,1.3922539758496 -"499",0.106754317879677,0.892505023162812,0.966489110840484,0.0754814548417926,0.833679646719247,0,2.2352817444962,0.303377158939838,1.51688579469919,1.78501004632562 -"500",0.284358446719125,0.684066026704386,0.270753138232976,0.338549276115373,0.34808349958621,1,3.18994957236659,0.392179223359562,1.96089611679781,1.36813205340877 diff --git a/demo/data/python_r_debug_train.csv b/demo/data/python_r_debug_train.csv deleted file mode 100644 index 4ae3079..0000000 --- a/demo/data/python_r_debug_train.csv +++ /dev/null @@ -1,501 +0,0 @@ -"","X1","X2","X3","X4","X5","Z","y","pi","mu","tau" -"1",0.175657892366871,0.425986919086426,0.115034265676513,0.524043331388384,0.213423694483936,0,1.06756966830334,0.337828946183436,1.68914473091718,0.851973838172853 -"2",0.0644427817314863,0.990450146142393,0.586875481065363,0.636904710903764,0.44350376795046,1,5.02365059279248,0.282221390865743,1.41110695432872,1.98090029228479 -"3",0.801911186892539,0.52611841307953,0.993196547497064,0.719611200038344,0.403768080053851,0,2.38267498705499,0.65095559344627,3.25477796723135,1.05223682615906 -"4",0.483352031558752,0.882863284787163,0.902842776151374,0.867996269604191,0.0381053381133825,0,3.81766501178555,0.491676015779376,2.45838007889688,1.76572656957433 -"5",0.322889846283942,0.63692079577595,0.759192733094096,0.63800711883232,0.151417147368193,1,3.32600265656742,0.411444923141971,2.05722461570986,1.2738415915519 -"6",0.402638896368444,0.0503807477653027,0.785642613191158,0.275748837506399,0.857939757639542,0,0.771961633008679,0.451319448184222,2.25659724092111,0.100761495530605 -"7",0.766083062859252,0.542655106866732,0.386697526555508,0.920529717812315,0.581633773399517,1,3.56756343362167,0.633041531429626,3.16520765714813,1.08531021373346 -"8",0.911418786039576,0.19505123491399,0.668235321063548,0.223278216319159,0.2931254201103,1,5.48563258037451,0.705709393019788,3.52854696509894,0.39010246982798 -"9",0.620373039040715,0.694945633411407,0.154133702395484,0.306847935775295,0.692252211738378,1,5.32818839797435,0.560186519520357,2.80093259760179,1.38989126682281 -"10",0.0550540692638606,0.151625336380675,0.0774022527039051,0.319891371531412,0.364665337139741,0,-0.354384178642433,0.27752703463193,1.38763517315965,0.303250672761351 -"11",0.511941475793719,0.712185540236533,0.270292097236961,0.689694544067606,0.948037737514824,1,2.61307382918497,0.50597073789686,2.5298536894843,1.42437108047307 -"12",0.858107649954036,0.479927682317793,0.781061610206962,0.35826885746792,0.775924704270437,1,3.26640441272293,0.679053824977018,3.39526912488509,0.959855364635587 -"13",0.268531528301537,0.95527526945807,0.347094255499542,0.0889543774537742,0.112144304206595,1,3.76993548510871,0.384265764150769,1.92132882075384,1.91055053891614 -"14",0.29161476297304,0.0895724629517645,0.110450556036085,0.875042109983042,0.758118432248011,0,1.92205251653967,0.39580738148652,1.9790369074326,0.179144925903529 -"15",0.142638745484874,0.197439881972969,0.357343723531812,0.299157732399181,0.959155859891325,1,2.64181527663549,0.321319372742437,1.60659686371218,0.394879763945937 -"16",0.791349040577188,0.579480619402602,0.638195142382756,0.0588190227281302,0.656276237918064,1,4.32943403054459,0.645674520288594,3.22837260144297,1.1589612388052 -"17",0.0789258610457182,0.000407621031627059,0.974306448362768,0.281800140393898,0.14172595506534,1,0.26264244151376,0.289462930522859,1.4473146526143,0.000815242063254118 -"18",0.835626919055358,0.378200884442776,0.283678215695545,0.364730648463592,0.557805702090263,1,4.2263210127948,0.667813459527679,3.33906729763839,0.756401768885553 -"19",0.774375345557928,0.77650909521617,0.834570203209296,0.163253711769357,0.285100416978821,0,3.49068983048381,0.637187672778964,3.18593836389482,1.55301819043234 -"20",0.731863149441779,0.141655445797369,0.226561995223165,0.931357388617471,0.592812891118228,1,2.56228490912943,0.615931574720889,3.07965787360445,0.283310891594738 -"21",0.92602823022753,0.831608442822471,0.836359487380832,0.160886877216399,0.654104775050655,1,4.52833277079547,0.713014115113765,3.56507057556883,1.66321688564494 -"22",0.00936706410720944,0.450304457219318,0.399152789497748,0.67567821056582,0.0428701895289123,0,1.20005722248304,0.254683532053605,1.27341766026802,0.900608914438635 -"23",0.900683215819299,0.422778223641217,0.0734217786230147,0.355888625374064,0.692537342896685,1,3.76467985647818,0.70034160790965,3.50170803954825,0.845556447282434 -"24",0.0127965302672237,0.995079413056374,0.866462455363944,0.127439035801217,0.506212075939402,0,1.08087073456562,0.256398265133612,1.28199132566806,1.99015882611275 -"25",0.801101501565427,0.0491333529353142,0.644935548072681,0.944603316951543,0.926362689118832,1,2.77799077534484,0.650550750782713,3.25275375391357,0.0982667058706284 -"26",0.366570058045909,0.0685507841408253,0.884431343991309,0.0534091137815267,0.431875542504713,0,2.76142415840292,0.433285029022954,2.16642514511477,0.137101568281651 -"27",0.934111237293109,0.713579987175763,0.988984721014276,0.73786246473901,0.608571310527623,0,3.11638996055068,0.717055618646555,3.58527809323277,1.42715997435153 -"28",0.977535070618615,0.631409304914996,0.871743800118566,0.848484658636153,0.954974562395364,0,3.43069665774632,0.738767535309307,3.69383767654654,1.26281860982999 -"29",0.325144053669646,0.873518430395052,0.451730230590329,0.920608434826136,0.0816511332523078,1,4.52073425861318,0.412572026834823,2.06286013417412,1.7470368607901 -"30",0.130290448199958,0.814491431694478,0.425293868407607,0.784876573598012,0.405894689029083,0,3.60291779074116,0.315145224099979,1.57572612049989,1.62898286338896 -"31",0.79915911750868,0.0355773000046611,0.594828412868083,0.408777112141252,0.920740469591692,0,2.40140637407326,0.64957955875434,3.2478977937717,0.0711546000093222 -"32",0.4084844479803,0.783358588349074,0.754337317310274,0.236938001587987,0.441070929402485,1,3.39308669588133,0.45424222399015,2.27121111995075,1.56671717669815 -"33",0.0905350116081536,0.246667405590415,0.322916897712275,0.0872318409383297,0.337692302884534,0,2.26828554668898,0.295267505804077,1.47633752902038,0.49333481118083 -"34",0.551405685953796,0.697464748518541,0.435020834440365,0.841809202218428,0.689231499098241,1,5.18459565220154,0.525702842976898,2.62851421488449,1.39492949703708 -"35",0.329557478660718,0.0844649563077837,0.514057463034987,0.59018854284659,0.0497662182897329,0,1.88479986739803,0.414778739330359,2.07389369665179,0.168929912615567 -"36",0.301900773076341,0.0531428782269359,0.549559913575649,0.00631554098799825,0.885286964010447,0,1.61829137130544,0.40095038653817,2.00475193269085,0.106285756453872 -"37",0.740209141280502,0.77935784123838,0.681180235464126,0.707988144829869,0.643991898512468,1,4.94343059159009,0.620104570640251,3.10052285320126,1.55871568247676 -"38",0.269744758727029,0.882437237538397,0.673732856521383,0.758573501603678,0.757929349085316,0,2.11206324884136,0.384872379363514,1.92436189681757,1.76487447507679 -"39",0.305352605413646,0.71706037200056,0.322186827892438,0.749857746995986,0.0106408807914704,1,2.99674105070365,0.402676302706823,2.01338151353411,1.43412074400112 -"40",0.790027626790106,0.659854002762586,0.248970545362681,0.5037838940043,0.305409955093637,1,4.94147914858344,0.645013813395053,3.22506906697527,1.31970800552517 -"41",0.19712567771785,0.847818245878443,0.852881458355114,0.296841355971992,0.157095391303301,0,1.07901788656047,0.348562838858925,1.74281419429462,1.69563649175689 -"42",0.0948630415368825,0.181567636784166,0.48093841294758,0.170988416532055,0.782624429091811,0,0.341403669444935,0.297431520768441,1.48715760384221,0.363135273568332 -"43",0.961404810659587,0.190227601444349,0.239099422004074,0.217968959826976,0.839512619655579,1,4.85614094971892,0.730702405329794,3.65351202664897,0.380455202888697 -"44",0.00908280094154179,0.021143636200577,0.677486611995846,0.0215357604902238,0.493612606311217,0,2.07859541542691,0.254541400470771,1.27270700235385,0.042287272401154 -"45",0.315199843840674,0.692740239901468,0.140544775873423,0.887586091179401,0.682946235872805,0,3.50473286832249,0.407599921920337,2.03799960960168,1.38548047980294 -"46",0.580392276402563,0.283808902138844,0.35989411524497,0.553426445927471,0.385148941539228,0,3.66743336252525,0.540196138201281,2.70098069100641,0.567617804277688 -"47",0.400398853933439,0.395575825823471,0.28838176606223,0.265551468590274,0.669601239031181,0,1.96894336975157,0.450199426966719,2.2509971348336,0.791151651646942 -"48",0.63112384150736,0.344945657299832,0.389136143028736,0.625794219551608,0.335215194849297,0,2.58021142883353,0.56556192075368,2.8278096037684,0.689891314599663 -"49",0.956944320816547,0.150128947338089,0.440813677385449,0.345047943061218,0.270396006526425,1,4.11591946694143,0.728472160408273,3.64236080204137,0.300257894676179 -"50",0.177070061676204,0.903508194489405,0.469412393402308,0.351110822055489,0.216294794809073,0,2.80349620564327,0.338535030838102,1.69267515419051,1.80701638897881 -"51",0.765468406956643,0.499973605154082,0.94257174921222,0.77793248440139,0.804266216699034,0,0.764304491064205,0.632734203478321,3.16367101739161,0.999947210308164 -"52",0.460345170227811,0.699702992103994,0.859740170650184,0.22124154237099,0.731755753047764,0,1.49017371199258,0.480172585113905,2.40086292556953,1.39940598420799 -"53",0.322904678294435,0.0490766130387783,0.212294223718345,0.555382446618751,0.418278698809445,1,1.82852576961899,0.411452339147218,2.05726169573609,0.0981532260775566 -"54",0.807874816469848,0.724505121586844,0.574836797546595,0.951446366030723,0.598116573877633,1,4.42075595861589,0.653937408234924,3.26968704117462,1.44901024317369 -"55",0.383121862076223,0.593231638660654,0.181885981233791,0.334500146564096,0.0690837299916893,0,2.38501024947614,0.441560931038111,2.20780465519056,1.18646327732131 -"56",0.188919524895027,0.600188897689804,0.657067698426545,0.22694002231583,0.18548364425078,0,2.81423610091577,0.344459762447514,1.72229881223757,1.20037779537961 -"57",0.636356987757608,0.277546080993488,0.667807882651687,0.0618767824489623,0.505674899090081,1,3.4003526246845,0.568178493878804,2.84089246939402,0.555092161986977 -"58",0.432709142332897,0.474179744487628,0.756885812617838,0.143004255834967,0.434789951425046,0,2.2963507493094,0.466354571166448,2.33177285583224,0.948359488975257 -"59",0.495270893676206,0.756351159652695,0.145130350487307,0.065683503402397,0.19080853019841,0,3.14556221686535,0.497635446838103,2.48817723419052,1.51270231930539 -"60",0.563787255436182,0.946759895887226,0.100922814803198,0.666619274998084,0.330063175875694,0,4.14871351739775,0.531893627718091,2.65946813859046,1.89351979177445 -"61",0.99486805871129,0.387748016277328,0.328263643197715,0.117576713906601,0.236382940551266,1,4.18387794939887,0.747434029355645,3.73717014677823,0.775496032554656 -"62",0.723771505290642,0.451998495263979,0.162834396352991,0.375855417223647,0.980895416578278,1,2.32498211591435,0.611885752645321,3.05942876322661,0.903996990527958 -"63",0.531836646143347,0.588502316968516,0.397776278201491,0.150609658332542,0.869812258053571,1,2.91423870601339,0.515918323071674,2.57959161535837,1.17700463393703 -"64",0.956891323439777,0.949170779902488,0.46993791218847,0.149085293523967,0.925905326148495,1,4.30740212024297,0.728445661719888,3.64222830859944,1.89834155980498 -"65",0.451012394623831,0.343264148803428,0.330488333245739,0.689379357965663,0.355645282194018,1,3.65567272045106,0.475506197311915,2.37753098655958,0.686528297606856 -"66",0.239492917899042,0.628533657174557,0.856541888555512,0.345665677916259,0.678782323841006,0,2.52188465583503,0.369746458949521,1.84873229474761,1.25706731434911 -"67",0.357790958834812,0.207018176792189,0.805852754507214,0.333104218123481,0.687645961763337,1,0.960567255481911,0.428895479417406,2.14447739708703,0.414036353584379 -"68",0.189548842143267,0.541321613127366,0.806628367165104,0.398688580142334,0.688253184081987,0,1.00452221154276,0.344774421071634,1.72387210535817,1.08264322625473 -"69",0.410182813182473,0.740753246704116,0.830763470381498,0.191781067522243,0.971614297712222,0,1.68777801229243,0.455091406591237,2.27545703295618,1.48150649340823 -"70",0.724667606176808,0.131289177574217,0.374038450885564,0.180179296527058,0.824461452197284,0,-0.448746344898415,0.612333803088404,3.06166901544202,0.262578355148435 -"71",0.781847967067733,0.204888799460605,0.529483035439625,0.115226549794897,0.354996880982071,1,3.77614168993304,0.640923983533867,3.20461991766933,0.40977759892121 -"72",0.738926695194095,0.31497076805681,0.493769415654242,0.335728544741869,0.706284874351695,1,3.06054234763159,0.619463347597048,3.09731673798524,0.62994153611362 -"73",0.617019030964002,0.606954194139689,0.73804725240916,0.468987088417634,0.504792063729838,1,3.87674527575046,0.558509515482001,2.79254757741,1.21390838827938 -"74",0.914344452088699,0.0180196282453835,0.413407627725974,0.506925370544195,0.827590980101377,1,2.89686900002131,0.707172226044349,3.53586113022175,0.036039256490767 -"75",0.205568104283884,0.996419523609802,0.0065683729480952,0.932620616164058,0.635846827179193,1,3.001726868909,0.352784052141942,1.76392026070971,1.9928390472196 -"76",0.121772424783558,0.744811011012644,0.790661930572242,0.139623839175329,0.979442500974983,0,3.17263764267404,0.310886212391779,1.55443106195889,1.48962202202529 -"77",0.0941539057530463,0.865152844460681,0.194109014468268,0.887245124671608,0.667056781239808,0,1.4365114516667,0.297076952876523,1.48538476438262,1.73030568892136 -"78",0.591587385162711,0.15197107498534,0.572607452282682,0.7812931437511,0.357640308793634,0,1.95413971844939,0.545793692581356,2.72896846290678,0.30394214997068 -"79",0.157396804308519,0.465318862814456,0.845966003136709,0.313350600888953,0.904804369900376,1,4.03184417724735,0.328698402154259,1.6434920107713,0.930637725628912 -"80",0.632849030662328,0.91201309626922,0.899239778984338,0.499129451811314,0.141789352055639,0,2.94990581268881,0.566424515331164,2.83212257665582,1.82402619253844 -"81",0.0560469701886177,0.609378244029358,0.27916664397344,0.721503586741164,0.801201010355726,0,3.79816034342441,0.278023485094309,1.39011742547154,1.21875648805872 -"82",0.716810244368389,0.202364256372675,0.216821206733584,0.244086748920381,0.713440677151084,1,3.88432753353306,0.608405122184195,3.04202561092097,0.404728512745351 -"83",0.557090348564088,0.444179006619379,0.849389031063765,0.0741977551952004,0.240143457893282,1,3.23822792813296,0.528545174282044,2.64272587141022,0.888358013238758 -"84",0.54595132661052,0.920723919989541,0.317332884995267,0.727802452864125,0.984521196922287,1,6.60963690601432,0.52297566330526,2.6148783165263,1.84144783997908 -"85",0.319438109872863,0.625512587372214,0.502183391479775,0.52721383748576,0.369098779279739,0,2.85070162246601,0.409719054936431,2.04859527468216,1.25102517474443 -"86",0.251096456544474,0.997861544368789,0.161682020640001,0.395249975146726,0.535762676037848,1,4.1239082362613,0.375548228272237,1.87774114136118,1.99572308873758 -"87",0.202309245476499,0.961952098179609,0.87010871921666,0.618529011495411,0.492196656530723,0,1.32803771758919,0.35115462273825,1.75577311369125,1.92390419635922 -"88",0.600944258039817,0.245339969638735,0.893766423221678,0.224044380011037,0.0648047914728522,1,5.49181478462033,0.550472129019909,2.75236064509954,0.49067993927747 -"89",0.370915442937985,0.67001166776754,0.803724008612335,0.368884613970295,0.62276006815955,0,2.59173393681658,0.435457721468993,2.17728860734496,1.34002333553508 -"90",0.933865301776677,0.0617104973644018,0.473307670326903,0.481874980032444,0.493765476858243,1,3.22418321719086,0.716932650888339,3.58466325444169,0.123420994728804 -"91",0.888247855240479,0.0575381889939308,0.442905403440818,0.193840905558318,0.714207643643022,1,4.2474352097172,0.69412392762024,3.4706196381012,0.115076377987862 -"92",0.0268590713385493,0.507727541495115,0.689824024681002,0.302134982310236,0.503364988137037,0,0.226539830643902,0.263429535669275,1.31714767834637,1.01545508299023 -"93",0.893981589004397,0.22449142485857,0.872240771073848,0.553821309003979,0.48593664332293,1,3.72358402896971,0.696990794502199,3.48495397251099,0.44898284971714 -"94",0.514188556931913,0.92029566410929,0.0581890866160393,0.730507906060666,0.731381626799703,1,4.06800215201709,0.507094278465956,2.53547139232978,1.84059132821858 -"95",0.945672438945621,0.352814884157851,0.105887834681198,0.43611017218791,0.130887139122933,0,4.30312558265831,0.722836219472811,3.61418109736405,0.705629768315703 -"96",0.963602092349902,0.616421658778563,0.182353977113962,0.892785342410207,0.879761205520481,1,4.50948497711593,0.731801046174951,3.65900523087475,1.23284331755713 -"97",0.885779901174828,0.00197198335081339,0.556101081892848,0.869831679621711,0.498070729663596,0,3.3660082148817,0.692889950587414,3.46444975293707,0.00394396670162678 -"98",0.77440150314942,0.931197923375294,0.652799792122096,0.903576805721968,0.984662613132969,1,4.56186281159679,0.63720075157471,3.18600375787355,1.86239584675059 -"99",0.568780284374952,0.350452118320391,0.401954545872286,0.444981703534722,0.0600529299117625,0,2.11932160433061,0.534390142187476,2.67195071093738,0.700904236640781 -"100",0.988342846278101,0.871531380107626,0.835998615249991,0.360148150008172,0.253615840571001,1,5.86611772085795,0.744171423139051,3.72085711569525,1.74306276021525 -"101",0.0533437163103372,0.686667514266446,0.454775250982493,0.0946049916092306,0.679880992742255,0,3.92499612222201,0.276671858155169,1.38335929077584,1.37333502853289 -"102",0.939394964138046,0.0279018587898463,0.529040036257356,0.0344772131647915,0.403969279257581,1,2.57218187096353,0.719697482069023,3.59848741034511,0.0558037175796926 -"103",0.79463039431721,0.972978881327435,0.794344635214657,0.667959484271705,0.450011964421719,0,4.20372178584361,0.647315197158605,3.23657598579302,1.94595776265487 -"104",0.86793479975313,0.433938047615811,0.443687868537381,0.19993122597225,0.882545431610197,0,2.8689357776226,0.683967399876565,3.41983699938282,0.867876095231622 -"105",0.358677432872355,0.695151474094018,0.139445771928877,0.115763961337507,0.985905058216304,0,3.24935225285647,0.429338716436177,2.14669358218089,1.39030294818804 -"106",0.883331566816196,0.325650043552741,0.284472334897146,0.236191183328629,0.90582170477137,1,5.45878666501959,0.691665783408098,3.45832891704049,0.651300087105483 -"107",0.621230758260936,0.756460743257776,0.774665114935488,0.233101437566802,0.957665322348475,1,5.82622641502216,0.560615379130468,2.80307689565234,1.51292148651555 -"108",0.810078469803557,0.533161362633109,0.637798466254026,0.46910139080137,0.0266835335642099,1,2.91651830159649,0.655039234901778,3.27519617450889,1.06632272526622 -"109",0.660120197804645,0.279047018615529,0.575902996584773,0.557446440914646,0.990375018911436,0,2.72159757194522,0.580060098902322,2.90030049451161,0.558094037231058 -"110",0.695978978648782,0.214103911770508,0.199250511359423,0.852795354556292,0.0177742254454643,1,3.69788425803726,0.597989489324391,2.98994744662195,0.428207823541015 -"111",0.808932786341757,0.855180682614446,0.722718806704506,0.962254973128438,0.522696919040754,1,5.48328535214696,0.654466393170878,3.27233196585439,1.71036136522889 -"112",0.689764657523483,0.796196075621992,0.834806398488581,0.431518177036196,0.0551130147650838,0,3.12505582858362,0.594882328761742,2.97441164380871,1.59239215124398 -"113",0.475263823056594,0.658694888697937,0.960299337981269,0.912927271565422,0.597001797519624,1,3.24391480302212,0.487631911528297,2.43815955764148,1.31738977739587 -"114",0.230332511942834,0.906841551885009,0.186229231068864,0.487416798947379,0.90435899165459,0,3.1432241368487,0.365166255971417,1.82583127985708,1.81368310377002 -"115",0.439726956887171,0.675336285494268,0.621720276307315,0.865051191765815,0.511649600462988,1,4.57001056220283,0.469863478443585,2.34931739221793,1.35067257098854 -"116",0.746121870353818,0.435298749478534,0.58256883895956,0.0325999525375664,0.0278720878995955,1,5.40863750770603,0.623060935176909,3.11530467588454,0.870597498957068 -"117",0.417456684168428,0.627369625493884,0.0326016959734261,0.66307717631571,0.0194185248110443,1,3.00288902296799,0.458728342084214,2.29364171042107,1.25473925098777 -"118",0.597251284867525,0.203394825104624,0.490762234199792,0.421284244861454,0.00847242097370327,1,3.28403151207916,0.548625642433763,2.74312821216881,0.406789650209248 -"119",0.52201304375194,0.721785846864805,0.757620103890076,0.59128654981032,0.0574914505705237,0,1.88217767845673,0.51100652187597,2.55503260937985,1.44357169372961 -"120",0.939093937166035,0.544876001542434,0.268084212904796,0.239764674799517,0.205532046500593,1,4.44785421784296,0.719546968583018,3.59773484291509,1.08975200308487 -"121",0.305470818886533,0.324598873499781,0.846153811784461,0.118547956924886,0.457450245739892,0,3.47282044662653,0.402735409443267,2.01367704721633,0.649197746999562 -"122",0.623043610248715,0.242658956209198,0.666737768333405,0.400094716344029,0.636496405815706,1,3.87497305492168,0.561521805124357,2.80760902562179,0.485317912418395 -"123",0.438722926657647,0.187257857527584,0.00995921134017408,0.401364153949544,0.962759978370741,1,1.40516840181922,0.469361463328823,2.34680731664412,0.374515715055168 -"124",0.622494318289682,0.458885532803833,0.410064886789769,0.0704301008954644,0.978406162699685,0,4.20783945993324,0.561247159144841,2.80623579572421,0.917771065607667 -"125",0.310267373919487,0.516168043017387,0.576552684884518,0.400036979466677,0.107476169476286,1,2.20066618310337,0.405133686959743,2.02566843479872,1.03233608603477 -"126",0.520515858661383,0.538478190312162,0.877923973137513,0.439197396626696,0.648736407281831,0,2.38332348952991,0.510257929330692,2.55128964665346,1.07695638062432 -"127",0.658963738242164,0.51582843856886,0.29930421942845,0.745672735851258,0.101864844793454,1,4.25676649612445,0.579481869121082,2.89740934560541,1.03165687713772 -"128",0.099581194575876,0.040486732730642,0.720183429075405,0.332570919999853,0.659185790922493,1,2.04954873115949,0.299790597287938,1.49895298643969,0.0809734654612839 -"129",0.376053156564012,0.127079090801999,0.726467716041952,0.171212841989473,0.926661991281435,0,0.831054928169782,0.438026578282006,2.19013289141003,0.254158181603998 -"130",0.790008327690884,0.000751435989513993,0.884414931060746,0.934193012770265,0.564011790091172,1,2.3519372663461,0.645004163845442,3.22502081922721,0.00150287197902799 -"131",0.307936264201999,0.508576810592785,0.396906472742558,0.840467222267762,0.598160045454279,0,1.32901385295705,0.403968132100999,2.019840660505,1.01715362118557 -"132",0.692173462128267,0.545632677618414,0.728215222479776,0.405771655263379,0.18723646341823,1,5.2124146699278,0.596086731064133,2.98043365532067,1.09126535523683 -"133",0.712953856913373,0.521046344656497,0.730191623326391,0.138509339885786,0.265210269251838,0,0.841063441114205,0.606476928456686,3.03238464228343,1.04209268931299 -"134",0.699041162850335,0.892226030584425,0.501042326679453,0.60427852277644,0.46372310584411,1,5.1812841883217,0.599520581425168,2.99760290712584,1.78445206116885 -"135",0.2186747523956,0.961397552397102,0.649845123756677,0.193498300388455,0.785712855868042,0,2.03161355044612,0.3593373761978,1.796686880989,1.9227951047942 -"136",0.501552035566419,0.227743241004646,0.665020882850513,0.279804958263412,0.0713538755662739,1,2.53923683808075,0.50077601778321,2.50388008891605,0.455486482009292 -"137",0.854210360441357,0.681093055289239,0.222397402161732,0.788698554271832,0.971701272530481,0,2.98304946591475,0.677105180220678,3.38552590110339,1.36218611057848 -"138",0.672773509053513,0.812753765843809,0.686746900901198,0.366263823118061,0.504698199918494,1,3.66691726134848,0.586386754526757,2.93193377263378,1.62550753168762 -"139",0.743323472561315,0.442403266206384,0.110904138302431,0.631345651345327,0.33049505809322,1,5.63014989568708,0.621661736280657,3.10830868140329,0.884806532412767 -"140",0.188741889316589,0.064233420882374,0.206428786739707,0.474080571439117,0.597052786499262,1,1.40559951832007,0.344370944658294,1.72185472329147,0.128466841764748 -"141",0.0292092990130186,0.677552626701072,0.0427208980545402,0.605810367036611,0.0179853080771863,0,1.06581719645897,0.264604649506509,1.32302324753255,1.35510525340214 -"142",0.465022845892236,0.582529813982546,0.610411605797708,0.567373978439718,0.411026377929375,0,1.30746988787096,0.482511422946118,2.41255711473059,1.16505962796509 -"143",0.807470435276628,0.633263534400612,0.643921916605905,0.471818705555052,0.473575569922104,0,2.237339298975,0.653735217638314,3.26867608819157,1.26652706880122 -"144",0.70348341902718,0.824018594576046,0.187002800637856,0.713891554623842,0.526028724154457,0,2.17679679785302,0.60174170951359,3.00870854756795,1.64803718915209 -"145",0.0495151439681649,0.725415229331702,0.796341405948624,0.0339837442152202,0.835402830503881,1,4.42770539124731,0.274757571984082,1.37378785992041,1.4508304586634 -"146",0.10574166290462,0.939791619312018,0.775692300638184,0.67966251494363,0.864653829252347,1,3.10554303150491,0.30287083145231,1.51435415726155,1.87958323862404 -"147",0.654423663858324,0.260914867045358,0.0853664763271809,0.70940856426023,0.818733758525923,1,3.16900498018324,0.577211831929162,2.88605915964581,0.521829734090716 -"148",0.481545847374946,0.851994710275903,0.0753860149998218,0.871537799481302,0.337717589689419,0,3.17881664141138,0.490772923687473,2.45386461843736,1.70398942055181 -"149",0.671318091452122,0.718964412109926,0.39994034753181,0.13319063722156,0.441628958797082,1,4.19114387907556,0.585659045726061,2.9282952286303,1.43792882421985 -"150",0.809874882455915,0.869444736978039,0.263219700893387,0.121338590979576,0.448792204493657,1,6.08376940426249,0.654937441227958,3.27468720613979,1.73888947395608 -"151",0.265255505219102,0.314305161591619,0.16748933121562,0.10393415321596,0.183610826265067,1,4.2350366614855,0.382627752609551,1.91313876304775,0.628610323183239 -"152",0.0967010450549424,0.188714685384184,0.999576674774289,0.314230335643515,0.291321114869788,0,0.806814299269348,0.298350522527471,1.49175261263736,0.377429370768368 -"153",0.991646941518411,0.071908668614924,0.503408775432035,0.981060137972236,0.623927378794178,0,4.46065424166301,0.745823470759206,3.72911735379603,0.143817337229848 -"154",0.647126292577013,0.963690158212557,0.470276626758277,0.690100737148896,0.4423496380914,0,3.73615663218823,0.573563146288507,2.86781573144253,1.92738031642511 -"155",0.658537632785738,0.466118028620258,0.540336837992072,0.201212733052671,0.992825543275103,0,2.45952160902915,0.579268816392869,2.89634408196434,0.932236057240516 -"156",0.973891945322976,0.000184340635314584,0.450676114764065,0.250097699929029,0.7179535117466,1,3.86667669789675,0.736945972661488,3.68472986330744,0.000368681270629168 -"157",0.0276261863764375,0.870035748695955,0.852117601316422,0.138546702219173,0.929937791312113,1,1.56512454646404,0.263813093188219,1.31906546594109,1.74007149739191 -"158",0.496930145192891,0.41834717313759,0.293656873516738,0.0683009503409266,0.229301090352237,1,1.70490682735223,0.498465072596446,2.49232536298223,0.836694346275181 -"159",0.935192782431841,0.91794587415643,0.73342390335165,0.788075054297224,0.540016333106905,1,5.44909182399779,0.71759639121592,3.5879819560796,1.83589174831286 -"160",0.554545528721064,0.573853991460055,0.588894992833957,0.977405225392431,0.0183223506901413,1,3.03767318596765,0.527272764360532,2.63636382180266,1.14770798292011 -"161",0.783768880181015,0.762536747381091,0.970665275119245,0.38479223405011,0.699711528141052,1,3.82296632043395,0.641884440090507,3.20942220045254,1.52507349476218 -"162",0.134913253132254,0.0229736866895109,0.64459707448259,0.299393261317164,0.222741686971858,1,1.30895016072476,0.317456626566127,1.58728313283063,0.0459473733790219 -"163",0.36150557314977,0.789132654201239,0.359424934955314,0.714775217464194,0.0265906252898276,0,1.41463689203363,0.430752786574885,2.15376393287443,1.57826530840248 -"164",0.00602929433807731,0.306846134830266,0.0250136735849082,0.272113797487691,0.4396940569859,0,-0.989219154095519,0.253014647169039,1.26507323584519,0.613692269660532 -"165",0.566296270349994,0.237716544652358,0.396275217179209,0.469505100743845,0.239112389273942,1,4.52608180764507,0.533148135174997,2.66574067587499,0.475433089304715 -"166",0.811525397235528,0.316212991718203,0.251360583817586,0.20655264495872,0.19819292309694,0,2.93059020451298,0.655762698617764,3.27881349308882,0.632425983436406 -"167",0.642787445569411,0.43360349512659,0.56435379339382,0.465315884677693,0.316745701013133,0,0.936498719926776,0.571393722784705,2.85696861392353,0.86720699025318 -"168",0.329113852698356,0.168974238913506,0.247654016828164,0.671078298473731,0.602021993370727,1,1.08814766570857,0.414556926349178,2.07278463174589,0.337948477827013 -"169",0.215506052831188,0.93850050214678,0.954076265683398,0.295870862202719,0.86555420816876,0,2.6543606900318,0.357753026415594,1.78876513207797,1.87700100429356 -"170",0.106368665583432,0.0227690043393523,0.126814461546019,0.335573328426108,0.379564404254779,0,-0.0918788461549511,0.303184332791716,1.51592166395858,0.0455380086787045 -"171",0.780151716200635,0.327471402939409,0.0326189920306206,0.0362742017023265,0.0686843525618315,1,3.89456911570653,0.640075858100317,3.20037929050159,0.654942805878818 -"172",0.255447041708976,0.758484110468999,0.153401625575498,0.823814863339067,0.626849590335041,0,1.60286684066871,0.377723520854488,1.88861760427244,1.516968220938 -"173",0.784064061706886,0.00725773838348687,0.130830202950165,0.991556758061051,0.347498998744413,1,3.18986063434325,0.642032030853443,3.21016015426721,0.0145154767669737 -"174",0.488066531019285,0.904814679641277,0.938366169575602,0.389007010264322,0.578476107446477,1,3.56060565990557,0.494033265509643,2.47016632754821,1.80962935928255 -"175",0.391404270427302,0.930538458749652,0.40497282659635,0.737034448189661,0.761331438785419,1,2.36619826104999,0.445702135213651,2.22851067606825,1.8610769174993 -"176",0.585885215085,0.413349227281287,0.615364446304739,0.737390036229044,0.793830956332386,0,2.87723757979901,0.5429426075425,2.7147130377125,0.826698454562575 -"177",0.706269636517391,0.0460679633542895,0.93789595994167,0.813132435781881,0.262739493278787,1,2.74435706640888,0.603134818258695,3.01567409129348,0.0921359267085791 -"178",0.529702278552577,0.121471462305635,0.311007095035166,0.427614264190197,0.183543692342937,0,1.01209027891133,0.514851139276288,2.57425569638144,0.24294292461127 -"179",0.829805185087025,0.650238788453862,0.10513967089355,0.571013604290783,0.581796962535009,1,4.58335728821142,0.664902592543513,3.32451296271756,1.30047757690772 -"180",0.36897468008101,0.00822978303767741,0.161908895708621,0.819052792852744,0.8462382433936,0,1.99962820191286,0.434487340040505,2.17243670020252,0.0164595660753548 -"181",0.123500665649772,0.852398673770949,0.479186387499794,0.0105414546560496,0.668587881838903,0,2.49754905415953,0.311750332824886,1.55875166412443,1.7047973475419 -"182",0.0867682541720569,0.582404370885342,0.38295440422371,0.194637269247323,0.931281024822965,0,2.49905541074758,0.293384127086028,1.46692063543014,1.16480874177068 -"183",0.367929507046938,0.915356322657317,0.177742177154869,0.241532374871895,0.994698132853955,0,1.72161527895557,0.433964753523469,2.16982376761734,1.83071264531463 -"184",0.644673308124766,0.150270025013015,0.785994582111016,0.265613209689036,0.918632334563881,1,3.83612713305638,0.572336654062383,2.86168327031191,0.300540050026029 -"185",0.455503686564043,0.396266285097227,0.139157029101625,0.299634513212368,0.747258668066934,1,3.41439312814389,0.477751843282022,2.38875921641011,0.792532570194453 -"186",0.684094124240801,0.984747910639271,0.643748781643808,0.663593224482611,0.848809125833213,1,5.1517072263118,0.5920470621204,2.960235310602,1.96949582127854 -"187",0.56436142954044,0.0544851438608021,0.984900272684172,0.940265541197732,0.140160881215706,0,2.59656711586673,0.53218071477022,2.6609035738511,0.108970287721604 -"188",0.859204118838534,0.0375711808446795,0.621205840492621,0.463216342031956,0.132147062337026,1,5.13509422497543,0.679602059419267,3.39801029709633,0.075142361689359 -"189",0.202668343437836,0.954008166445419,0.87561972416006,0.345804152078927,0.655373649671674,1,3.40940353309353,0.351334171718918,1.75667085859459,1.90801633289084 -"190",0.347735029645264,0.662324475357309,0.0695883366279304,0.225698770722374,0.550295863533393,0,1.54046283697909,0.423867514822632,2.11933757411316,1.32464895071462 -"191",0.256549048470333,0.222417901037261,0.893534128088504,0.244754296028987,0.0443828273564577,1,0.999583960871957,0.378274524235167,1.89137262117583,0.444835802074522 -"192",0.0717486126814038,0.841635887743905,0.446846724720672,0.255302677396685,0.833212915807962,0,2.198650177281,0.285874306340702,1.42937153170351,1.68327177548781 -"193",0.293647286714986,0.613589271204546,0.328240524744615,0.079192130593583,0.721755997510627,0,1.34561059904555,0.396823643357493,1.98411821678746,1.22717854240909 -"194",0.0333801929373294,0.35055564600043,0.113440742250532,0.207863681716844,0.442360987653956,0,1.43115087902708,0.266690096468665,1.33345048234332,0.70111129200086 -"195",0.243688837625086,0.127426589140669,0.640987044898793,0.634798507904634,0.284261176362634,0,3.25206132223075,0.371844418812543,1.85922209406272,0.254853178281337 -"196",0.364829422906041,0.993781767087057,0.282491856021807,0.19265150395222,0.507287984248251,0,3.87478713656026,0.432414711453021,2.1620735572651,1.98756353417411 -"197",0.193438455928117,0.966401144862175,0.195011527277529,0.720169306499884,0.0156946356873959,0,2.37800312623124,0.346719227964059,1.73359613982029,1.93280228972435 -"198",0.49631273583509,0.631671455921605,0.829156880034134,0.455276112770662,0.678663744358346,1,3.94085149638902,0.498156367917545,2.49078183958773,1.26334291184321 -"199",0.716849299380556,0.0551879548002034,0.186216585803777,0.251712226076052,0.291039473144338,1,1.80770147871363,0.608424649690278,3.04212324845139,0.110375909600407 -"200",0.00661153648979962,0.324752563843504,0.200685812393203,0.45740497065708,0.862083721673116,0,2.1847958900964,0.2533057682449,1.2665288412245,0.649505127687007 -"201",0.844975549960509,0.715800756355748,0.0514899010304362,0.103010763181373,0.379075210774317,1,6.36763698145226,0.672487774980254,3.36243887490127,1.4316015127115 -"202",0.859683581860736,0.317509735934436,0.589362838538364,0.300851496402174,0.113921095617115,0,1.46337383698206,0.679841790930368,3.39920895465184,0.635019471868873 -"203",0.372942184098065,0.0401481359731406,0.487319720908999,0.48998681618832,0.271050891606137,1,1.82731731682061,0.436471092049032,2.18235546024516,0.0802962719462812 -"204",0.353421227773651,0.866348081966862,0.893130546901375,0.340811176458374,0.158576084068045,1,3.89051652719695,0.426710613886826,2.13355306943413,1.73269616393372 -"205",0.501711366465315,0.825162346940488,0.601497975178063,0.0528030588757247,0.521185282152146,0,2.02304133880578,0.500855683232658,2.50427841616329,1.65032469388098 -"206",0.118520232150331,0.597823385847732,0.868955434532836,0.299568902468309,0.107778452569619,1,3.62087784053605,0.309260116075166,1.54630058037583,1.19564677169546 -"207",0.152716923272237,0.15770937060006,0.138078585267067,0.140635871328413,0.730646623531356,0,2.00097395012164,0.326358461636119,1.63179230818059,0.315418741200119 -"208",0.593823273433372,0.360282435780391,0.403273259289563,0.0463055188301951,0.216241207672283,1,2.01730501618557,0.546911636716686,2.73455818358343,0.720564871560782 -"209",0.215477712918073,0.700193152064458,0.0283284627366811,0.961403698194772,0.0383918408770114,0,2.31315755718335,0.357738856459036,1.78869428229518,1.40038630412892 -"210",0.419221326708794,0.415001668035984,0.444289822364226,0.943839401006699,0.625845317030326,1,3.41157829238888,0.459610663354397,2.29805331677198,0.830003336071968 -"211",0.812279747333378,0.419616755098104,0.866897377651185,0.500528199365363,0.132363297045231,1,3.96701220414447,0.656139873666689,3.28069936833344,0.839233510196209 -"212",0.0776596928481013,0.252922466723248,0.665432308567688,0.913602635730058,0.59272701269947,1,1.19573237585457,0.288829846424051,1.44414923212025,0.505844933446497 -"213",0.490833886899054,0.849396094447002,0.816791090648621,0.0809291007462889,0.0232072386424989,1,4.42577319815713,0.495416943449527,2.47708471724764,1.698792188894 -"214",0.0182596414815634,0.467668306082487,0.711652861675248,0.786564751295373,0.68106995546259,0,1.62227758907436,0.259129820740782,1.29564910370391,0.935336612164974 -"215",0.554898213129491,0.852098749252036,0.126766679342836,0.952034344198182,0.0503347208723426,0,2.31130462738936,0.527449106564745,2.63724553282373,1.70419749850407 -"216",0.478946515591815,0.499937498709187,0.408050276339054,0.9323536362499,0.468160020885989,1,2.79396598089298,0.489473257795908,2.44736628897954,0.999874997418374 -"217",0.482255847193301,0.00617958349175751,0.990038965828717,0.959229180356488,0.363983072107658,1,1.13952228061602,0.49112792359665,2.45563961798325,0.012359166983515 -"218",0.512685123365372,0.0295330374501646,0.543278471333906,0.754709907574579,0.991484293248504,1,1.59118386041305,0.506342561682686,2.53171280841343,0.0590660749003291 -"219",0.462509380187839,0.0324917121324688,0.624715344747528,0.750649101100862,0.376096315216273,0,3.34579760238142,0.48125469009392,2.4062734504696,0.0649834242649376 -"220",0.987880068831146,0.379255632171407,0.285788895795122,0.485703551908955,0.432585179805756,0,4.43818520903343,0.743940034415573,3.71970017207786,0.758511264342815 -"221",0.214160243049264,0.329115618253127,0.504366622539237,0.65988288144581,0.199497792404145,1,0.203838527522776,0.357080121524632,1.78540060762316,0.658231236506253 -"222",0.746308331610635,0.596069960854948,0.527210886357352,0.466186086414382,0.935972676379606,1,4.04258897074434,0.623154165805317,3.11577082902659,1.1921399217099 -"223",0.31107401358895,0.819865695433691,0.0905583105050027,0.166492745978758,0.455921357497573,0,2.81257707224402,0.405537006794475,2.02768503397238,1.63973139086738 -"224",0.739556998945773,0.876249922439456,0.704864867730066,0.302606936777011,0.0468714060261846,0,3.84013659927521,0.619778499472886,3.09889249736443,1.75249984487891 -"225",0.189805066445842,0.614447803702205,0.394092865288258,0.0562345059588552,0.599678186699748,0,3.12918059066066,0.344902533222921,1.72451266611461,1.22889560740441 -"226",0.941304530017078,0.313778766198084,0.586461635306478,0.635828146478161,0.12124320003204,0,2.25135762192973,0.720652265008539,3.6032613250427,0.627557532396168 -"227",0.0263099120929837,0.198502558749169,0.052116225939244,0.382384882308543,0.11507048853673,0,1.50857396284642,0.263154956046492,1.31577478023246,0.397005117498338 -"228",0.0146154365502298,0.293404276482761,0.50820388761349,0.948682137299329,0.541391748003662,0,1.28071766305605,0.257307718275115,1.28653859137557,0.586808552965522 -"229",0.189229860436171,0.882332526147366,0.873069456778467,0.559144090395421,0.00594395026564598,0,2.40083919317102,0.344614930218086,1.72307465109043,1.76466505229473 -"230",0.787037657108158,0.58083647605963,0.463562147924677,0.93920686817728,0.658235421869904,1,3.08284655269244,0.643518828554079,3.21759414277039,1.16167295211926 -"231",0.086882745847106,0.343605445232242,0.557642031461,0.0551553117111325,0.588104769587517,1,0.608119650800754,0.293441372923553,1.46720686461776,0.687210890464485 -"232",0.759177450556308,0.104733863845468,0.128557902760804,0.567941050510854,0.151214693207294,1,5.33362428593514,0.629588725278154,3.14794362639077,0.209467727690935 -"233",0.324322514701635,0.337405441096053,0.0136342023033649,0.111083955736831,0.453037511091679,1,3.09797523848012,0.412161257350817,2.06080628675409,0.674810882192105 -"234",0.394923163112253,0.706962682772428,0.161309825023636,0.264979169238359,0.61508109793067,0,4.30454836093051,0.447461581556126,2.23730790778063,1.41392536554486 -"235",0.36323033971712,0.0105881567578763,0.965249924454838,0.921398014063016,0.589083421509713,0,1.90412503398124,0.43161516985856,2.1580758492928,0.0211763135157526 -"236",0.624239242402837,0.225250670220703,0.340045230928808,0.804942113114521,0.0588489272631705,0,3.97643737303245,0.562119621201418,2.81059810600709,0.450501340441406 -"237",0.569230799330398,0.513691831147298,0.931421081535518,0.395760229090229,0.200507738860324,1,3.09570022482138,0.534615399665199,2.673076998326,1.0273836622946 -"238",0.597086020279676,0.718507580459118,0.868196386378258,0.674425965873525,0.356104533653706,0,0.684627292661137,0.548543010139838,2.74271505069919,1.43701516091824 -"239",0.733016249258071,0.0486556487157941,0.875324686057866,0.189824450528249,0.988588615553454,1,4.85895167175622,0.616508124629036,3.08254062314518,0.0973112974315882 -"240",0.075665297685191,0.963334339438006,0.951136669376865,0.828826125012711,0.129892522701994,0,-0.27958849296122,0.287832648842596,1.43916324421298,1.92666867887601 -"241",0.529431781498715,0.5311802146025,0.910464299377054,0.310893309069797,0.944604890421033,1,2.35042688405269,0.514715890749358,2.57357945374679,1.062360429205 -"242",0.338821816956624,0.553101931931451,0.214154068380594,0.98830969305709,0.43814529874362,0,1.62211862129051,0.419410908478312,2.09705454239156,1.1062038638629 -"243",0.276062093442306,0.387544821947813,0.301663376856595,0.651766657130793,0.060659053735435,0,2.27277593463157,0.388031046721153,1.94015523360576,0.775089643895626 -"244",0.325458481675014,0.30079622939229,0.229717388516292,0.79986328817904,0.282266519730911,0,0.704892767463901,0.412729240837507,2.06364620418753,0.60159245878458 -"245",0.871001158840954,0.0193951886612922,0.517692984780297,0.809827270219103,0.856207844102755,1,3.80769131026086,0.685500579420477,3.42750289710239,0.0387903773225844 -"246",0.392830119701102,0.754953968571499,0.482527390588075,0.620786821004003,0.811934733996168,0,1.94494541997455,0.446415059850551,2.23207529925276,1.509907937143 -"247",0.95741911418736,0.133528773207217,0.349950786214322,0.17801677598618,0.691791765158996,0,4.33424401394036,0.72870955709368,3.6435477854684,0.267057546414435 -"248",0.410348960896954,0.549300527432933,0.980876455549151,0.833037794567645,0.891568440245464,0,2.30887344236106,0.455174480448477,2.27587240224238,1.09860105486587 -"249",0.760101064573973,0.704180801054463,0.985724013997242,0.545249464223161,0.123523845104501,0,2.49788587143443,0.630050532286987,3.15025266143493,1.40836160210893 -"250",0.486477481899783,0.374626002972946,0.423099004663527,0.414769713766873,0.944259925745428,1,2.34085172271083,0.493238740949892,2.46619370474946,0.749252005945891 -"251",0.351493755588308,0.538098658435047,0.433580030919984,0.278074508532882,0.872381126275286,1,3.87338449006919,0.425746877794154,2.12873438897077,1.07619731687009 -"252",0.109493995783851,0.224940932355821,0.113150466931984,0.763598107965663,0.621395665453747,0,1.49557418695592,0.304746997891925,1.52373498945963,0.449881864711642 -"253",0.3730239556171,0.340662635164335,0.141621609218419,0.951164317550138,0.383149264380336,1,2.20603397461372,0.43651197780855,2.18255988904275,0.681325270328671 -"254",0.452499700943008,0.740588138345629,0.444689678726718,0.00189675460569561,0.471600687364116,0,0.692575477849906,0.476249850471504,2.38124925235752,1.48117627669126 -"255",0.823467310750857,0.566067726584151,0.956112638115883,0.767248072428629,0.829074954381213,0,3.58457588149535,0.661733655375428,3.30866827687714,1.1321354531683 -"256",0.948127230163664,0.910934465471655,0.676162453601137,0.111392146674916,0.763358386233449,1,5.76700334724904,0.724063615081832,3.62031807540916,1.82186893094331 -"257",0.898094551637769,0.296239975141361,0.161402475554496,0.378706418210641,0.511602406157181,1,2.76294993507084,0.699047275818884,3.49523637909442,0.592479950282723 -"258",0.368936045793816,0.305359087651595,0.587753911036998,0.297822674270719,0.995319178327918,1,1.2551824179786,0.434468022896908,2.17234011448454,0.610718175303191 -"259",0.268009529449046,0.594949606107548,0.319670230383053,0.856282018590719,0.406317938352004,0,2.97124430768803,0.384004764724523,1.92002382362261,1.1898992122151 -"260",0.261087587336078,0.0951725540217012,0.204552485141903,0.221402652561665,0.394831064622849,0,2.58507137707182,0.380543793668039,1.9027189683402,0.190345108043402 -"261",0.190022909548134,0.704959682421759,0.65585383051075,0.923131216550246,0.148159250151366,0,0.704634887436403,0.345011454774067,1.72505727387033,1.40991936484352 -"262",0.924904064508155,0.123348370194435,0.588322657858953,0.0635555936023593,0.0956910985987633,0,2.23482633124167,0.712452032254077,3.56226016127039,0.24669674038887 -"263",0.0564787206239998,0.721811338327825,0.936775134410709,0.688304646173492,0.947555576218292,0,1.47548708462664,0.278239360312,1.39119680156,1.44362267665565 -"264",0.106722365133464,0.640566900838166,0.0919482670724392,0.22046137182042,0.531263650627807,1,2.0667248884333,0.303361182566732,1.51680591283366,1.28113380167633 -"265",0.408913102932274,0.247944701928645,0.535199107369408,0.213078552158549,0.464240300934762,1,0.867248633247196,0.454456551466137,2.27228275733069,0.495889403857291 -"266",0.925110758049414,0.236846597166732,0.487392245791852,0.464093240676448,0.125206974335015,1,3.44856770082517,0.712555379024707,3.56277689512353,0.473693194333464 -"267",0.635236542439088,0.649732469581068,0.402016807347536,0.0674792937934399,0.89775776444003,1,4.06755574534525,0.567618271219544,2.83809135609772,1.29946493916214 -"268",0.0695493074599653,0.335561345797032,0.767971044871956,0.994576431112364,0.452183039858937,0,1.0414425742211,0.284774653729983,1.42387326864991,0.671122691594064 -"269",0.648262935923412,0.57017346797511,0.648959612008184,0.541384588228539,0.54846475366503,0,2.85610859595095,0.574131467961706,2.87065733980853,1.14034693595022 -"270",0.0589249115437269,0.610564203001559,0.176323815248907,0.434075027005747,0.0546586620621383,0,1.19939621274209,0.279462455771863,1.39731227885932,1.22112840600312 -"271",0.825777109479532,0.891223011305556,0.289195551071316,0.255158288171515,0.665580606786534,0,2.47933878557716,0.662888554739766,3.31444277369883,1.78244602261111 -"272",0.132583983242512,0.870026569580659,0.437514937482774,0.242626150837168,0.556064701406285,0,1.75406957671561,0.316291991621256,1.58145995810628,1.74005313916132 -"273",0.38965437351726,0.400042087072507,0.209368964890018,0.326957597397268,0.418913237052038,1,3.40962737923576,0.44482718675863,2.22413593379315,0.800084174145013 -"274",0.218969390494749,0.0385590018704534,0.119771586963907,0.132476766826585,0.203369399765506,0,0.973422797649871,0.359484695247374,1.79742347623687,0.0771180037409067 -"275",0.872149807633832,0.822126860497519,0.621915143216029,0.400574694853276,0.748188690282404,1,5.6348828556973,0.686074903816916,3.43037451908458,1.64425372099504 -"276",0.363278946606442,0.422489224467427,0.168398414505646,0.136178939137608,0.105935669038445,1,1.56983678476575,0.431639473303221,2.15819736651611,0.844978448934853 -"277",0.620111592812464,0.700211576884612,0.42012314661406,0.505400677211583,0.33502555009909,1,4.89057612697073,0.560055796406232,2.80027898203116,1.40042315376922 -"278",0.898005899274722,0.296134324278682,0.84202092140913,0.790610422613099,0.129125235369429,1,4.97161462706902,0.699002949637361,3.4950147481868,0.592268648557365 -"279",0.309739506337792,0.66212184377946,0.569030838087201,0.0202426754403859,0.794490694301203,0,2.09470966008239,0.404869753168896,2.02434876584448,1.32424368755892 -"280",0.370414954144508,0.217444413341582,0.716959204757586,0.935429799836129,0.272985142888501,0,2.02678046521679,0.435207477072254,2.17603738536127,0.434888826683164 -"281",0.140005044173449,0.389923511072993,0.392066424712539,0.756818642141297,0.960151938488707,1,2.8060332104109,0.320002522086725,1.60001261043362,0.779847022145987 -"282",0.8142634939868,0.731907522538677,0.445355031639338,0.39207979477942,0.682936287252232,0,2.48217621049914,0.6571317469934,3.285658734967,1.46381504507735 -"283",0.792959588812664,0.69254313246347,0.524039031472057,0.753729081247002,0.436437703901902,1,3.85590455901184,0.646479794406332,3.23239897203166,1.38508626492694 -"284",0.538137005874887,0.463524064747617,0.00603748275898397,0.103417596779764,0.749232744565234,0,1.51073227757939,0.519068502937444,2.59534251468722,0.927048129495233 -"285",0.317607842152938,0.83831524127163,0.156032017199323,0.507441331166774,0.0659313322976232,1,2.94641223336082,0.408803921076469,2.04401960538235,1.67663048254326 -"286",0.0341264777816832,0.909567009424791,0.639156299876049,0.724056713515893,0.644752479856834,0,2.09850265305288,0.267063238890842,1.33531619445421,1.81913401884958 -"287",0.183510256931186,0.0904462898615748,0.271993047557771,0.0609235551673919,0.583056262228638,1,3.25292567385938,0.341755128465593,1.70877564232796,0.18089257972315 -"288",0.273949036141858,0.97574642742984,0.774723914917558,0.726615201449022,0.259558120276779,0,2.09047234027613,0.386974518070929,1.93487259035464,1.95149285485968 -"289",0.503365583252162,0.491734533337876,0.146552261896431,0.324912984855473,0.522904684068635,0,2.70205442600172,0.501682791626081,2.5084139581304,0.983469066675752 -"290",0.346677529159933,0.868539436720312,0.156844059936702,0.141181799815968,0.992422364884987,1,3.97577087409716,0.423338764579967,2.11669382289983,1.73707887344062 -"291",0.467471071984619,0.0253020881209522,0.861723942682147,0.0145600428804755,0.197322830790654,0,2.26192388620713,0.483735535992309,2.41867767996155,0.0506041762419045 -"292",0.637742751976475,0.0765116044785827,0.527809944702312,0.257956460816786,0.946157818427309,1,1.44157786519383,0.568871375988238,2.84435687994119,0.153023208957165 -"293",0.494757990119979,0.460577421821654,0.00260803801938891,0.337440443923697,0.351221229648218,1,3.64276042832269,0.497378995059989,2.48689497529995,0.921154843643308 -"294",0.664948316523805,0.560546089196578,0.745584897231311,0.00882079801522195,0.188786049606279,1,2.57325346133995,0.582474158261903,2.91237079130951,1.12109217839316 -"295",0.884877462871373,0.546738510485739,0.735270722070709,0.901947581907734,0.428028715075925,1,3.66144981969719,0.692438731435686,3.46219365717843,1.09347702097148 -"296",0.664923764532432,0.499414290534332,0.475090018007904,0.879384011263028,0.697275578742847,1,3.78820421912573,0.582461882266216,2.91230941133108,0.998828581068665 -"297",0.0901164864189923,0.143747781636193,0.0471104665193707,0.921527655096725,0.0431699361652136,0,-1.85305646253067,0.295058243209496,1.47529121604748,0.287495563272387 -"298",0.385937207611278,0.453368100803345,0.607146325754002,0.738542480394244,0.643105254974216,1,4.24310903969261,0.442968603805639,2.21484301902819,0.906736201606691 -"299",0.906770459609106,0.512290110811591,0.929828500142321,0.419689873466268,0.0565571228507906,0,5.34530746682571,0.703385229804553,3.51692614902277,1.02458022162318 -"300",0.686400071252137,0.174652468413115,0.476278741145507,0.991787869017571,0.703875357983634,1,2.01065750920368,0.593200035626069,2.96600017813034,0.349304936826229 -"301",0.724369781091809,0.126509190769866,0.46450910391286,0.748889055335894,0.718973113456741,0,4.11415097080718,0.612184890545905,3.06092445272952,0.253018381539732 -"302",0.830447851680219,0.523238451918587,0.758490433217958,0.793240647064522,0.0582273004110903,1,5.25321867431554,0.66522392584011,3.32611962920055,1.04647690383717 -"303",0.443749482743442,0.461065361043438,0.721672928659245,0.0396454886067659,0.16316518955864,1,3.59080071325618,0.471874741371721,2.3593737068586,0.922130722086877 -"304",0.896117859520018,0.522640142124146,0.274372623302042,0.180502534145489,0.61907735443674,1,4.18313237584518,0.698058929760009,3.49029464880005,1.04528028424829 -"305",0.58344366075471,0.454821463441476,0.848484715912491,0.0983580742031336,0.634392408188432,0,3.71338027318621,0.541721830377355,2.70860915188678,0.909642926882952 -"306",0.266716367099434,0.418841228121892,0.394158132839948,0.776735053630546,0.747497217496857,0,0.419152240384889,0.383358183549717,1.91679091774859,0.837682456243783 -"307",0.698822553269565,0.113416383042932,0.899259232450277,0.97860089992173,0.389605757314712,1,3.46098319933446,0.599411276634783,2.99705638317391,0.226832766085863 -"308",0.774656780296937,0.759638445451856,0.302627109689638,0.72781277820468,0.358655776362866,1,5.66863911642948,0.637328390148468,3.18664195074234,1.51927689090371 -"309",0.668685485376045,0.0113638828042895,0.550633627222851,0.196751944953576,0.509023578371853,1,2.88051182470485,0.584342742688023,2.92171371344011,0.0227277656085789 -"310",0.682774543529376,0.0579526941291988,0.849382069660351,0.733268614625558,0.176795482868329,1,2.87406904008574,0.591387271764688,2.95693635882344,0.115905388258398 -"311",0.489246300887316,0.31654568691738,0.345980922691524,0.41162291704677,0.704216975485906,0,3.1184746176884,0.494623150443658,2.47311575221829,0.633091373834759 -"312",0.69299300503917,0.781775929033756,0.256898981984705,0.196122542954981,0.126988225849345,1,4.3732091335451,0.596496502519585,2.98248251259793,1.56355185806751 -"313",0.0972144769039005,0.0587613631505519,0.88435376714915,0.523736941860989,0.889495726907626,0,1.99219170623223,0.29860723845195,1.49303619225975,0.117522726301104 -"314",0.177737721242011,0.230452229036018,0.413129098480567,0.423949014628306,0.130051064770669,0,2.40547562320531,0.338868860621005,1.69434430310503,0.460904458072037 -"315",0.251944409683347,0.218779364367947,0.426560059655458,0.394094959134236,0.471812029602006,0,2.34959200528428,0.375972204841673,1.87986102420837,0.437558728735894 -"316",0.419841644354165,0.477710290113464,0.775373422075063,0.0795363162178546,0.156480844598264,0,3.41149256268781,0.459920822177082,2.29960411088541,0.955420580226928 -"317",0.450590665219352,0.0713708943221718,0.171820111572742,0.952272883616388,0.540591625031084,1,2.50332558404123,0.475295332609676,2.37647666304838,0.142741788644344 -"318",0.763945800019428,0.301920231198892,0.92615812830627,0.769965185085312,0.181378757115453,1,5.89345352894715,0.631972900009714,3.15986450004857,0.603840462397784 -"319",0.711407892638817,0.996670760447159,0.779598152497783,0.274269348476082,0.429082473507151,1,4.39138974416945,0.605703946319409,3.02851973159704,1.99334152089432 -"320",0.0819127273280174,0.383295381208882,0.938733549322933,0.621314225019887,0.263531162170693,1,3.99147024211884,0.290956363664009,1.45478181832004,0.766590762417763 -"321",0.840097858570516,0.562121844850481,0.909081311896443,0.261350782820955,0.797950873151422,0,1.83203609251606,0.670048929285258,3.35024464642629,1.12424368970096 -"322",0.232273181434721,0.0532747514080256,0.765580544481054,0.0240377818699926,0.505140797700733,0,1.56678499048307,0.36613659071736,1.8306829535868,0.106549502816051 -"323",0.629859528737143,0.0526878982782364,0.734508123947307,0.680626795627177,0.287310792133212,1,2.77894549344864,0.564929764368571,2.82464882184286,0.105375796556473 -"324",0.93614213494584,0.316511457553133,0.628016963833943,0.0602164240553975,0.118401619838551,1,4.47656359217984,0.71807106747292,3.5903553373646,0.633022915106267 -"325",0.500148630701005,0.221908385399729,0.102624936262146,0.759589394321665,0.250086853513494,1,2.06155228186923,0.500074315350503,2.50037157675251,0.443816770799458 -"326",0.288622803520411,0.741494103102013,0.554455174831674,0.607127820141613,0.897736412705854,0,1.13401308480866,0.394311401760206,1.97155700880103,1.48298820620403 -"327",0.192754649557173,0.253611989086494,0.634103545453399,0.549500168301165,0.508808610262349,0,0.665635246547524,0.346377324778587,1.73188662389293,0.507223978172988 -"328",0.806270965375006,0.119185185525566,0.882998529355973,0.796061465051025,0.215555575676262,1,3.65625509878064,0.653135482687503,3.26567741343752,0.238370371051133 -"329",0.28228487377055,0.749204892432317,0.407182175898924,0.470439844531938,0.185119573958218,0,2.15999666657916,0.391142436885275,1.95571218442637,1.49840978486463 -"330",0.0716467609163374,0.210506253410131,0.0795049490407109,0.183772581629455,0.274035342503339,0,2.58573291569764,0.285823380458169,1.42911690229084,0.421012506820261 -"331",0.16617572796531,0.396056741476059,0.397322460543364,0.300987984053791,0.908917566295713,0,2.21259315966334,0.333087863982655,1.66543931991328,0.792113482952118 -"332",0.981804998125881,0.717345707118511,0.347419924568385,0.738172616343945,0.825832477072254,1,7.01198723930642,0.74090249906294,3.7045124953147,1.43469141423702 -"333",0.689138161484152,0.927473443793133,0.374128735624254,0.500966905849054,0.405957870883867,0,2.63268746560127,0.594569080742076,2.97284540371038,1.85494688758627 -"334",0.152759982040152,0.523264113580808,0.704314274946228,0.372596458997577,0.853104249807075,0,2.91610363369822,0.326379991020076,1.63189995510038,1.04652822716162 -"335",0.544889710145071,0.795319727156311,0.554023751057684,0.509509893599898,0.716941926628351,0,4.34582560315332,0.522444855072536,2.61222427536268,1.59063945431262 -"336",0.887079951819032,0.258958271937445,0.291607431601733,0.190416998928413,0.627713095163926,1,4.17022001417107,0.693539975909516,3.46769987954758,0.51791654387489 -"337",0.060817806283012,0.394752656109631,0.532805521739647,0.76287891715765,0.445030210772529,0,0.190716883032258,0.280408903141506,1.40204451570753,0.789505312219262 -"338",0.939178811851889,0.438739986857399,0.0235342604573816,0.741214393638074,0.969235713593662,1,4.93803650490513,0.719589405925944,3.59794702962972,0.877479973714799 -"339",0.0242045447230339,0.540591485099867,0.234998811967671,0.145424400921911,0.714062364306301,0,2.41242112899505,0.262102272361517,1.31051136180758,1.08118297019973 -"340",0.348244154360145,0.107049482874572,0.962625036714599,0.951101044425741,0.303532428806648,1,2.84347387882632,0.424122077180073,2.12061038590036,0.214098965749145 -"341",0.343187675345689,0.81290057906881,0.938762988429517,0.257155821658671,0.602810712065548,1,3.83035994510877,0.421593837672845,2.10796918836422,1.62580115813762 -"342",0.746834841091186,0.808281375095248,0.227027630899101,0.182566804811358,0.861578490119427,1,4.79650001027578,0.623417420545593,3.11708710272796,1.6165627501905 -"343",0.422541493084282,0.867801679531112,0.00383210484869778,0.074286219663918,0.524859937140718,0,3.23947082935244,0.461270746542141,2.3063537327107,1.73560335906222 -"344",0.816506033297628,0.813607341377065,0.583546013105661,0.0634555025026202,0.0186918433755636,1,6.80806146161729,0.658253016648814,3.29126508324407,1.62721468275413 -"345",0.0745121650397778,0.171500070951879,0.723333870526403,0.724615397164598,0.243344478541985,1,1.13725945406744,0.287256082519889,1.43628041259944,0.343000141903758 -"346",0.199169879313558,0.275886067189276,0.955115277087316,0.207138787955046,0.499518068041652,1,1.76045708479884,0.349584939656779,1.7479246982839,0.551772134378552 -"347",0.355822892393917,0.233156350674108,0.457463142694905,0.0844323991332203,0.378100276226178,0,2.14368698738061,0.427911446196958,2.13955723098479,0.466312701348215 -"348",0.237067881738767,0.595004385802895,0.949112112168223,0.540827797492966,0.68866739445366,1,3.49295698016992,0.368533940869384,1.84266970434692,1.19000877160579 -"349",0.836336230160668,0.966103946091607,0.821619460592046,0.0832705048378557,0.117940763942897,1,4.68598643993121,0.668168115080334,3.34084057540167,1.93220789218321 -"350",0.102808272466063,0.921675501158461,0.152489958098158,0.855112064862624,0.985061307903379,0,2.68484019410334,0.301404136233032,1.50702068116516,1.84335100231692 -"351",0.755954840919003,0.29328831192106,0.919805581215769,0.0864397441036999,0.317092708311975,1,2.70915013171441,0.627977420459501,3.13988710229751,0.58657662384212 -"352",0.160184156848118,0.747651313431561,0.525888855569065,0.0728547209873796,0.637013547122478,0,1.79636434107336,0.330092078424059,1.65046039212029,1.49530262686312 -"353",0.349601681577042,0.881921857595444,0.374564638361335,0.599137135082856,0.480625978903845,1,2.23586333008665,0.424800840788521,2.1240042039426,1.76384371519089 -"354",0.827613385161385,0.119170916033909,0.266235013958067,0.69135605939664,0.325353759108111,1,4.35157165937914,0.663806692580692,3.31903346290346,0.238341832067817 -"355",0.40771604841575,0.496801525354385,0.271507070399821,0.923956627957523,0.752182315802202,1,3.87670635268017,0.453858024207875,2.26929012103938,0.993603050708771 -"356",0.498358417768031,0.490357330301777,0.546103176428005,0.495787653373554,0.019914515549317,0,2.82641521839113,0.499179208884016,2.49589604442008,0.980714660603553 -"357",0.623401243705302,0.789511745562777,0.581669624894857,0.0905086826533079,0.916554441908374,0,2.64830496041419,0.561700621852651,2.80850310926326,1.57902349112555 -"358",0.913714656373486,0.686271698912606,0.780048694927245,0.421504226280376,0.509178433800116,1,5.28985503669812,0.706857328186743,3.53428664093371,1.37254339782521 -"359",0.410376613261178,0.397907764650881,0.252015264006332,0.869684448931366,0.879794603213668,1,3.76933637436507,0.455188306630589,2.27594153315295,0.795815529301763 -"360",0.185450643999502,0.384632607921958,0.203868573065847,0.331297104479745,0.679102699505165,0,1.71458923388557,0.342725321999751,1.71362660999876,0.769265215843916 -"361",0.478987265611067,0.941985436948016,0.155996377347037,0.27725469134748,0.342965473188087,0,2.0219551071081,0.489493632805534,2.44746816402767,1.88397087389603 -"362",0.994765556883067,0.848915601847693,0.0641771361697465,0.181318796239793,0.250671037472785,1,5.50588984798032,0.747382778441533,3.73691389220767,1.69783120369539 -"363",0.527613623999059,0.319533335976303,0.27280557458289,0.771635936805978,0.914601368829608,0,3.19355301176956,0.51380681199953,2.56903405999765,0.639066671952605 -"364",0.813534930814058,0.374432943761349,0.723026721272618,0.123765025520697,0.816101632546633,1,5.64107080345262,0.656767465407029,3.28383732703514,0.748865887522697 -"365",0.445521055720747,0.29893424292095,0.62630870891735,0.923434738302603,0.833012500312179,0,2.03270167513398,0.472760527860373,2.36380263930187,0.5978684858419 -"366",0.308063305681571,0.95181461959146,0.318798426305875,0.45227625593543,0.086620221612975,0,2.51819688318312,0.404031652840786,2.02015826420393,1.90362923918292 -"367",0.960696579655632,0.890791008947417,0.64337020763196,0.910550882807001,0.303812348283827,1,6.23199336911313,0.730348289827816,3.65174144913908,1.78158201789483 -"368",0.744988437741995,0.302088005468249,0.89577810629271,0.794859946705401,0.290876251412556,1,5.48086357771497,0.622494218870997,3.11247109435499,0.604176010936499 -"369",0.435765675036237,0.364637922262773,0.225394190521911,0.361059973249212,0.14326752978377,0,3.96886992333342,0.467882837518118,2.33941418759059,0.729275844525546 -"370",0.453624689253047,0.506793080596253,0.549989739898592,0.404056747211143,0.991082380991429,1,3.87797359722323,0.476812344626524,2.38406172313262,1.01358616119251 -"371",0.481347446795553,0.997616931796074,0.554391229525208,0.581003399798647,0.443178332177922,0,2.87976021663779,0.490673723397776,2.45336861698888,1.99523386359215 -"372",0.250732128508389,0.813508553896099,0.279194785514846,0.090103404596448,0.335114595014602,1,4.10006317129348,0.375366064254194,1.87683032127097,1.6270171077922 -"373",0.579805130138993,0.295547199668363,0.217650480102748,0.951169870095327,0.956225947244093,0,4.36483317734169,0.539902565069497,2.69951282534748,0.591094399336725 -"374",0.0131068630144,0.386577352881432,0.751503254985437,0.568495031446218,0.509182316949591,0,1.35878009012835,0.2565534315072,1.282767157536,0.773154705762863 -"375",0.305422936333343,0.832460211357102,0.314796458929777,0.794079198269174,0.671616640174761,0,2.48808005820372,0.402711468166672,2.01355734083336,1.6649204227142 -"376",0.546764237806201,0.369427598081529,0.663980525219813,0.589294424746186,0.410097750369459,0,2.76409152393695,0.5233821189031,2.6169105945155,0.738855196163058 -"377",0.34212621091865,0.289519926300272,0.206059318035841,0.695345025276765,0.0578529215417802,0,1.80256970884547,0.421063105459325,2.10531552729663,0.579039852600545 -"378",0.887426843866706,0.724107706453651,0.399060773430392,0.742590114241466,0.257702455855906,1,4.59333056905039,0.693713421933353,3.46856710966676,1.4482154129073 -"379",0.093772424152121,0.486692695179954,0.429776466684416,0.33109065447934,0.0106407515704632,1,1.92812916760661,0.29688621207606,1.4844310603803,0.973385390359908 -"380",0.85107774566859,0.264863305492327,0.343903308967128,0.417516451096162,0.593641347484663,0,2.16992557620134,0.675538872834295,3.37769436417148,0.529726610984653 -"381",0.19915118557401,0.555107409367338,0.274730365723372,0.784932425711304,0.921320460969582,1,4.95197380592834,0.349575592787005,1.74787796393503,1.11021481873468 -"382",0.289430335862562,0.639341033762321,0.601252291817218,0.812847560970113,0.93236178602092,1,3.09042379041733,0.394715167931281,1.9735758396564,1.27868206752464 -"383",0.845273486105725,0.977536502294242,0.898115896387026,0.984138829866424,0.183875902323052,0,5.03328206466442,0.672636743052863,3.36318371526431,1.95507300458848 -"384",0.717565753264353,0.215957976179197,0.575872369110584,0.268733760807663,0.0653917044401169,1,4.61032170877971,0.608782876632176,3.04391438316088,0.431915952358395 -"385",0.0605809707194567,0.0143277728930116,0.32535031856969,0.323542325058952,0.689835964469239,0,1.06356053528032,0.280290485359728,1.40145242679864,0.0286555457860231 -"386",0.874825620325282,0.377246722346172,0.371871096082032,0.947127050487325,0.240630289772525,1,4.9622744123357,0.687412810162641,3.43706405081321,0.754493444692343 -"387",0.729219028027728,0.219051311491057,0.897906823316589,0.270273395814002,0.859864675207064,0,1.86806295981445,0.614609514013864,3.07304757006932,0.438102622982115 -"388",0.627648294670507,0.652774603804573,0.340090859448537,0.876061562215909,0.640210010809824,0,3.19469073424785,0.563824147335254,2.81912073667627,1.30554920760915 -"389",0.0833687598351389,0.131522290874273,0.402501470874995,0.767376235453412,0.908695922698826,1,1.20024528123018,0.291684379917569,1.45842189958785,0.263044581748545 -"390",0.355501268291846,0.773125174921006,0.685517651261762,0.571858404902741,0.286241183057427,1,4.51309767876011,0.427750634145923,2.13875317072961,1.54625034984201 -"391",0.97828074125573,0.888967816485092,0.385814873501658,0.613870896631852,0.177092381753027,1,5.44589569730826,0.739140370627865,3.69570185313933,1.77793563297018 -"392",0.854364493628964,0.738269051304087,0.49408323620446,0.568166140466928,0.661701407749206,1,4.6854442622868,0.677182246814482,3.38591123407241,1.47653810260817 -"393",0.698853759095073,0.0899494702462107,0.630161663750187,0.0474285981617868,0.75952504039742,1,3.24400765276304,0.599426879547536,2.99713439773768,0.179898940492421 -"394",0.937913936097175,0.966137297451496,0.568972200155258,0.288175805471838,0.666164419380948,1,5.67111738808248,0.718956968048587,3.59478484024294,1.93227459490299 -"395",0.131509614409879,0.833761053159833,0.783824987942353,0.933868850814179,0.6194203493651,0,1.55903692230549,0.315754807204939,1.5787740360247,1.66752210631967 -"396",0.420363581273705,0.71346937562339,0.609338279347867,0.664014242589474,0.12802366935648,0,2.35576988160192,0.460181790636852,2.30090895318426,1.42693875124678 -"397",0.567271595355123,0.383280217880383,0.9554269076325,0.642046662280336,0.414018515730277,0,2.20020827840706,0.533635797677562,2.66817898838781,0.766560435760766 -"398",0.262964201159775,0.665362820727751,0.935947297140956,0.0654496951028705,0.927399283275008,0,3.14069929000605,0.381482100579888,1.90741050289944,1.3307256414555 -"399",0.603927695192397,0.463555741822347,0.646512627135962,0.522785867098719,0.30584816285409,1,2.57422941543009,0.551963847596198,2.75981923798099,0.927111483644694 -"400",0.0238984148018062,0.390355822630227,0.777133835479617,0.224293793318793,0.767258124658838,1,5.07008160208456,0.261949207400903,1.30974603700452,0.780711645260453 -"401",0.305133467307314,0.371885413769633,0.475356244016439,0.358904974302277,0.952730832155794,0,1.95976999475355,0.402566733653657,2.01283366826829,0.743770827539265 -"402",0.884727780241519,0.922875013900921,0.0105199359823018,0.447203677147627,0.663081315113232,0,4.26665168857475,0.69236389012076,3.4618194506038,1.84575002780184 -"403",0.530944407917559,0.879748602863401,0.285956058651209,0.528129633748904,0.220056204590946,1,3.28962317179091,0.51547220395878,2.5773610197939,1.7594972057268 -"404",0.768347321543843,0.653366389451548,0.62299115373753,0.434201619355008,0.0665831486694515,1,4.97743970724656,0.634173660771921,3.17086830385961,1.3067327789031 -"405",0.776812201598659,0.788007727824152,0.219182286411524,0.184446591651067,0.0964720568154007,1,3.23195193375902,0.63840610079933,3.19203050399665,1.5760154556483 -"406",0.88276589452289,0.195515688275918,0.255033149616793,0.209268035134301,0.284377056639642,1,5.84063368239351,0.691382947261445,3.45691473630723,0.391031376551837 -"407",0.638816637219861,0.517457967624068,0.419560599373654,0.675652051111683,0.439172859769315,1,3.47884045902317,0.569408318609931,2.84704159304965,1.03491593524814 -"408",0.622322282055393,0.00413019908592105,0.0311375649180263,0.257214310346171,0.366762712597847,1,2.2517823667873,0.561161141027696,2.80580570513848,0.0082603981718421 -"409",0.259304421488196,0.560104247415438,0.477452610852197,0.216964839491993,0.875887291738763,0,2.54654844155775,0.379652210744098,1.89826105372049,1.12020849483088 -"410",0.694038467016071,0.665041769389063,0.701919323531911,0.383413557428867,0.254648628877476,1,4.75462079362749,0.597019233508036,2.98509616754018,1.33008353877813 -"411",0.919293041108176,0.890598319238052,0.107194651849568,0.474216350819916,0.45169915840961,1,4.61353707533075,0.709646520554088,3.54823260277044,1.7811966384761 -"412",0.104071826441213,0.135686289519072,0.679320246446878,0.983042212668806,0.609841512516141,0,3.02689487436904,0.302035913220607,1.51017956610303,0.271372579038143 -"413",0.92433203663677,0.983074251096696,0.995721722021699,0.0721408340614289,0.909262270666659,1,6.00965933563069,0.712166018318385,3.56083009159192,1.96614850219339 -"414",0.819223106605932,0.149681998416781,0.313704962376505,0.559779848903418,0.749602536205202,1,5.02082079780722,0.659611553302966,3.29805776651483,0.299363996833563 -"415",0.648227753816172,0.951318464474753,0.847826080396771,0.582569436402991,0.7170074575115,0,3.32538535488846,0.574113876908086,2.87056938454043,1.9026369289495 -"416",0.130558584583923,0.470045302296057,0.196474597323686,0.15706492960453,0.316010644892231,1,3.6774901794005,0.315279292291962,1.57639646145981,0.940090604592115 -"417",0.387831066502258,0.634190972428769,0.339062904240564,0.395265705650672,0.800637826090679,0,2.94369865976878,0.443915533251129,2.21957766625565,1.26838194485754 -"418",0.439193754689768,0.338188224472106,0.22793770651333,0.575440189568326,0.331178739434108,1,1.22693588690358,0.469596877344884,2.34798438672442,0.676376448944211 -"419",0.570312433410436,0.933934109518304,0.643891909392551,0.0984055991284549,0.717927202116698,0,2.89665391034206,0.535156216705218,2.67578108352609,1.86786821903661 -"420",0.617960439994931,0.186268304474652,0.329805339686573,0.918298111530021,0.606353102717549,0,4.55226120030014,0.558980219997466,2.79490109998733,0.372536608949304 -"421",0.020638934103772,0.00769886304624379,0.491266620578244,0.560472899582237,0.35248809796758,1,2.58848696853987,0.260319467051886,1.30159733525943,0.0153977260924876 -"422",0.696710754418746,0.689552928088233,0.901159317232668,0.0147770375479013,0.33477950678207,0,1.76736103264218,0.598355377209373,2.99177688604686,1.37910585617647 -"423",0.095207059988752,0.51826476957649,0.353552939137444,0.0360990052577108,0.526482903631404,0,2.00278809137037,0.297603529994376,1.48801764997188,1.03652953915298 -"424",0.888464406365529,0.0941414020489901,0.374275699257851,0.0148316950071603,0.898903132416308,1,2.74467901934158,0.694232203182764,3.47116101591382,0.18828280409798 -"425",0.87803922384046,0.328391608782113,0.370075955055654,0.297112641390413,0.197806166019291,0,3.57287188150778,0.68901961192023,3.44509805960115,0.656783217564225 -"426",0.611798076890409,0.191838393220678,0.542587976902723,0.127866931492463,0.821134306490421,1,3.23225281069477,0.555899038445204,2.77949519222602,0.383676786441356 -"427",0.414172311779112,0.585291824769229,0.706909420434386,0.22411653213203,0.525260203285143,1,3.57994426394861,0.457086155889556,2.28543077944778,1.17058364953846 -"428",0.882165834773332,0.571020641829818,0.657568719703704,0.771385360276327,0.500813092570752,1,3.60823922232653,0.691082917386666,3.45541458693333,1.14204128365964 -"429",0.926236537983641,0.37213644455187,0.480661879992113,0.213276422582567,0.507307859137654,1,4.33024064226983,0.71311826899182,3.5655913449591,0.74427288910374 -"430",0.821265180129558,0.549286864697933,0.964085499756038,0.454240132821724,0.673469122499228,1,4.96523129800948,0.660632590064779,3.30316295032389,1.09857372939587 -"431",0.490554745541885,0.73609966901131,0.323054380947724,0.773000211920589,0.901558360783383,0,3.07972595577974,0.495277372770943,2.47638686385471,1.47219933802262 -"432",0.740311689209193,0.31769933598116,0.325716087594628,0.509847758337855,0.87194666522555,1,3.72708883037062,0.620155844604596,3.10077922302298,0.635398671962321 -"433",0.242698076646775,0.789994390215725,0.40438992716372,0.222079092171043,0.372297570342198,0,2.9833142720135,0.371349038323388,1.85674519161694,1.57998878043145 -"434",0.777641264488921,0.392773418687284,0.695135698188096,0.0970356522593647,0.52744018775411,1,4.94940066041803,0.63882063224446,3.1941031612223,0.785546837374568 -"435",0.894813818391412,0.747972055571154,0.539479580475017,0.756195759633556,0.329669744707644,1,5.53045393691245,0.697406909195706,3.48703454597853,1.49594411114231 -"436",0.83916248427704,0.0742014194838703,0.641684540081769,0.195163898402825,0.881822075694799,1,2.85291330305285,0.66958124213852,3.3479062106926,0.148402838967741 -"437",0.896263581002131,0.124902125215158,0.360560656990856,0.0319124613888562,0.300893859239295,1,2.29582803266543,0.698131790501066,3.49065895250533,0.249804250430316 -"438",0.444589321035892,0.136125763179734,0.273149374872446,0.940283931558952,0.169896445004269,0,1.85733835898292,0.472294660517946,2.36147330258973,0.272251526359469 -"439",0.596711891703308,0.343889373820275,0.293180734384805,0.776380060473457,0.0383637468330562,1,4.25784447886007,0.548355945851654,2.74177972925827,0.68777874764055 -"440",0.257731650723144,0.43355701980181,0.652881997870281,0.0987386044580489,0.923100730637088,0,1.0937549783545,0.378865825361572,1.89432912680786,0.867114039603621 -"441",0.175676622428,0.905194091843441,0.864113700808957,0.978905341820791,0.487757970578969,0,3.5441946158548,0.337838311214,1.68919155607,1.81038818368688 -"442",0.979613196337596,0.261700194561854,0.775510441511869,0.606152006192133,0.950104214251041,1,3.7984866352467,0.739806598168798,3.69903299084399,0.523400389123708 -"443",0.731943068327382,0.516181075479835,0.593175867572427,0.695445636520162,0.663467374863103,1,5.41759525642885,0.615971534163691,3.07985767081846,1.03236215095967 -"444",0.527793901273981,0.724690583068877,0.548641574103385,0.829345144564286,0.731690818211064,0,0.797649987537207,0.51389695063699,2.56948475318495,1.44938116613775 -"445",0.876440058927983,0.946900122798979,0.550384040921926,0.0349794356152415,0.390831492608413,1,5.17253086630052,0.688220029463992,3.44110014731996,1.89380024559796 -"446",0.232552570756525,0.638187697855756,0.598653342807665,0.105006995145231,0.896341954357922,0,0.489816892987657,0.366276285378262,1.83138142689131,1.27637539571151 -"447",0.942318941932172,0.507549672853202,0.672664004610851,0.792324033100158,0.668244018219411,1,4.36198473722618,0.721159470966086,3.60579735483043,1.0150993457064 -"448",0.735054767690599,0.370614675804973,0.861057246569544,0.567660537082702,0.791338887764141,1,3.24731309908513,0.6175273838453,3.0876369192265,0.741229351609945 -"449",0.302934925537556,0.214917464880273,0.141012729611248,0.370997515739873,0.280667041894048,0,2.98312576183182,0.401467462768778,2.00733731384389,0.429834929760545 -"450",0.288354639429599,0.549043192062527,0.85949305142276,0.451949829468504,0.40930223162286,0,2.14845737483495,0.3941773197148,1.970886598574,1.09808638412505 -"451",0.79054248239845,0.567079863511026,0.475842082872987,0.524312488734722,0.194229966029525,1,4.14525817925111,0.645271241199225,3.22635620599613,1.13415972702205 -"452",0.772606553742662,0.33342854026705,0.921993240248412,0.510014441097155,0.520535873714834,1,3.5533301100654,0.636303276871331,3.18151638435666,0.6668570805341 -"453",0.495443793945014,0.202895627822727,0.0377851591911167,0.419779064133763,0.154490935150534,0,2.06672632171284,0.497721896972507,2.48860948486254,0.405791255645454 -"454",0.804056923603639,0.838408924173564,0.668332562316209,0.566370291169733,0.139310093829408,1,4.81739604053451,0.65202846180182,3.2601423090091,1.67681784834713 -"455",0.162588593317196,0.256670767907053,0.631337493658066,0.593131849775091,0.443600643193349,1,1.51878632027506,0.331294296658598,1.65647148329299,0.513341535814106 -"456",0.0185740648303181,0.354536469792947,0.536830102093518,0.84644612413831,0.370885606389493,0,1.4972250023931,0.259287032415159,1.2964351620758,0.709072939585894 -"457",0.824891570024192,0.103953977348283,0.645286597777158,0.0587785863317549,0.0432438957504928,0,2.698230891701,0.662445785012096,3.31222892506048,0.207907954696566 -"458",0.707426170352846,0.369496070547029,0.208844104316086,0.303663365775719,0.379852997837588,1,4.28458687408813,0.603713085176423,3.01856542588212,0.738992141094059 -"459",0.198884064331651,0.0728179041761905,0.880236109253019,0.3019107603468,0.570982047123834,0,2.79043980213549,0.349442032165825,1.74721016082913,0.145635808352381 -"460",0.42798253102228,0.929083795752376,0.518992735538632,0.160264727892354,0.0926755168475211,0,0.509727396520501,0.46399126551114,2.3199563275557,1.85816759150475 -"461",0.55239292816259,0.960161203285679,0.862964794971049,0.51109114754945,0.589375362265855,0,3.52977025058532,0.526196464081295,2.63098232040647,1.92032240657136 -"462",0.80854022805579,0.762005831114948,0.137550845043734,0.968200790463015,0.428053489653394,0,2.284218108225,0.654270114027895,3.27135057013948,1.5240116622299 -"463",0.446115306112915,0.543330685002729,0.0552926952950656,0.65399322565645,0.714652967639267,1,4.12285412245127,0.473057653056458,2.36528826528229,1.08666137000546 -"464",0.854253289056942,0.690475940937176,0.999009841820225,0.951701279263943,0.591974006732926,0,1.84720323683811,0.677126644528471,3.38563322264235,1.38095188187435 -"465",0.944034513784572,0.314972412539646,0.859263889258727,0.839653331786394,0.963475862750784,1,5.20618315523483,0.722017256892286,3.61008628446143,0.629944825079292 -"466",0.754232178907841,0.998067119857296,0.694696025922894,0.423583515686914,0.671089532086626,1,4.95503252929108,0.627116089453921,3.1355804472696,1.99613423971459 -"467",0.479697181610391,0.827399303903803,0.222167549887672,0.762202852405608,0.73587511270307,1,3.85491691855885,0.489848590805195,2.44924295402598,1.65479860780761 -"468",0.458247504895553,0.317291336832568,0.361460738349706,0.452591915847734,0.843780854716897,1,0.991988091060597,0.479123752447776,2.39561876223888,0.634582673665136 -"469",0.708376433933154,0.0182475871406496,0.556372930761427,0.544035506201908,0.58339427318424,1,3.90195149308098,0.604188216966577,3.02094108483288,0.0364951742812991 -"470",0.177807073807344,0.136409895028919,0.888396246358752,0.840277233393863,0.806755629135296,0,0.824415702291778,0.338903536903672,1.69451768451836,0.272819790057838 -"471",0.593907246598974,0.984248541295528,0.429106354480609,0.341550226556137,0.0196611173450947,0,1.72723994929129,0.546953623299487,2.73476811649743,1.96849708259106 -"472",0.15961766988039,0.705637908307835,0.614215930458158,0.634689756669104,0.554306766251102,0,1.73623340490723,0.329808834940195,1.64904417470098,1.41127581661567 -"473",0.441327942302451,0.590574649395421,0.714432129403576,0.893167303409427,0.632358823902905,1,4.42371962928434,0.470663971151225,2.35331985575613,1.18114929879084 -"474",0.219465317204595,0.936171065550297,0.479552861768752,0.127818040316924,0.699350607814267,0,2.79824092228767,0.359732658602297,1.79866329301149,1.8723421311006 -"475",0.803314010845497,0.943087524501607,0.2696994158905,0.0330248046666384,0.552581305149943,1,6.5921861226695,0.651657005422749,3.25828502711374,1.88617504900321 -"476",0.310891261789948,0.844792447518557,0.548195693874732,0.156870286446065,0.886524276109412,1,4.72477599671648,0.405445630894974,2.02722815447487,1.68958489503711 -"477",0.642004023538902,0.244795159436762,0.00186481256969273,0.230728532187641,0.356140184914693,1,1.8654817718548,0.571002011769451,2.85501005884726,0.489590318873525 -"478",0.845769837498665,0.0624045978765935,0.497125540859997,0.507586524588987,0.385606018127874,0,4.32554697509981,0.672884918749332,3.36442459374666,0.124809195753187 -"479",0.853145534871146,0.332970552379265,0.190948330564424,0.254413118120283,0.401529945898801,1,3.03744308194837,0.676572767435573,3.38286383717787,0.665941104758531 -"480",0.262389204232022,0.560305213788524,0.937002105172724,0.18127941689454,0.28235938353464,0,1.85311626576241,0.381194602116011,1.90597301058006,1.12061042757705 -"481",0.967729922616854,0.83324823831208,0.805008728522807,0.732130045536906,0.917332550976425,0,4.11002376747028,0.733864961308427,3.66932480654214,1.66649647662416 -"482",0.188902381109074,0.967760788276792,0.166718056891114,0.376329018734396,0.957775333197787,1,4.17773023983835,0.344451190554537,1.72225595277268,1.93552157655358 -"483",0.273718968732283,0.972912728553638,0.400272625964135,0.919987066183239,0.662415315862745,1,4.02846458181227,0.386859484366141,1.93429742183071,1.94582545710728 -"484",0.0518355793319643,0.161674242699519,0.0602240955922753,0.154443724546582,0.226405540248379,1,0.866171461148073,0.275917789665982,1.37958894832991,0.323348485399038 -"485",0.219074408290908,0.606761728180572,0.605247943196446,0.916864186991006,0.814391107065603,0,1.5802853075179,0.359537204145454,1.79768602072727,1.21352345636114 -"486",0.0779492915607989,0.825549530331045,0.390679782023653,0.116454793838784,0.409571290249005,1,2.03349878964528,0.288974645780399,1.444873228902,1.65109906066209 -"487",0.823445128044114,0.0147254667244852,0.553191021084785,0.989127177512273,0.589509262004867,0,2.56736040594614,0.661722564022057,3.30861282011028,0.0294509334489703 -"488",0.0856008238624781,0.972834980115294,0.673679692670703,0.012857488822192,0.748758517438546,0,-0.0852666488301861,0.292800411931239,1.4640020596562,1.94566996023059 -"489",0.474607880692929,0.703757863957435,0.575578829040751,0.753026976017281,0.116434069583192,1,4.8413495226916,0.487303940346465,2.43651970173232,1.40751572791487 -"490",0.253442019224167,0.806546244071797,0.510510339401662,0.183461314300075,0.47959333169274,1,2.61506610839094,0.376721009612083,1.88360504806042,1.61309248814359 -"491",0.0185105616692454,0.742260188097134,0.0356400373857468,0.526187957031652,0.727970489067957,0,-0.162495938504009,0.259255280834623,1.29627640417311,1.48452037619427 -"492",0.0855640657246113,0.429966174298897,0.92288321396336,0.922729240963235,0.834829294821247,1,1.89971563695527,0.292782032862306,1.46391016431153,0.859932348597795 -"493",0.773769852239639,0.55362459924072,0.634302911348641,0.0934126910287887,0.846234905067831,1,3.63106850650034,0.636884926119819,3.1844246305991,1.10724919848144 -"494",0.0781271818559617,0.77398944273591,0.138777965679765,0.285891451174393,0.307923682266846,0,2.55592070899088,0.289063590927981,1.4453179546399,1.54797888547182 -"495",0.257751697441563,0.920329430606216,0.0182793952990323,0.839436732232571,0.501120079075918,1,3.48496747505199,0.378875848720782,1.89437924360391,1.84065886121243 -"496",0.786739620612934,0.873974101385102,0.140527355019003,0.0840903467033058,0.165201488882303,1,4.22381654763733,0.643369810306467,3.21684905153234,1.7479482027702 -"497",0.0302468098234385,0.259409223916009,0.549596849363297,0.960368992527947,0.501507053151727,0,2.20329556642712,0.265123404911719,1.3256170245586,0.518818447832018 -"498",0.273386060493067,0.25689690746367,0.253114866791293,0.108502205926925,0.508718153461814,0,0.662289291326436,0.386693030246533,1.93346515123267,0.51379381492734 -"499",0.52165145217441,0.420817446894944,0.408981977496296,0.0245251718442887,0.540547132724896,0,1.5506112079695,0.510825726087205,2.55412863043603,0.841634893789887 -"500",0.754199668066576,0.78294126666151,0.486293388996273,0.717724270420149,0.751101769274101,1,4.77875574747874,0.627099834033288,3.13549917016644,1.56588253332302 diff --git a/demo/debug/causal_inference.py b/demo/debug/causal_inference.py deleted file mode 100644 index 10e2f58..0000000 --- a/demo/debug/causal_inference.py +++ /dev/null @@ -1,105 +0,0 @@ -# Load necessary libraries -import numpy as np -import pandas as pd -import seaborn as sns -import matplotlib.pyplot as plt -from stochtree import BCFModel -from sklearn.model_selection import train_test_split - -# # Generate sample data -# # RNG -# random_seed = 101 -# rng = np.random.default_rng(random_seed) - -# # Generate covariates and basis -# n = 1000 -# p_X = 5 -# X = rng.uniform(0, 1, (n, p_X)) -# pi_X = 0.25 + 0.5*X[:,0] -# Z = rng.binomial(1, pi_X, n).astype(float) - -# # Define the outcome mean functions (prognostic and treatment effects) -# mu_X = pi_X*5 -# # tau_X = np.sin(X[:,1]*2*np.pi) -# tau_X = X[:,1]*2 - -# # Generate outcome -# epsilon = rng.normal(0, 1, n) -# y = mu_X + tau_X*Z + epsilon - -# # Test-train split -# sample_inds = np.arange(n) -# train_inds, test_inds = train_test_split(sample_inds, test_size=0.5) -# X_train = X[train_inds,:] -# X_test = X[test_inds,:] -# Z_train = Z[train_inds] -# Z_test = Z[test_inds] -# y_train = y[train_inds] -# y_test = y[test_inds] -# pi_train = pi_X[train_inds] -# pi_test = pi_X[test_inds] -# mu_train = mu_X[train_inds] -# mu_test = mu_X[test_inds] -# tau_train = tau_X[train_inds] -# tau_test = tau_X[test_inds] - -# Load data from CSV -train_df = pd.read_csv("demo/data/python_r_debug_train.csv") -test_df = pd.read_csv("demo/data/python_r_debug_test.csv") - -# Unpack into numpy -X_train = train_df.loc[:,["X1","X2","X3","X4","X5"]].to_numpy() -X_test = test_df.loc[:,["X1","X2","X3","X4","X5"]].to_numpy() -Z_train = np.squeeze(train_df.loc[:,["Z"]].to_numpy()) -Z_test = np.squeeze(test_df.loc[:,["Z"]].to_numpy()) -y_train = np.squeeze(train_df.loc[:,["y"]].to_numpy()) -y_test = np.squeeze(test_df.loc[:,["y"]].to_numpy()) -pi_train = np.squeeze(train_df.loc[:,["pi"]].to_numpy()) -pi_test = np.squeeze(test_df.loc[:,["pi"]].to_numpy()) -mu_train = np.squeeze(train_df.loc[:,["mu"]].to_numpy()) -mu_test = np.squeeze(test_df.loc[:,["mu"]].to_numpy()) -tau_train = np.squeeze(train_df.loc[:,["tau"]].to_numpy()) -tau_test = np.squeeze(test_df.loc[:,["tau"]].to_numpy()) - -# Run BCF -bcf_model = BCFModel() -bcf_model.sample(X_train, Z_train, y_train, pi_train, X_test, Z_test, pi_test, num_gfr=10, num_mcmc=100) - -# Inspect the MCMC (BART) samples -forest_preds_y_mcmc = bcf_model.y_hat_test[:,bcf_model.num_gfr:] -y_avg_mcmc = np.squeeze(forest_preds_y_mcmc).mean(axis = 1, keepdims = True) -y_df_mcmc = pd.DataFrame(np.concatenate((np.expand_dims(y_test,1), y_avg_mcmc), axis = 1), columns=["True outcome", "Average estimated outcome"]) -sns.scatterplot(data=y_df_mcmc, x="Average estimated outcome", y="True outcome") -plt.axline((0, 0), slope=1, color="black", linestyle=(0, (3,3))) -plt.show() - -forest_preds_tau_mcmc = bcf_model.tau_hat_test[:,bcf_model.num_gfr:] -tau_avg_mcmc = np.squeeze(forest_preds_tau_mcmc).mean(axis = 1, keepdims = True) -tau_df_mcmc = pd.DataFrame(np.concatenate((np.expand_dims(tau_test,1), tau_avg_mcmc), axis = 1), columns=["True tau", "Average estimated tau"]) -sns.scatterplot(data=tau_df_mcmc, x="Average estimated tau", y="True tau") -plt.axline((0, 0), slope=1, color="black", linestyle=(0, (3,3))) -plt.show() - -forest_preds_mu_mcmc = bcf_model.mu_hat_test[:,bcf_model.num_gfr:] -mu_avg_mcmc = np.squeeze(forest_preds_mu_mcmc).mean(axis = 1, keepdims = True) -mu_df_mcmc = pd.DataFrame(np.concatenate((np.expand_dims(mu_test,1), mu_avg_mcmc), axis = 1), columns=["True mu", "Average estimated mu"]) -sns.scatterplot(data=mu_df_mcmc, x="Average estimated mu", y="True mu") -plt.axline((0, 0), slope=1, color="black", linestyle=(0, (3,3))) -plt.show() - -# sigma_df_mcmc = pd.DataFrame(np.concatenate((np.expand_dims(np.arange(bcf_model.num_samples - bcf_model.num_gfr),axis=1), np.expand_dims(bcf_model.global_var_samples[bcf_model.num_gfr:],axis=1)), axis = 1), columns=["Sample", "Sigma"]) -# sns.scatterplot(data=sigma_df_mcmc, x="Sample", y="Sigma") -# plt.show() - -# b_df_mcmc = pd.DataFrame(np.concatenate((np.expand_dims(np.arange(bcf_model.num_samples - bcf_model.num_gfr),axis=1), np.expand_dims(bcf_model.b0_samples[bcf_model.num_gfr:],axis=1), np.expand_dims(bcf_model.b1_samples[bcf_model.num_gfr:],axis=1)), axis = 1), columns=["Sample", "Beta_0", "Beta_1"]) -# sns.scatterplot(data=b_df_mcmc, x="Sample", y="Beta_0") -# sns.scatterplot(data=b_df_mcmc, x="Sample", y="Beta_1") -# plt.show() - -# Compute RMSEs -y_rmse = np.sqrt(np.mean(np.power(np.expand_dims(y_test,1) - y_avg_mcmc, 2))) -tau_rmse = np.sqrt(np.mean(np.power(np.expand_dims(tau_test,1) - tau_avg_mcmc, 2))) -mu_rmse = np.sqrt(np.mean(np.power(np.expand_dims(mu_test,1) - mu_avg_mcmc, 2))) -print("y hat RMSE: {:.2f}".format(y_rmse)) -print("tau hat RMSE: {:.2f}".format(tau_rmse)) -print("mu hat RMSE: {:.2f}".format(mu_rmse)) diff --git a/demo/debug/supervised_learning.py b/demo/debug/supervised_learning.py deleted file mode 100644 index ebff227..0000000 --- a/demo/debug/supervised_learning.py +++ /dev/null @@ -1,118 +0,0 @@ -# Supervised Learning Demo Script - -# Load necessary libraries -import numpy as np -import pandas as pd -import seaborn as sns -import matplotlib.pyplot as plt -from stochtree import BARTModel -from sklearn.model_selection import train_test_split - -# Generate sample data -# RNG -random_seed = 1234 -rng = np.random.default_rng(random_seed) - -# Generate covariates and basis -n = 1000 -p_X = 10 -p_W = 1 -X = rng.uniform(0, 1, (n, p_X)) -W = rng.uniform(0, 1, (n, p_W)) - -# Define the outcome mean function -def outcome_mean(X, W): - return np.where( - (X[:,0] >= 0.0) & (X[:,0] < 0.25), -7.5 * W[:,0], - np.where( - (X[:,0] >= 0.25) & (X[:,0] < 0.5), -2.5 * W[:,0], - np.where( - (X[:,0] >= 0.5) & (X[:,0] < 0.75), 2.5 * W[:,0], - 7.5 * W[:,0] - ) - ) - ) - -# Generate outcome -epsilon = rng.normal(0, 1, n) -y = outcome_mean(X, W) + epsilon - -# Standardize outcome -y_bar = np.mean(y) -y_std = np.std(y) -resid = (y-y_bar)/y_std - -# Test-train split -sample_inds = np.arange(n) -train_inds, test_inds = train_test_split(sample_inds, test_size=0.5) -X_train = X[train_inds,:] -X_test = X[test_inds,:] -basis_train = W[train_inds,:] -basis_test = W[test_inds,:] -y_train = y[train_inds] -y_test = y[test_inds] - -## Demo 1: Using `W` in a linear leaf regression - -# Run BART -bart_model = BARTModel() -bart_model.sample(X_train=X_train, y_train=y_train, basis_train=basis_train, X_test=X_test, basis_test=basis_test, num_gfr=10, num_mcmc=100) - -# Inspect the MCMC (BART) samples -forest_preds_y_mcmc = bart_model.y_hat_test[:,bart_model.num_gfr:] -y_avg_mcmc = np.squeeze(forest_preds_y_mcmc).mean(axis = 1, keepdims = True) -y_df_mcmc = pd.DataFrame(np.concatenate((np.expand_dims(y_test,1), y_avg_mcmc), axis = 1), columns=["True outcome", "Average estimated outcome"]) -sns.scatterplot(data=y_df_mcmc, x="Average estimated outcome", y="True outcome") -plt.axline((0, 0), slope=1, color="black", linestyle=(0, (3,3))) -plt.show() - -sigma_df_mcmc = pd.DataFrame(np.concatenate((np.expand_dims(np.arange(bart_model.num_samples - bart_model.num_gfr),axis=1), np.expand_dims(bart_model.global_var_samples[bart_model.num_gfr:],axis=1)), axis = 1), columns=["Sample", "Sigma"]) -sns.scatterplot(data=sigma_df_mcmc, x="Sample", y="Sigma") -plt.show() - -# Compute the test set RMSE -np.sqrt(np.mean(np.power(y_test - np.squeeze(y_avg_mcmc),2))) - -## Demo 2: Including `W` as a covariate in the standard "constant leaf" BART model - -# Run BART -bart_model = BARTModel() -X_train_aug = np.c_[X_train, basis_train] -X_test_aug = np.c_[X_test, basis_test] -bart_model.sample(X_train=X_train_aug, y_train=y_train, X_test=X_test_aug, num_gfr=10, num_mcmc=100) - -# Inspect the MCMC (BART) samples -forest_preds_y_mcmc = bart_model.y_hat_test[:,bart_model.num_gfr:] -y_avg_mcmc = np.squeeze(forest_preds_y_mcmc).mean(axis = 1, keepdims = True) -y_df_mcmc = pd.DataFrame(np.concatenate((np.expand_dims(y_test,1), y_avg_mcmc), axis = 1), columns=["True outcome", "Average estimated outcome"]) -sns.scatterplot(data=y_df_mcmc, x="Average estimated outcome", y="True outcome") -plt.axline((0, 0), slope=1, color="black", linestyle=(0, (3,3))) -plt.show() - -sigma_df_mcmc = pd.DataFrame(np.concatenate((np.expand_dims(np.arange(bart_model.num_samples - bart_model.num_gfr),axis=1), np.expand_dims(bart_model.global_var_samples[bart_model.num_gfr:],axis=1)), axis = 1), columns=["Sample", "Sigma"]) -sns.scatterplot(data=sigma_df_mcmc, x="Sample", y="Sigma") -plt.show() - -# Compute the test set RMSE -np.sqrt(np.mean(np.power(y_test - np.squeeze(y_avg_mcmc),2))) - -## Demo 3: Omitting `W` entirely - -# Run BART -bart_model = BARTModel() -bart_model.sample(X_train=X_train, y_train=y_train, X_test=X_test, num_gfr=10, num_mcmc=100) - -# Inspect the MCMC (BART) samples -forest_preds_y_mcmc = bart_model.y_hat_test[:,bart_model.num_gfr:] -y_avg_mcmc = np.squeeze(forest_preds_y_mcmc).mean(axis = 1, keepdims = True) -y_df_mcmc = pd.DataFrame(np.concatenate((np.expand_dims(y_test,1), y_avg_mcmc), axis = 1), columns=["True outcome", "Average estimated outcome"]) -sns.scatterplot(data=y_df_mcmc, x="Average estimated outcome", y="True outcome") -plt.axline((0, 0), slope=1, color="black", linestyle=(0, (3,3))) -plt.show() - -sigma_df_mcmc = pd.DataFrame(np.concatenate((np.expand_dims(np.arange(bart_model.num_samples - bart_model.num_gfr),axis=1), np.expand_dims(bart_model.global_var_samples[bart_model.num_gfr:],axis=1)), axis = 1), columns=["Sample", "Sigma"]) -sns.scatterplot(data=sigma_df_mcmc, x="Sample", y="Sigma") -plt.show() - -# Compute the test set RMSE -np.sqrt(np.mean(np.power(y_test - np.squeeze(y_avg_mcmc),2))) diff --git a/demo/notebooks/causal_inference.ipynb b/demo/notebooks/causal_inference.ipynb deleted file mode 100644 index 209cd4a..0000000 --- a/demo/notebooks/causal_inference.ipynb +++ /dev/null @@ -1,205 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Causal Inference Demo Notebook" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Load necessary libraries" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "import numpy as np\n", - "import pandas as pd\n", - "import seaborn as sns\n", - "import matplotlib.pyplot as plt\n", - "from stochtree import BCFModel\n", - "from sklearn.model_selection import train_test_split" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Generate sample data" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# RNG\n", - "random_seed = 101\n", - "rng = np.random.default_rng(random_seed)\n", - "\n", - "# Generate covariates and basis\n", - "n = 1000\n", - "p_X = 5\n", - "X = rng.uniform(0, 1, (n, p_X))\n", - "pi_X = 0.25 + 0.5*X[:,0]\n", - "Z = rng.binomial(1, pi_X, n).astype(float)\n", - "\n", - "# Define the outcome mean functions (prognostic and treatment effects)\n", - "mu_X = pi_X*5\n", - "# tau_X = np.sin(X[:,1]*2*np.pi)\n", - "tau_X = X[:,1]*2\n", - "\n", - "# Generate outcome\n", - "epsilon = rng.normal(0, 1, n)\n", - "y = mu_X + tau_X*Z + epsilon" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Test-train split" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "sample_inds = np.arange(n)\n", - "train_inds, test_inds = train_test_split(sample_inds, test_size=0.5)\n", - "X_train = X[train_inds,:]\n", - "X_test = X[test_inds,:]\n", - "Z_train = Z[train_inds]\n", - "Z_test = Z[test_inds]\n", - "y_train = y[train_inds]\n", - "y_test = y[test_inds]\n", - "pi_train = pi_X[train_inds]\n", - "pi_test = pi_X[test_inds]\n", - "mu_train = mu_X[train_inds]\n", - "mu_test = mu_X[test_inds]\n", - "tau_train = tau_X[train_inds]\n", - "tau_test = tau_X[test_inds]" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Run BCF" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "bcf_model = BCFModel()\n", - "bcf_model.sample(X_train, Z_train, y_train, pi_train, X_test, Z_test, pi_test, num_gfr=10, num_mcmc=1000)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Inspect the MCMC (BART) samples" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "forest_preds_y_mcmc = bcf_model.y_hat_test[:,bcf_model.num_gfr:]\n", - "y_avg_mcmc = np.squeeze(forest_preds_y_mcmc).mean(axis = 1, keepdims = True)\n", - "y_df_mcmc = pd.DataFrame(np.concatenate((np.expand_dims(y_test,1), y_avg_mcmc), axis = 1), columns=[\"True outcome\", \"Average estimated outcome\"])\n", - "sns.scatterplot(data=y_df_mcmc, x=\"Average estimated outcome\", y=\"True outcome\")\n", - "plt.axline((0, 0), slope=1, color=\"black\", linestyle=(0, (3,3)))\n", - "plt.show()" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "forest_preds_tau_mcmc = bcf_model.tau_hat_test[:,bcf_model.num_gfr:]\n", - "tau_avg_mcmc = np.squeeze(forest_preds_tau_mcmc).mean(axis = 1, keepdims = True)\n", - "tau_df_mcmc = pd.DataFrame(np.concatenate((np.expand_dims(tau_test,1), tau_avg_mcmc), axis = 1), columns=[\"True tau\", \"Average estimated tau\"])\n", - "sns.scatterplot(data=tau_df_mcmc, x=\"True tau\", y=\"Average estimated tau\")\n", - "plt.axline((0, 0), slope=1, color=\"black\", linestyle=(0, (3,3)))\n", - "plt.show()" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "forest_preds_mu_mcmc = bcf_model.mu_hat_test[:,bcf_model.num_gfr:]\n", - "mu_avg_mcmc = np.squeeze(forest_preds_mu_mcmc).mean(axis = 1, keepdims = True)\n", - "mu_df_mcmc = pd.DataFrame(np.concatenate((np.expand_dims(mu_test,1), mu_avg_mcmc), axis = 1), columns=[\"True mu\", \"Average estimated mu\"])\n", - "sns.scatterplot(data=mu_df_mcmc, x=\"True mu\", y=\"Average estimated mu\")\n", - "plt.axline((0, 0), slope=1, color=\"black\", linestyle=(0, (3,3)))\n", - "plt.show()" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "sigma_df_mcmc = pd.DataFrame(np.concatenate((np.expand_dims(np.arange(bcf_model.num_samples - bcf_model.num_gfr),axis=1), np.expand_dims(bcf_model.global_var_samples[bcf_model.num_gfr:],axis=1)), axis = 1), columns=[\"Sample\", \"Sigma\"])\n", - "sns.scatterplot(data=sigma_df_mcmc, x=\"Sample\", y=\"Sigma\")\n", - "plt.show()" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "b_df_mcmc = pd.DataFrame(np.concatenate((np.expand_dims(np.arange(bcf_model.num_samples - bcf_model.num_gfr),axis=1), np.expand_dims(bcf_model.b0_samples[bcf_model.num_gfr:],axis=1), np.expand_dims(bcf_model.b1_samples[bcf_model.num_gfr:],axis=1)), axis = 1), columns=[\"Sample\", \"Beta_0\", \"Beta_1\"])\n", - "sns.scatterplot(data=b_df_mcmc, x=\"Sample\", y=\"Beta_0\")\n", - "sns.scatterplot(data=b_df_mcmc, x=\"Sample\", y=\"Beta_1\")\n", - "plt.show()" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "stochtree-dev", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.10.14" - } - }, - "nbformat": 4, - "nbformat_minor": 2 -} diff --git a/demo/notebooks/prototype_interface.ipynb b/demo/notebooks/prototype_interface.ipynb deleted file mode 100644 index 64d1980..0000000 --- a/demo/notebooks/prototype_interface.ipynb +++ /dev/null @@ -1,788 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Demo of the `StochTree` Prototype Interface" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "While the functions `bart()` and `bcf()` provide simple and performant \n", - "interfaces for supervised learning / causal inference, `stochtree` also \n", - "offers access to many of the \"low-level\" data structures that are typically \n", - "implemented in C++.\n", - "This low-level interface is not designed for performance or even\n", - "simplicity --- rather the intent is to provide a \"prototype\" interface\n", - "to the C++ code that doesn't require modifying any C++.\n", - "\n", - "To illustrate when such a prototype interface might be useful, consider\n", - "the classic BART algorithm:\n", - "\n", - "**INPUT**: $y$, $X$, $\\tau$, $\\nu$, $\\lambda$, $\\alpha$, $\\beta$\n", - "\n", - "**OUTPUT**: $m$ samples of a decision forest with $k$ trees and global variance parameter $\\sigma^2$\n", - "\n", - "Initialize $\\sigma^2$ via a default or a data-dependent calibration exercise\n", - "\n", - "Initialize \"forest 0\" with $k$ trees with a single root node, referring to tree $j$'s prediction vector as $f_{0,j}$\n", - "\n", - "Compute residual as $r = y - \\sum_{j=1}^k f_{0,j}$\n", - "\n", - "**FOR** $i$ **IN** $\\left\\{1,\\dots,m\\right\\}$:\n", - "\n", - " Initialize forest $i$ from forest $i-1$\n", - " \n", - " **FOR** $j$ **IN** $\\left\\{1,\\dots,k\\right\\}$:\n", - " \n", - " Add predictions for tree $j$ to residual: $r = r + f_{i,j}$ \n", - " \n", - " Update tree $j$ via Metropolis-Hastings with $r$ and $X$ as data and tree priors depending on ($\\tau$, $\\sigma^2$, $\\alpha$, $\\beta$)\n", - "\n", - " Sample leaf node parameters for tree $j$ via Gibbs (leaf node prior is $N\\left(0,\\tau\\right)$)\n", - " \n", - " Subtract (updated) predictions for tree $j$ from residual: $r = r - f_{i,j}$\n", - "\n", - " Sample $\\sigma^2$ via Gibbs (prior is $IG(\\nu/2,\\nu\\lambda/2)$)\n", - "\n", - "While the algorithm itself is conceptually simple, much of the core \n", - "computation is carried out in low-level languages such as C or C++ \n", - "because of the tree data structure. As a result, any changes to this \n", - "algorithm, such as supporting heteroskedasticity (@pratola2020heteroscedastic), \n", - "categorical outcomes (@murray2021log) or causal effect estimation (@hahn2020bayesian) \n", - "require modifying low-level code. \n", - "\n", - "The prototype interface exposes the core components of the \n", - "loop above at the R level, thus making it possible to interchange \n", - "C++ computation for steps like \"update tree $j$ via Metropolis-Hastings\" \n", - "with R computation for a custom variance model, other user-specified additive \n", - "mean model components, and so on." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Scenario 1: Supervised Learning" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Load necessary libraries" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "import numpy as np\n", - "import pandas as pd\n", - "import seaborn as sns\n", - "import matplotlib.pyplot as plt\n", - "from stochtree import Dataset, Residual, RNG, ForestSampler, ForestContainer, GlobalVarianceModel, LeafVarianceModel" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Generate sample data" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# RNG\n", - "random_seed = 1234\n", - "rng = np.random.default_rng(random_seed)\n", - "\n", - "# Generate covariates and basis\n", - "n = 1000\n", - "p_X = 10\n", - "p_W = 1\n", - "X = rng.uniform(0, 1, (n, p_X))\n", - "W = rng.uniform(0, 1, (n, p_W))\n", - "\n", - "# Define the outcome mean function\n", - "def outcome_mean(X, W):\n", - " return np.where(\n", - " (X[:,0] >= 0.0) & (X[:,0] < 0.25), -7.5 * W[:,0], \n", - " np.where(\n", - " (X[:,0] >= 0.25) & (X[:,0] < 0.5), -2.5 * W[:,0], \n", - " np.where(\n", - " (X[:,0] >= 0.5) & (X[:,0] < 0.75), 2.5 * W[:,0], \n", - " 7.5 * W[:,0]\n", - " )\n", - " )\n", - " )\n", - "\n", - "# Generate outcome\n", - "epsilon = rng.normal(0, 1, n)\n", - "y = outcome_mean(X, W) + epsilon\n", - "\n", - "# Standardize outcome\n", - "y_bar = np.mean(y)\n", - "y_std = np.std(y)\n", - "resid = (y-y_bar)/y_std" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Set some sampling parameters" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "alpha = 0.9\n", - "beta = 1.25\n", - "min_samples_leaf = 1\n", - "num_trees = 100\n", - "cutpoint_grid_size = 100\n", - "global_variance_init = 1.\n", - "tau_init = 0.5\n", - "leaf_prior_scale = np.array([[tau_init]], order='C')\n", - "nu = 4.\n", - "lamb = 0.5\n", - "a_leaf = 2.\n", - "b_leaf = 0.5\n", - "leaf_regression = True\n", - "feature_types = np.repeat(0, p_X).astype(int) # 0 = numeric\n", - "var_weights = np.repeat(1/p_X, p_X)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Convert data from numpy to `StochTree` representation" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# Dataset (covariates and basis)\n", - "dataset = Dataset()\n", - "dataset.add_covariates(X)\n", - "dataset.add_basis(W)\n", - "\n", - "# Residual\n", - "residual = Residual(resid)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Initialize tracking and sampling classes" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "forest_container = ForestContainer(num_trees, W.shape[1], False)\n", - "forest_sampler = ForestSampler(dataset, feature_types, num_trees, n, alpha, beta, min_samples_leaf)\n", - "cpp_rng = RNG(random_seed)\n", - "global_var_model = GlobalVarianceModel()\n", - "leaf_var_model = LeafVarianceModel()" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Prepare to run the sampler" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "num_warmstart = 10\n", - "num_mcmc = 100\n", - "num_samples = num_warmstart + num_mcmc\n", - "global_var_samples = np.concatenate((np.array([global_variance_init]), np.repeat(0, num_samples)))\n", - "leaf_scale_samples = np.concatenate((np.array([tau_init]), np.repeat(0, num_samples)))" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Run the \"grow-from-root\" (XBART) sampler" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "for i in range(num_warmstart):\n", - " forest_sampler.sample_one_iteration(forest_container, dataset, residual, cpp_rng, feature_types, cutpoint_grid_size, leaf_prior_scale, var_weights, global_var_samples[i], 1, True, False)\n", - " global_var_samples[i+1] = global_var_model.sample_one_iteration(residual, cpp_rng, nu, lamb)\n", - " leaf_scale_samples[i+1] = leaf_var_model.sample_one_iteration(forest_container, cpp_rng, a_leaf, b_leaf, i)\n", - " leaf_prior_scale[0,0] = leaf_scale_samples[i+1]" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Run the MCMC (BART) sampler, initialized at the last XBART sample" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "for i in range(num_warmstart, num_samples):\n", - " forest_sampler.sample_one_iteration(forest_container, dataset, residual, cpp_rng, feature_types, cutpoint_grid_size, leaf_prior_scale, var_weights, global_var_samples[i], 1, False, False)\n", - " global_var_samples[i+1] = global_var_model.sample_one_iteration(residual, cpp_rng, nu, lamb)\n", - " leaf_scale_samples[i+1] = leaf_var_model.sample_one_iteration(forest_container, cpp_rng, a_leaf, b_leaf, i)\n", - " leaf_prior_scale[0,0] = leaf_scale_samples[i+1]" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Extract mean function and error variance posterior samples" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# Forest predictions\n", - "forest_preds = forest_container.predict(dataset)*y_std + y_bar\n", - "forest_preds_gfr = forest_preds[:,:num_warmstart]\n", - "forest_preds_mcmc = forest_preds[:,num_warmstart:num_samples]\n", - "\n", - "# Global error variance\n", - "sigma_samples = np.sqrt(global_var_samples)*y_std\n", - "sigma_samples_gfr = sigma_samples[:num_warmstart]\n", - "sigma_samples_mcmc = sigma_samples[num_warmstart:num_samples]" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Inspect the GFR (XBART) samples" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "forest_pred_avg_gfr = forest_preds_gfr.mean(axis = 1, keepdims = True)\n", - "forest_pred_df_gfr = pd.DataFrame(np.concatenate((np.expand_dims(y, axis=1), forest_pred_avg_gfr), axis = 1), columns=[\"True y\", \"Average predicted y\"])\n", - "sns.scatterplot(data=forest_pred_df_gfr, x=\"True y\", y=\"Average predicted y\")\n", - "plt.axline((0, 0), slope=1, color=\"black\", linestyle=(0, (3,3)))\n", - "plt.show()" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "sigma_df_gfr = pd.DataFrame(np.concatenate((np.expand_dims(np.arange(num_warmstart),axis=1), np.expand_dims(sigma_samples_gfr,axis=1)), axis = 1), columns=[\"Sample\", \"Sigma\"])\n", - "sns.scatterplot(data=sigma_df_gfr, x=\"Sample\", y=\"Sigma\")\n", - "plt.show()" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Inspect the MCMC (BART) samples" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "forest_pred_avg_mcmc = forest_preds_mcmc.mean(axis = 1, keepdims = True)\n", - "forest_pred_df_mcmc = pd.DataFrame(np.concatenate((np.expand_dims(y, axis=1), forest_pred_avg_mcmc), axis = 1), columns=[\"True y\", \"Average predicted y\"])\n", - "sns.scatterplot(data=forest_pred_df_mcmc, x=\"True y\", y=\"Average predicted y\")\n", - "plt.axline((0, 0), slope=1, color=\"black\", linestyle=(0, (3,3)))\n", - "plt.show()" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "sigma_df_mcmc = pd.DataFrame(np.concatenate((np.expand_dims(np.arange(num_samples - num_warmstart),axis=1), np.expand_dims(sigma_samples_mcmc,axis=1)), axis = 1), columns=[\"Sample\", \"Sigma\"])\n", - "sns.scatterplot(data=sigma_df_mcmc, x=\"Sample\", y=\"Sigma\")\n", - "plt.show()" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Scenario 2: Causal Inference" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Generate sample data" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# RNG\n", - "random_seed = 101\n", - "rng = np.random.default_rng(random_seed)\n", - "\n", - "# Generate covariates and basis\n", - "n = 1000\n", - "p_X = 5\n", - "X = rng.uniform(0, 1, (n, p_X))\n", - "pi_X = 0.25 + 0.5*X[:,0]\n", - "Z = rng.binomial(1, pi_X, n).astype(float)\n", - "\n", - "# Define the outcome mean functions (prognostic and treatment effects)\n", - "mu_X = pi_X*5\n", - "# tau_X = np.sin(X[:,1]*2*np.pi)\n", - "tau_X = X[:,1]*2\n", - "\n", - "# Generate outcome\n", - "epsilon = rng.normal(0, 1, n)\n", - "y = mu_X + tau_X*Z + epsilon\n", - "\n", - "# Standardize outcome\n", - "y_bar = np.mean(y)\n", - "y_std = np.std(y)\n", - "resid = (y-y_bar)/y_std" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Set some sampling parameters" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# Prognostic forest parameters\n", - "alpha_mu = 0.95\n", - "beta_mu = 2.0\n", - "min_samples_leaf_mu = 1\n", - "num_trees_mu = 200\n", - "cutpoint_grid_size_mu = 100\n", - "tau_init_mu = 1/200\n", - "leaf_prior_scale_mu = np.array([[tau_init_mu]], order='C')\n", - "a_leaf_mu = 3.\n", - "b_leaf_mu = 1/200\n", - "leaf_regression_mu = False\n", - "feature_types_mu = np.repeat(0, p_X).astype(int) # 0 = numeric\n", - "var_weights_mu = np.repeat(1/(p_X + 1), p_X + 1)\n", - "\n", - "# Treatment forest parameters\n", - "alpha_tau = 0.25\n", - "beta_tau = 3.\n", - "min_samples_leaf_tau = 1\n", - "num_trees_tau = 50\n", - "cutpoint_grid_size_tau = 100\n", - "tau_init_tau = 1/50\n", - "leaf_prior_scale_tau = np.array([[tau_init_tau]], order='C')\n", - "a_leaf_tau = 3.\n", - "b_leaf_tau = 1/50\n", - "leaf_regression_tau = True\n", - "feature_types_tau = np.repeat(0, p_X).astype(int) # 0 = numeric\n", - "var_weights_tau = np.repeat(1/p_X, p_X)\n", - "\n", - "# Global parameters\n", - "nu = 2.\n", - "lamb = 0.5\n", - "global_variance_init = 1." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Convert data from numpy to `StochTree` representation" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# Prognostic Forest Dataset (covariates)\n", - "dataset_mu = Dataset()\n", - "dataset_mu.add_covariates(np.c_[X,pi_X])\n", - "\n", - "# Treatment Forest Dataset (covariates and treatment variable)\n", - "dataset_tau = Dataset()\n", - "dataset_tau.add_covariates(X)\n", - "dataset_tau.add_basis(Z)\n", - "\n", - "# Residual\n", - "residual = Residual(resid)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Initialize tracking and sampling classes" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# Prognostic forest sampling classes\n", - "forest_container_mu = ForestContainer(num_trees_mu, 1, True)\n", - "forest_sampler_mu = ForestSampler(dataset_mu, feature_types_mu, num_trees_mu, n, alpha_mu, beta_mu, min_samples_leaf_mu)\n", - "leaf_var_model_mu = LeafVarianceModel()\n", - "\n", - "# Treatment forest sampling classes\n", - "forest_container_tau = ForestContainer(num_trees_tau, 1 if np.ndim(Z) == 1 else Z.shape[1], False)\n", - "forest_sampler_tau = ForestSampler(dataset_tau, feature_types_tau, num_trees_tau, n, alpha_tau, beta_tau, min_samples_leaf_tau)\n", - "leaf_var_model_tau = LeafVarianceModel()\n", - "\n", - "# Global classes\n", - "cpp_rng = RNG(random_seed)\n", - "global_var_model = GlobalVarianceModel()" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Prepare to run the sampler" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "num_warmstart = 10\n", - "num_mcmc = 500\n", - "num_samples = num_warmstart + num_mcmc\n", - "global_var_samples = np.concatenate((np.array([global_variance_init]), np.repeat(0, num_samples)))\n", - "leaf_scale_samples_mu = np.concatenate((np.array([tau_init_mu]), np.repeat(0, num_samples)))\n", - "leaf_scale_samples_tau = np.concatenate((np.array([tau_init_tau]), np.repeat(0, num_samples)))\n", - "leaf_prior_scale_mu = np.array([[tau_init_mu]])\n", - "leaf_prior_scale_tau = np.array([[tau_init_tau]])\n", - "b_0_init = -0.5\n", - "b_1_init = 0.5\n", - "b_0_samples = np.concatenate((np.array([b_0_init]), np.repeat(0, num_samples)))\n", - "b_1_samples = np.concatenate((np.array([b_1_init]), np.repeat(0, num_samples)))\n", - "tau_basis = (1-Z)*b_0_init + Z*b_1_init\n", - "dataset_tau.update_basis(tau_basis)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Run the \"grow-from-root\" (XBART) sampler" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "for i in range(num_warmstart):\n", - " # Sample the prognostic forest\n", - " forest_sampler_mu.sample_one_iteration(forest_container_mu, dataset_mu, residual, cpp_rng, feature_types_mu, cutpoint_grid_size_mu, leaf_prior_scale_mu, var_weights_mu, global_var_samples[i], 0, True, False)\n", - " leaf_scale_samples_mu[i+1] = leaf_var_model_mu.sample_one_iteration(forest_container_mu, cpp_rng, a_leaf_mu, b_leaf_mu, i)\n", - " leaf_prior_scale_mu[0,0] = leaf_scale_samples_mu[i+1]\n", - " mu_x = forest_container_mu.predict_raw_single_forest(dataset_mu, i)\n", - "\n", - " # Sample the treatment effect forest\n", - " forest_sampler_tau.sample_one_iteration(forest_container_tau, dataset_tau, residual, cpp_rng, feature_types_tau, cutpoint_grid_size_tau, leaf_prior_scale_tau, var_weights_tau, global_var_samples[i], 1, True, False)\n", - " # leaf_scale_samples_tau[i+1] = leaf_var_model_tau.sample_one_iteration(forest_container_tau, cpp_rng, a_leaf_tau, b_leaf_tau, i)\n", - " # leaf_prior_scale_tau[0,0] = leaf_scale_samples_tau[i+1]\n", - " tau_x = np.squeeze(forest_container_tau.predict_raw_single_forest(dataset_tau, i))\n", - " s_tt0 = np.sum(tau_x*tau_x*(Z==0))\n", - " s_tt1 = np.sum(tau_x*tau_x*(Z==1))\n", - " partial_resid_mu = resid - np.squeeze(mu_x)\n", - " s_ty0 = np.sum(tau_x*partial_resid_mu*(Z==0))\n", - " s_ty1 = np.sum(tau_x*partial_resid_mu*(Z==1))\n", - " b_0_samples[i+1] = rng.normal(loc = (s_ty0/(s_tt0 + 2*global_var_samples[i])), scale = np.sqrt(global_var_samples[i]/(s_tt0 + 2*global_var_samples[i])), size = 1)\n", - " b_1_samples[i+1] = rng.normal(loc = (s_ty1/(s_tt1 + 2*global_var_samples[i])), scale = np.sqrt(global_var_samples[i]/(s_tt1 + 2*global_var_samples[i])), size = 1)\n", - " tau_basis = (1-Z)*b_0_samples[i+1] + Z*b_1_samples[i+1]\n", - " dataset_tau.update_basis(tau_basis)\n", - " \n", - " # Sample global variance\n", - " global_var_samples[i+1] = global_var_model.sample_one_iteration(residual, cpp_rng, nu, lamb)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Run the MCMC (BART) sampler, initialized at the last XBART sample" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "for i in range(num_warmstart, num_samples):\n", - " # Sample the prognostic forest\n", - " forest_sampler_mu.sample_one_iteration(forest_container_mu, dataset_mu, residual, cpp_rng, feature_types_mu, cutpoint_grid_size_mu, leaf_prior_scale_mu, var_weights_mu, global_var_samples[i], 0, False, False)\n", - " leaf_scale_samples_mu[i+1] = leaf_var_model_mu.sample_one_iteration(forest_container_mu, cpp_rng, a_leaf_mu, b_leaf_mu, i)\n", - " leaf_prior_scale_mu[0,0] = leaf_scale_samples_mu[i+1]\n", - " mu_x = forest_container_mu.predict_raw_single_forest(dataset_mu, i)\n", - "\n", - " # Sample the treatment effect forest\n", - " forest_sampler_tau.sample_one_iteration(forest_container_tau, dataset_tau, residual, cpp_rng, feature_types_tau, cutpoint_grid_size_tau, leaf_prior_scale_tau, var_weights_tau, global_var_samples[i], 1, False, False)\n", - " # leaf_scale_samples_tau[i+1] = leaf_var_model_tau.sample_one_iteration(forest_container_tau, cpp_rng, a_leaf_tau, b_leaf_tau, i)\n", - " # leaf_prior_scale_tau[0,0] = leaf_scale_samples_tau[i+1]\n", - " tau_x = np.squeeze(forest_container_tau.predict_raw_single_forest(dataset_tau, i))\n", - " s_tt0 = np.sum(tau_x*tau_x*(Z==0))\n", - " s_tt1 = np.sum(tau_x*tau_x*(Z==1))\n", - " partial_resid_mu = resid - np.squeeze(mu_x)\n", - " s_ty0 = np.sum(tau_x*partial_resid_mu*(Z==0))\n", - " s_ty1 = np.sum(tau_x*partial_resid_mu*(Z==1))\n", - " b_0_samples[i+1] = rng.normal(loc = (s_ty0/(s_tt0 + 2*global_var_samples[i])), scale = np.sqrt(global_var_samples[i]/(s_tt0 + 2*global_var_samples[i])), size = 1)\n", - " b_1_samples[i+1] = rng.normal(loc = (s_ty1/(s_tt1 + 2*global_var_samples[i])), scale = np.sqrt(global_var_samples[i]/(s_tt1 + 2*global_var_samples[i])), size = 1)\n", - " tau_basis = (1-Z)*b_0_samples[i+1] + Z*b_1_samples[i+1]\n", - " dataset_tau.update_basis(tau_basis)\n", - " \n", - " # Sample global variance\n", - " global_var_samples[i+1] = global_var_model.sample_one_iteration(residual, cpp_rng, nu, lamb)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "forest_container_tau.predict_raw(dataset_tau)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Extract mean function and error variance posterior samples" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# Forest predictions\n", - "forest_preds_mu = forest_container_mu.predict(dataset_mu)*y_std + y_bar\n", - "forest_preds_mu_gfr = forest_preds_mu[:,:num_warmstart]\n", - "forest_preds_mu_mcmc = forest_preds_mu[:,num_warmstart:num_samples]\n", - "treatment_coding_samples = (b_1_samples[1:] - b_0_samples[1:])\n", - "forest_preds_tau = (forest_container_tau.predict_raw(dataset_tau)*y_std*np.expand_dims(treatment_coding_samples, axis=(0,2)))\n", - "forest_preds_tau_gfr = forest_preds_tau[:,:num_warmstart]\n", - "forest_preds_tau_mcmc = forest_preds_tau[:,num_warmstart:num_samples]\n", - "\n", - "# Global error variance\n", - "sigma_samples = np.sqrt(global_var_samples)*y_std\n", - "sigma_samples_gfr = sigma_samples[:num_warmstart]\n", - "sigma_samples_mcmc = sigma_samples[num_warmstart:num_samples]\n", - "\n", - "# Adaptive coding parameters\n", - "b_1_samples_gfr = b_1_samples[1:(num_warmstart+1)]*y_std\n", - "b_0_samples_gfr = b_0_samples[1:(num_warmstart+1)]*y_std\n", - "b_1_samples_mcmc = b_1_samples[(num_warmstart+1):]*y_std\n", - "b_0_samples_mcmc = b_0_samples[(num_warmstart+1):]*y_std" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Inspect the GFR (XBART) samples" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "forest_preds_tau_avg_gfr = np.squeeze(forest_preds_tau_gfr).mean(axis = 1, keepdims = True)\n", - "forest_pred_tau_df_gfr = pd.DataFrame(np.concatenate((np.expand_dims(tau_X,1), forest_preds_tau_avg_gfr), axis = 1), columns=[\"True tau\", \"Average estimated tau\"])\n", - "sns.scatterplot(data=forest_pred_tau_df_gfr, x=\"True tau\", y=\"Average estimated tau\")\n", - "plt.axline((0, 0), slope=1, color=\"black\", linestyle=(0, (3,3)))\n", - "plt.show()" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "forest_pred_avg_gfr = np.squeeze(forest_preds_mu_gfr).mean(axis = 1, keepdims = True)\n", - "forest_pred_df_gfr = pd.DataFrame(np.concatenate((np.expand_dims(tau_X,1), forest_pred_avg_gfr), axis = 1), columns=[\"True mu\", \"Average estimated mu\"])\n", - "sns.scatterplot(data=forest_pred_df_gfr, x=\"True mu\", y=\"Average estimated mu\")\n", - "plt.axline((0, 0), slope=1, color=\"black\", linestyle=(0, (3,3)))\n", - "plt.show()" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "sigma_df_gfr = pd.DataFrame(np.concatenate((np.expand_dims(np.arange(num_warmstart),axis=1), np.expand_dims(sigma_samples_gfr,axis=1)), axis = 1), columns=[\"Sample\", \"Sigma\"])\n", - "sns.scatterplot(data=sigma_df_gfr, x=\"Sample\", y=\"Sigma\")\n", - "plt.show()" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "b_df_gfr = pd.DataFrame(np.concatenate((np.expand_dims(np.arange(num_warmstart),axis=1), np.expand_dims(b_0_samples_gfr,axis=1), np.expand_dims(b_1_samples_gfr,axis=1)), axis = 1), columns=[\"Sample\", \"Beta_0\", \"Beta_1\"])\n", - "sns.scatterplot(data=b_df_gfr, x=\"Sample\", y=\"Beta_0\")\n", - "sns.scatterplot(data=b_df_gfr, x=\"Sample\", y=\"Beta_1\")\n", - "plt.show()" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Inspect the MCMC (BART) samples" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "forest_pred_avg_mcmc = np.squeeze(forest_preds_tau_mcmc).mean(axis = 1, keepdims = True)\n", - "forest_pred_df_mcmc = pd.DataFrame(np.concatenate((np.expand_dims(tau_X,1), forest_pred_avg_mcmc), axis = 1), columns=[\"True tau\", \"Average estimated tau\"])\n", - "sns.scatterplot(data=forest_pred_df_mcmc, x=\"True tau\", y=\"Average estimated tau\")\n", - "plt.axline((0, 0), slope=1, color=\"black\", linestyle=(0, (3,3)))\n", - "plt.show()" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "forest_pred_avg_mcmc = np.squeeze(forest_preds_mu_mcmc).mean(axis = 1, keepdims = True)\n", - "forest_pred_df_mcmc = pd.DataFrame(np.concatenate((np.expand_dims(tau_X,1), forest_pred_avg_mcmc), axis = 1), columns=[\"True mu\", \"Average estimated mu\"])\n", - "sns.scatterplot(data=forest_pred_df_mcmc, x=\"True mu\", y=\"Average estimated mu\")\n", - "plt.axline((0, 0), slope=1, color=\"black\", linestyle=(0, (3,3)))\n", - "plt.show()" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "sigma_df_mcmc = pd.DataFrame(np.concatenate((np.expand_dims(np.arange(num_samples - num_warmstart),axis=1), np.expand_dims(sigma_samples_mcmc,axis=1)), axis = 1), columns=[\"Sample\", \"Sigma\"])\n", - "sns.scatterplot(data=sigma_df_mcmc, x=\"Sample\", y=\"Sigma\")\n", - "plt.show()" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "b_df_mcmc = pd.DataFrame(np.concatenate((np.expand_dims(np.arange(num_samples - num_warmstart),axis=1), np.expand_dims(b_0_samples_mcmc,axis=1), np.expand_dims(b_1_samples_mcmc,axis=1)), axis = 1), columns=[\"Sample\", \"Beta_0\", \"Beta_1\"])\n", - "sns.scatterplot(data=b_df_mcmc, x=\"Sample\", y=\"Beta_0\")\n", - "sns.scatterplot(data=b_df_mcmc, x=\"Sample\", y=\"Beta_1\")\n", - "plt.show()" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "stochtree-dev", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.10.14" - } - }, - "nbformat": 4, - "nbformat_minor": 2 -} diff --git a/demo/notebooks/supervised_learning.ipynb b/demo/notebooks/supervised_learning.ipynb deleted file mode 100644 index 227cedd..0000000 --- a/demo/notebooks/supervised_learning.ipynb +++ /dev/null @@ -1,341 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Supervised Learning Demo Notebook" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Load necessary libraries" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "import numpy as np\n", - "import pandas as pd\n", - "import seaborn as sns\n", - "import matplotlib.pyplot as plt\n", - "from stochtree import BARTModel\n", - "from sklearn.model_selection import train_test_split" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Generate sample data" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# RNG\n", - "random_seed = 1234\n", - "rng = np.random.default_rng(random_seed)\n", - "\n", - "# Generate covariates and basis\n", - "n = 1000\n", - "p_X = 10\n", - "p_W = 1\n", - "X = rng.uniform(0, 1, (n, p_X))\n", - "W = rng.uniform(0, 1, (n, p_W))\n", - "\n", - "# Define the outcome mean function\n", - "def outcome_mean(X, W):\n", - " return np.where(\n", - " (X[:,0] >= 0.0) & (X[:,0] < 0.25), -7.5 * W[:,0], \n", - " np.where(\n", - " (X[:,0] >= 0.25) & (X[:,0] < 0.5), -2.5 * W[:,0], \n", - " np.where(\n", - " (X[:,0] >= 0.5) & (X[:,0] < 0.75), 2.5 * W[:,0], \n", - " 7.5 * W[:,0]\n", - " )\n", - " )\n", - " )\n", - "\n", - "# Generate outcome\n", - "epsilon = rng.normal(0, 1, n)\n", - "y = outcome_mean(X, W) + epsilon\n", - "\n", - "# Standardize outcome\n", - "y_bar = np.mean(y)\n", - "y_std = np.std(y)\n", - "resid = (y-y_bar)/y_std" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Test-train split" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "sample_inds = np.arange(n)\n", - "train_inds, test_inds = train_test_split(sample_inds, test_size=0.5)\n", - "X_train = X[train_inds,:]\n", - "X_test = X[test_inds,:]\n", - "basis_train = W[train_inds,:]\n", - "basis_test = W[test_inds,:]\n", - "y_train = y[train_inds]\n", - "y_test = y[test_inds]" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Demo 1: Using `W` in a linear leaf regression" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Run BART" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "bart_model = BARTModel()\n", - "bart_model.sample(X_train=X_train, y_train=y_train, basis_train=basis_train, X_test=X_test, basis_test=basis_test, num_gfr=10, num_mcmc=100)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Inspect the MCMC (BART) samples" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "forest_preds_y_mcmc = bart_model.y_hat_test[:,bart_model.num_gfr:]\n", - "y_avg_mcmc = np.squeeze(forest_preds_y_mcmc).mean(axis = 1, keepdims = True)\n", - "y_df_mcmc = pd.DataFrame(np.concatenate((np.expand_dims(y_test,1), y_avg_mcmc), axis = 1), columns=[\"True outcome\", \"Average estimated outcome\"])\n", - "sns.scatterplot(data=y_df_mcmc, x=\"Average estimated outcome\", y=\"True outcome\")\n", - "plt.axline((0, 0), slope=1, color=\"black\", linestyle=(0, (3,3)))\n", - "plt.show()" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "sigma_df_mcmc = pd.DataFrame(np.concatenate((np.expand_dims(np.arange(bart_model.num_samples - bart_model.num_gfr),axis=1), np.expand_dims(bart_model.global_var_samples[bart_model.num_gfr:],axis=1)), axis = 1), columns=[\"Sample\", \"Sigma\"])\n", - "sns.scatterplot(data=sigma_df_mcmc, x=\"Sample\", y=\"Sigma\")\n", - "plt.show()" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Compute the test set RMSE" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "np.sqrt(np.mean(np.power(y_test - np.squeeze(y_avg_mcmc),2)))" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Demo 2: Including `W` as a covariate in the standard \"constant leaf\" BART model" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Run BART" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "bart_model = BARTModel()\n", - "X_train_aug = np.c_[X_train, basis_train]\n", - "X_test_aug = np.c_[X_test, basis_test]\n", - "bart_model.sample(X_train=X_train_aug, y_train=y_train, X_test=X_test_aug, num_gfr=10, num_mcmc=100)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Inspect the MCMC (BART) samples" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "forest_preds_y_mcmc = bart_model.y_hat_test[:,bart_model.num_gfr:]\n", - "y_avg_mcmc = np.squeeze(forest_preds_y_mcmc).mean(axis = 1, keepdims = True)\n", - "y_df_mcmc = pd.DataFrame(np.concatenate((np.expand_dims(y_test,1), y_avg_mcmc), axis = 1), columns=[\"True outcome\", \"Average estimated outcome\"])\n", - "sns.scatterplot(data=y_df_mcmc, x=\"Average estimated outcome\", y=\"True outcome\")\n", - "plt.axline((0, 0), slope=1, color=\"black\", linestyle=(0, (3,3)))\n", - "plt.show()" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "sigma_df_mcmc = pd.DataFrame(np.concatenate((np.expand_dims(np.arange(bart_model.num_samples - bart_model.num_gfr),axis=1), np.expand_dims(bart_model.global_var_samples[bart_model.num_gfr:],axis=1)), axis = 1), columns=[\"Sample\", \"Sigma\"])\n", - "sns.scatterplot(data=sigma_df_mcmc, x=\"Sample\", y=\"Sigma\")\n", - "plt.show()" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Compute the test set RMSE" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "np.sqrt(np.mean(np.power(y_test - np.squeeze(y_avg_mcmc),2)))" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Demo 3: Omitting `W` entirely" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Run BART" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "bart_model = BARTModel()\n", - "bart_model.sample(X_train=X_train, y_train=y_train, X_test=X_test, num_gfr=10, num_mcmc=100)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Inspect the MCMC (BART) samples" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "forest_preds_y_mcmc = bart_model.y_hat_test[:,bart_model.num_gfr:]\n", - "y_avg_mcmc = np.squeeze(forest_preds_y_mcmc).mean(axis = 1, keepdims = True)\n", - "y_df_mcmc = pd.DataFrame(np.concatenate((np.expand_dims(y_test,1), y_avg_mcmc), axis = 1), columns=[\"True outcome\", \"Average estimated outcome\"])\n", - "sns.scatterplot(data=y_df_mcmc, x=\"Average estimated outcome\", y=\"True outcome\")\n", - "plt.axline((0, 0), slope=1, color=\"black\", linestyle=(0, (3,3)))\n", - "plt.show()" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "sigma_df_mcmc = pd.DataFrame(np.concatenate((np.expand_dims(np.arange(bart_model.num_samples - bart_model.num_gfr),axis=1), np.expand_dims(bart_model.global_var_samples[bart_model.num_gfr:],axis=1)), axis = 1), columns=[\"Sample\", \"Sigma\"])\n", - "sns.scatterplot(data=sigma_df_mcmc, x=\"Sample\", y=\"Sigma\")\n", - "plt.show()" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Compute the test set RMSE" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "np.sqrt(np.mean(np.power(y_test - np.squeeze(y_avg_mcmc),2)))" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "stochtree-dev", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.10.14" - } - }, - "nbformat": 4, - "nbformat_minor": 2 -} diff --git a/docs/Makefile b/docs/Makefile deleted file mode 100644 index d0c3cbf..0000000 --- a/docs/Makefile +++ /dev/null @@ -1,20 +0,0 @@ -# Minimal makefile for Sphinx documentation -# - -# You can set these variables from the command line, and also -# from the environment for the first two. -SPHINXOPTS ?= -SPHINXBUILD ?= sphinx-build -SOURCEDIR = source -BUILDDIR = build - -# Put it first so that "make" without argument is like "make help". -help: - @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) - -.PHONY: help Makefile - -# Catch-all target: route all unknown targets to Sphinx using the new -# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). -%: Makefile - @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/docs/make.bat b/docs/make.bat deleted file mode 100644 index 747ffb7..0000000 --- a/docs/make.bat +++ /dev/null @@ -1,35 +0,0 @@ -@ECHO OFF - -pushd %~dp0 - -REM Command file for Sphinx documentation - -if "%SPHINXBUILD%" == "" ( - set SPHINXBUILD=sphinx-build -) -set SOURCEDIR=source -set BUILDDIR=build - -%SPHINXBUILD% >NUL 2>NUL -if errorlevel 9009 ( - echo. - echo.The 'sphinx-build' command was not found. Make sure you have Sphinx - echo.installed, then set the SPHINXBUILD environment variable to point - echo.to the full path of the 'sphinx-build' executable. Alternatively you - echo.may add the Sphinx directory to PATH. - echo. - echo.If you don't have Sphinx installed, grab it from - echo.https://www.sphinx-doc.org/ - exit /b 1 -) - -if "%1" == "" goto help - -%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% -goto end - -:help -%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% - -:end -popd diff --git a/docs/requirements.txt b/docs/requirements.txt deleted file mode 100644 index 897ca9c..0000000 --- a/docs/requirements.txt +++ /dev/null @@ -1,38 +0,0 @@ -alabaster==0.7.13 -Babel==2.15.0 -beautifulsoup4==4.12.3 -certifi==2024.2.2 -charset-normalizer==3.3.2 -docutils==0.20.1 -furo==2024.5.6 -idna==3.7 -imagesize==1.4.1 -importlib_metadata==7.1.0 -Jinja2==3.1.4 -joblib==1.4.2 -MarkupSafe==2.1.5 -numpy==1.24.4 -packaging==24.0 -pandas==2.0.3 -pybind11==2.12.0 -Pygments==2.18.0 -python-dateutil==2.9.0.post0 -pytz==2024.1 -requests==2.32.2 -scikit-learn==1.3.2 -scipy==1.10.1 -six==1.16.0 -snowballstemmer==2.2.0 -soupsieve==2.5 -Sphinx==7.1.2 -sphinx-basic-ng==1.0.0b2 -sphinxcontrib-applehelp==1.0.4 -sphinxcontrib-devhelp==1.0.2 -sphinxcontrib-htmlhelp==2.0.1 -sphinxcontrib-jsmath==1.0.1 -sphinxcontrib-qthelp==1.0.3 -sphinxcontrib-serializinghtml==1.1.5 -threadpoolctl==3.5.0 -tzdata==2024.1 -urllib3==2.2.1 -zipp==3.18.2 diff --git a/docs/source/api.rst b/docs/source/api.rst deleted file mode 100644 index 5055bf4..0000000 --- a/docs/source/api.rst +++ /dev/null @@ -1,14 +0,0 @@ -StochTree API -============= - -BART ----- - -.. autoclass:: stochtree.bart.BARTModel - :members: sample, predict - -BCF ---- - -.. autoclass:: stochtree.bcf.BCFModel - :members: sample, predict, predict_tau diff --git a/docs/source/causal.rst b/docs/source/causal.rst deleted file mode 100644 index a12a39c..0000000 --- a/docs/source/causal.rst +++ /dev/null @@ -1,64 +0,0 @@ -Causal Inference -================ - -This vignette provides a quick overview (using simulated data) of how to use ``stochtree`` for causal inference. -Start by loading stochtree's ``BCFModel`` class and a number of other packages. - -.. code-block:: python - - import numpy as np - import pandas as pd - import seaborn as sns - import matplotlib.pyplot as plt - from stochtree import BCFModel - from sklearn.model_selection import train_test_split - -Now, we generate a simulated causal inference problem - -.. code-block:: python - - # RNG - random_seed = 101 - rng = np.random.default_rng(random_seed) - - # Generate covariates and basis - n = 1000 - p_X = 5 - X = rng.uniform(0, 1, (n, p_X)) - pi_X = 0.25 + 0.5*X[:,0] - Z = rng.binomial(1, pi_X, n).astype(float) - - # Define the outcome mean functions (prognostic and treatment effects) - mu_X = pi_X*5 - # tau_X = np.sin(X[:,1]*2*np.pi) - tau_X = X[:,1]*2 - - # Generate outcome - epsilon = rng.normal(0, 1, n) - y = mu_X + tau_X*Z + epsilon - -Split the dataset into train and test sets - -.. code-block:: python - - sample_inds = np.arange(n) - train_inds, test_inds = train_test_split(sample_inds, test_size=0.5) - X_train = X[train_inds,:] - X_test = X[test_inds,:] - Z_train = Z[train_inds] - Z_test = Z[test_inds] - y_train = y[train_inds] - y_test = y[test_inds] - pi_train = pi_X[train_inds] - pi_test = pi_X[test_inds] - mu_train = mu_X[train_inds] - mu_test = mu_X[test_inds] - tau_train = tau_X[train_inds] - tau_test = tau_X[test_inds] - -Initialize and run a BCF sampler for 1000 iterations (after 10 "warm-start" draws) - -.. code-block:: python - - bcf_model = BCFModel() - bcf_model.sample(X_train, Z_train, y_train, pi_train, X_test, Z_test, pi_test, num_gfr=10, num_mcmc=1000) diff --git a/docs/source/conf.py b/docs/source/conf.py deleted file mode 100644 index b2fd35d..0000000 --- a/docs/source/conf.py +++ /dev/null @@ -1,35 +0,0 @@ -# Configuration file for the Sphinx documentation builder. -# -# For the full list of built-in configuration values, see the documentation: -# https://www.sphinx-doc.org/en/master/usage/configuration.html - -# import os -# import sys -# sys.path.insert(0, os.path.abspath('../..')) - -# -- Project information ----------------------------------------------------- -# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information - -project = 'stochtree' -copyright = '2024, Drew Herren' -author = 'Drew Herren' -release = '0.0.1' - -# -- General configuration --------------------------------------------------- -# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration - -extensions = [ - 'sphinx.ext.autodoc', - 'sphinx.ext.autosummary', -] - -templates_path = ['_templates'] -exclude_patterns = [] - - - -# -- Options for HTML output ------------------------------------------------- -# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output - -html_theme = 'furo' -html_static_path = ['_static'] diff --git a/docs/source/index.rst b/docs/source/index.rst deleted file mode 100644 index a7f29bf..0000000 --- a/docs/source/index.rst +++ /dev/null @@ -1,19 +0,0 @@ -StochTree -========= - -``stochtree`` runs stochastic machine learning algorithms for supervised learning and causal inference. -For details on installing the package, see the :doc:`Installation ` page. Once you have ``stochtree`` installed, -the :doc:`Supervised Learning ` and :doc:`Causal Inference ` vignettes provide some guidance on -using the package for your use case. - -.. We also support a lower-level interface to the underlying C++ data structures which can allow for custom sampling routines -.. (i.e. interspersing a BART forest with a neural network, a complicated variance sampler, etc...). This interface is introduced -.. in the :doc:`Prototype ` vignette. - -For complete function / class documentation, see the :doc:`API ` page. - -.. toctree:: - install - supervised - causal - api diff --git a/docs/source/install.rst b/docs/source/install.rst deleted file mode 100644 index 6e7fdbb..0000000 --- a/docs/source/install.rst +++ /dev/null @@ -1,52 +0,0 @@ -Installation -============ - -The python package can be installed from source. Clone the repo recursively (including git submodules) by running - -.. code-block:: console - - $ git clone --recursive https://github.com/StochasticTree/stochtree-python.git - -Conda ------ - -Conda provides a straightforward experience in managing python dependencies, avoiding version conflicts / ABI issues / etc. -Before you begin, make sure you have `conda `_ installed. -Next, create and activate a conda environment with the requisite dependencies - -.. code-block:: console - - $ conda create -n stochtree-dev -c conda-forge python=3.10 numpy scipy pytest pandas pybind11 scikit-learn matplotlib seaborn - $ conda activate stochtree-dev - $ pip install jupyterlab - -Then, navigate to the main ``stochtree-python`` project folder (i.e. ``cd /path/to/stochtree-python``) and install the package locally via pip - -.. code-block:: console - - $ pip install . - -pip ---- - -If you would rather avoid installing and setting up conda, you can alternatively setup the dependencies and install ``stochtree`` using only ``pip`` (caveat: this has not been extensively tested -across platforms and python versions). - -First, navigate to the main ``stochtree-python`` project folder (i.e. ``cd /path/to/stochtree-python``) and create and activate a virtual environment as a subfolder of the repo - -.. code-block:: console - - $ python -m venv venv - $ source venv/bin/activate - -Install all of the package (and demo notebook) dependencies - -.. code-block:: console - - $ pip install numpy scipy pytest pandas scikit-learn pybind11 matplotlib seaborn jupyterlab - -Then install stochtree via - -.. code-block:: console - - $ pip install . diff --git a/docs/source/supervised.rst b/docs/source/supervised.rst deleted file mode 100644 index a200e66..0000000 --- a/docs/source/supervised.rst +++ /dev/null @@ -1,71 +0,0 @@ -Supervised Learning -=================== - -This vignette provides a quick overview (using simulated data) of how to use ``stochtree`` for supervised learning. -Start by loading stochtree's ``BARTModel`` class and a number of other packages. - -.. code-block:: python - - import numpy as np - import pandas as pd - import seaborn as sns - import matplotlib.pyplot as plt - from stochtree import BARTModel - from sklearn.model_selection import train_test_split - -Now, we generate a simulated prediction problem - -.. code-block:: python - - # RNG - random_seed = 1234 - rng = np.random.default_rng(random_seed) - - # Generate covariates and basis - n = 1000 - p_X = 10 - p_W = 1 - X = rng.uniform(0, 1, (n, p_X)) - W = rng.uniform(0, 1, (n, p_W)) - - # Define the outcome mean function - def outcome_mean(X, W): - return np.where( - (X[:,0] >= 0.0) & (X[:,0] < 0.25), -7.5 * W[:,0], - np.where( - (X[:,0] >= 0.25) & (X[:,0] < 0.5), -2.5 * W[:,0], - np.where( - (X[:,0] >= 0.5) & (X[:,0] < 0.75), 2.5 * W[:,0], - 7.5 * W[:,0] - ) - ) - ) - - # Generate outcome - epsilon = rng.normal(0, 1, n) - y = outcome_mean(X, W) + epsilon - - # Standardize outcome - y_bar = np.mean(y) - y_std = np.std(y) - resid = (y-y_bar)/y_std - -Split the dataset into train and test sets - -.. code-block:: python - - sample_inds = np.arange(n) - train_inds, test_inds = train_test_split(sample_inds, test_size=0.5) - X_train = X[train_inds,:] - X_test = X[test_inds,:] - basis_train = W[train_inds,:] - basis_test = W[test_inds,:] - y_train = y[train_inds] - y_test = y[test_inds] - -Initialize and run a BART sampler for 100 iterations (after 10 "warm-start" draws) - -.. code-block:: python - - bart_model = BARTModel() - bart_model.sample(X_train=X_train, y_train=y_train, basis_train=basis_train, X_test=X_test, basis_test=basis_test, num_gfr=10, num_mcmc=100) diff --git a/pyproject.toml b/pyproject.toml deleted file mode 100644 index 5084a9c..0000000 --- a/pyproject.toml +++ /dev/null @@ -1,12 +0,0 @@ -[build-system] -requires = [ - "setuptools>=42", - "wheel", - "ninja", - "cmake>=3.12", - "numpy", - "pandas", - "scipy", - "scikit-learn" -] -build-backend = "setuptools.build_meta" \ No newline at end of file diff --git a/setup.py b/setup.py deleted file mode 100644 index 35522e1..0000000 --- a/setup.py +++ /dev/null @@ -1,142 +0,0 @@ -import os -import re -import subprocess -import sys -from pathlib import Path - -from setuptools import Extension, setup, find_packages -from setuptools.command.build_ext import build_ext - -# Convert distutils Windows platform specifiers to CMake -A arguments -PLAT_TO_CMAKE = { - "win32": "Win32", - "win-amd64": "x64", - "win-arm32": "ARM", - "win-arm64": "ARM64", -} - -# A CMakeExtension needs a sourcedir instead of a file list. -# The name must be the _single_ output extension from the CMake build. -# If you need multiple extensions, see scikit-build. -class CMakeExtension(Extension): - def __init__(self, name: str, sourcedir: str = "") -> None: - super().__init__(name, sources=[]) - self.sourcedir = os.fspath(Path(sourcedir).resolve()) - - -class CMakeBuild(build_ext): - def build_extension(self, ext: CMakeExtension) -> None: - # Must be in this form due to bug in .resolve() only fixed in Python 3.10+ - ext_fullpath = Path.cwd() / self.get_ext_fullpath(ext.name) - extdir = ext_fullpath.parent.resolve() - - # Using this requires trailing slash for auto-detection & inclusion of - # auxiliary "native" libs - - debug = int(os.environ.get("DEBUG", 0)) if self.debug is None else self.debug - cfg = "Debug" if debug else "Release" - - # CMake lets you override the generator - we need to check this. - # Can be set with Conda-Build, for example. - cmake_generator = os.environ.get("CMAKE_GENERATOR", "") - - # Set Python_EXECUTABLE instead if you use PYBIND11_FINDPYTHON - # EXAMPLE_VERSION_INFO shows you how to pass a value into the C++ code - # from Python. - cmake_args = [ - f"-DCMAKE_LIBRARY_OUTPUT_DIRECTORY={extdir}{os.sep}", - f"-DPYTHON_EXECUTABLE={sys.executable}", - f"-DCMAKE_BUILD_TYPE={cfg}", # not used on MSVC, but no harm - ] - build_args = [] - # Adding CMake arguments set as environment variable - # (needed e.g. to build for ARM OSx on conda-forge) - if "CMAKE_ARGS" in os.environ: - cmake_args += [item for item in os.environ["CMAKE_ARGS"].split(" ") if item] - - # In this example, we pass in the version to C++. You might not need to. - cmake_args += [f"-DEXAMPLE_VERSION_INFO={self.distribution.get_version()}"] - - if self.compiler.compiler_type != "msvc": - # Using Ninja-build since it a) is available as a wheel and b) - # multithreads automatically. MSVC would require all variables be - # exported for Ninja to pick it up, which is a little tricky to do. - # Users can override the generator with CMAKE_GENERATOR in CMake - # 3.15+. - if not cmake_generator or cmake_generator == "Ninja": - try: - import ninja - - ninja_executable_path = Path(ninja.BIN_DIR) / "ninja" - cmake_args += [ - "-GNinja", - f"-DCMAKE_MAKE_PROGRAM:FILEPATH={ninja_executable_path}", - ] - except ImportError: - pass - - else: - # Single config generators are handled "normally" - single_config = any(x in cmake_generator for x in {"NMake", "Ninja"}) - - # CMake allows an arch-in-generator style for backward compatibility - contains_arch = any(x in cmake_generator for x in {"ARM", "Win64"}) - - # Specify the arch if using MSVC generator, but only if it doesn't - # contain a backward-compatibility arch spec already in the - # generator name. - if not single_config and not contains_arch: - cmake_args += ["-A", PLAT_TO_CMAKE[self.plat_name]] - - # Multi-config generators have a different way to specify configs - if not single_config: - cmake_args += [ - f"-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_{cfg.upper()}={extdir}" - ] - build_args += ["--config", cfg] - - if sys.platform.startswith("darwin"): - # Cross-compile support for macOS - respect ARCHFLAGS if set - archs = re.findall(r"-arch (\S+)", os.environ.get("ARCHFLAGS", "")) - if archs: - cmake_args += ["-DCMAKE_OSX_ARCHITECTURES={}".format(";".join(archs))] - - # Set CMAKE_BUILD_PARALLEL_LEVEL to control the parallel build level - # across all generators. - if "CMAKE_BUILD_PARALLEL_LEVEL" not in os.environ: - # self.parallel is a Python 3 only way to set parallel jobs by hand - # using -j in the build_ext call, not supported by pip or PyPA-build. - if hasattr(self, "parallel") and self.parallel: - # CMake 3.12+ only. - build_args += [f"-j{self.parallel}"] - - build_temp = Path(self.build_temp) / ext.name - if not build_temp.exists(): - build_temp.mkdir(parents=True) - - subprocess.run( - ["cmake", ext.sourcedir, *cmake_args], cwd=build_temp, check=True - ) - subprocess.run( - ["cmake", "--build", ".", *build_args], cwd=build_temp, check=True - ) - -# The information here can also be placed in setup.cfg - better separation of -# logic and declaration, and simpler if you include description/version in a file. -__version__ = "0.0.1" - -setup( - name="stochtree", - version=__version__, - author="Drew Herren", - author_email="drewherrenopensource@gmail.com", - url="https://github.com/andrewherren/StochasticTree", - description="Python Stochastic Tree Ensembles for Machine Learning and Causal Inference", - long_description="Python Stochastic Tree Ensembles for Machine Learning and Causal Inference", - packages=find_packages(), - ext_modules=[CMakeExtension("stochtree_cpp")], - cmdclass={"build_ext": CMakeBuild}, - zip_safe=False, - extras_require={"test": ["pytest>=6.0"]}, - python_requires=">=3.7", -) diff --git a/stochtree/__init__.py b/stochtree/__init__.py deleted file mode 100644 index b868e54..0000000 --- a/stochtree/__init__.py +++ /dev/null @@ -1,11 +0,0 @@ -from .bart import BARTModel -from .bcf import BCFModel -from .data import Dataset, Residual -from .forest import ForestContainer -from .sampler import RNG, ForestSampler, GlobalVarianceModel, LeafVarianceModel -from .serialization import JSONSerializer -from .utils import NotSampledError - -__all__ = ['BARTModel', 'BCFModel', 'Dataset', 'Residual', 'ForestContainer', - 'RNG', 'ForestSampler', 'GlobalVarianceModel', 'LeafVarianceModel', - 'JSONSerializer', 'NotSampledError'] \ No newline at end of file diff --git a/stochtree/bart.py b/stochtree/bart.py deleted file mode 100644 index a5bdf0d..0000000 --- a/stochtree/bart.py +++ /dev/null @@ -1,316 +0,0 @@ -import numpy as np -import pandas as pd -from scipy.linalg import lstsq -from scipy.stats import gamma -from .data import Dataset, Residual -from .forest import ForestContainer -from .sampler import ForestSampler, RNG, GlobalVarianceModel, LeafVarianceModel -from .utils import NotSampledError - -class BARTModel: - """Class that handles sampling, storage, and serialization of stochastic forest models like BART, XBART, and Warm-Start BART - """ - - def __init__(self) -> None: - # Internal flag for whether the sample() method has been run - self.sampled = False - self.rng = np.random.default_rng() - - def is_sampled(self) -> bool: - return self.sampled - - def sample(self, X_train: np.array, y_train: np.array, basis_train: np.array = None, X_test: np.array = None, basis_test: np.array = None, - feature_types: np.array = None, cutpoint_grid_size = 100, sigma_leaf: float = None, alpha: float = 0.95, beta: float = 2.0, - min_samples_leaf: int = 5, nu: float = 3, lamb: float = None, a_leaf: float = 3, b_leaf: float = None, q: float = 0.9, - sigma2: float = None, num_trees: int = 200, num_gfr: int = 5, num_burnin: int = 0, num_mcmc: int = 100, - sample_sigma_global: bool = True, sample_sigma_leaf: bool = True, random_seed: int = -1, - keep_burnin: bool = False, keep_gfr: bool = False) -> None: - """Runs a BART sampler on provided training set. Predictions will be cached for the training set and (if provided) the test set. - Does not require a leaf regression basis. - - :param X_train: Training set covariates on which trees may be partitioned - :type X_train: np.array - :param y_train: Training set outcome - :type y_train: np.array - :param basis_train: Optional training set basis vector used to define a regression to be run in the leaves of each tree - :type basis_train: np.array, optional - :param X_test: Test set covariates on which trees may be partitioned - :type X_test: np.array - :param basis_test: Optional test set basis vector used to define a regression to be run in the leaves of each tree. Must be included / omitted consistently (i.e. if basis_train is provided, then basis_test must be provided alongside X_test). - :type basis_test: np.array, optional - :param feature_types: Indicators of feature type (0 = numeric, 1 = ordered categorical, 2 = unordered categorical). If omitted, all covariates are assumed to be numeric. - :type feature_types: np.array, optional - :param cutpoint_grid_size: Maximum number of cutpoints to consider for each feature. Defaults to 100. - :type cutpoint_grid_size: int, optional - :param sigma_leaf: Scale parameter on the leaf node regression model. - :type sigma_leaf: float, optional - :param alpha: Prior probability of splitting for a tree of depth 0. Tree split prior combines ``alpha`` and ``beta`` via ``alpha*(1+node_depth)^-beta``. - :type alpha: float, optional - :param beta: Exponent that decreases split probabilities for nodes of depth > 0. Tree split prior combines ``alpha`` and ``beta`` via ``alpha*(1+node_depth)^-beta``. - :type beta: float, optional - :param min_samples_leaf: Minimum allowable size of a leaf, in terms of training samples. Defaults to 5. - :type min_samples_leaf: int, optional - :param nu: Shape parameter in the ``IG(nu, nu*lambda)`` global error variance model. Defaults to 3. - :type nu: float, optional - :param lambda: Component of the scale parameter in the ``IG(nu, nu*lambda)`` global error variance prior. If not specified, this is calibrated as in Sparapani et al (2021). - :type lambda: float, optional - :param a_leaf: Shape parameter in the ``IG(a_leaf, b_leaf)`` leaf node parameter variance model. Defaults to 3. - :type a_leaf: float, optional - :param b_leaf: Scale parameter in the ``IG(a_leaf, b_leaf)`` leaf node parameter variance model. Calibrated internally as ``0.5/num_trees`` if not set here. - :type b_leaf: float, optional - :param q: Quantile used to calibrated ``lambda`` as in Sparapani et al (2021). Defaults to 0.9. - :type q: float, optional - :param sigma2: Starting value of global variance parameter. Calibrated internally as in Sparapani et al (2021) if not set here. - :type sigma2: float, optional - :param num_trees: Number of trees in the ensemble. Defaults to 200. - :type num_trees: int, optional - :param num_gfr: Number of "warm-start" iterations run using the grow-from-root algorithm (He and Hahn, 2021). Defaults to 5. - :type num_gfr: int, optional - :param num_burnin: Number of "burn-in" iterations of the MCMC sampler. Defaults to 0. - :type num_burnin: int, optional - :param num_mcmc: Number of "retained" iterations of the MCMC sampler. Defaults to 100. If this is set to 0, GFR (XBART) samples will be retained. - :type num_mcmc: int, optional - :param sample_sigma_global: Whether or not to update the ``sigma^2`` global error variance parameter based on ``IG(nu, nu*lambda)``. Defaults to True. - :type sample_sigma_global: bool, optional - :param sample_sigma_leaf: Whether or not to update the ``tau`` leaf scale variance parameter based on ``IG(a_leaf, b_leaf)``. Cannot (currently) be set to true if ``basis_train`` has more than one column. Defaults to True. - :type sample_sigma_leaf: bool, optional - :param random_seed: Integer parameterizing the C++ random number generator. If not specified, the C++ random number generator is seeded according to ``std::random_device``. - :type random_seed: int, optional - :param keep_burnin: Whether or not "burnin" samples should be included in predictions. Defaults to False. Ignored if num_mcmc = 0. - :type keep_burnin: bool, optional - :param keep_gfr: Whether or not "warm-start" / grow-from-root samples should be included in predictions. Defaults to False. Ignored if num_mcmc = 0. - :type keep_gfr: bool, optional - """ - # Convert everything to standard shape (2-dimensional) - if X_train.ndim == 1: - X_train = np.expand_dims(X_train, 1) - if basis_train is not None: - if basis_train.ndim == 1: - basis_train = np.expand_dims(basis_train, 1) - if y_train.ndim == 1: - y_train = np.expand_dims(y_train, 1) - if X_test is not None: - if X_train.ndim == 1: - X_train = np.expand_dims(X_train, 1) - if basis_test is not None: - if basis_test.ndim == 1: - basis_test = np.expand_dims(basis_test, 1) - - # Data checks - if X_test is not None: - if X_test.shape[1] != X_train.shape[1]: - raise ValueError("X_train and X_test must have the same number of columns") - if basis_test is not None: - if basis_train is not None: - if basis_test.shape[1] != basis_train.shape[1]: - raise ValueError("basis_train and basis_test must have the same number of columns") - else: - raise ValueError("basis_test provided but basis_train was not") - if basis_train is not None: - if basis_train.shape[0] != X_train.shape[0]: - raise ValueError("basis_train and Z_train must have the same number of rows") - if y_train.shape[0] != X_train.shape[0]: - raise ValueError("X_train and y_train must have the same number of rows") - if X_test is not None and basis_test is not None: - if X_test.shape[0] != basis_test.shape[0]: - raise ValueError("X_test and basis_test must have the same number of rows") - - # Determine whether a test set is provided - self.has_test = X_test is not None - - # Determine whether a basis is provided - self.has_basis = basis_train is not None - - # Unpack data dimensions - self.n_train = y_train.shape[0] - self.n_test = X_test.shape[0] if self.has_test else 0 - self.num_covariates = X_train.shape[1] - self.num_basis = basis_train.shape[1] if self.has_basis else 0 - - # Set feature type defaults if not provided - if feature_types is None: - feature_types = np.zeros(self.num_covariates) - - # Set variable weights for the prognostic and treatment effect forests - variable_weights = np.repeat(1.0/X_train.shape[1], X_train.shape[1]) - - # Scale outcome - self.y_bar = np.squeeze(np.mean(y_train)) - self.y_std = np.squeeze(np.std(y_train)) - resid_train = (y_train-self.y_bar)/self.y_std - - # Calibrate priors for global sigma^2 and sigma_leaf - if lamb is None: - reg_basis = np.c_[np.ones(self.n_train),X_train] - reg_soln = lstsq(reg_basis, np.squeeze(resid_train)) - sigma2hat = reg_soln[1] / self.n_train - quantile_cutoff = q - lamb = (sigma2hat*gamma.ppf(1-quantile_cutoff,nu))/nu - sigma2 = sigma2hat if sigma2 is None else sigma2 - b_leaf = np.squeeze(np.var(resid_train)) / num_trees if b_leaf is None else b_leaf - sigma_leaf = np.squeeze(np.var(resid_train)) / num_trees if sigma_leaf is None else sigma_leaf - current_sigma2 = sigma2 - current_leaf_scale = np.array([[sigma_leaf]]) - - # Container of variance parameter samples - self.num_gfr = num_gfr - self.num_burnin = num_burnin - self.num_mcmc = num_mcmc - self.num_samples = num_gfr + num_burnin + num_mcmc - self.sample_sigma_global = sample_sigma_global - self.sample_sigma_leaf = sample_sigma_leaf - if sample_sigma_global: - self.global_var_samples = np.zeros(self.num_samples) - if sample_sigma_leaf: - self.leaf_scale_samples = np.zeros(self.num_samples) - - # Forest Dataset (covariates and optional basis) - forest_dataset_train = Dataset() - forest_dataset_train.add_covariates(X_train) - if self.has_basis: - forest_dataset_train.add_basis(basis_train) - if self.has_test: - forest_dataset_test = Dataset() - forest_dataset_test.add_covariates(X_test) - if self.has_basis: - forest_dataset_test.add_basis(basis_test) - - # Residual - residual_train = Residual(resid_train) - - # C++ random number generator - if random_seed is None: - cpp_rng = RNG(-1) - else: - cpp_rng = RNG(random_seed) - - # Sampling data structures - forest_sampler = ForestSampler(forest_dataset_train, feature_types, num_trees, self.n_train, alpha, beta, min_samples_leaf) - - # Determine the leaf model - if not self.has_basis: - leaf_model_int = 0 - elif self.num_basis == 1: - leaf_model_int = 1 - else: - leaf_model_int = 2 - - # Container of forest samples - self.forest_container = ForestContainer(num_trees, 1, True) if not self.has_basis else ForestContainer(num_trees, self.num_basis, False) - - # Variance samplers - if self.sample_sigma_global: - global_var_model = GlobalVarianceModel() - if self.sample_sigma_leaf: - leaf_var_model = LeafVarianceModel() - - # Initialize the leaves of each tree in the prognostic forest - init_root = np.squeeze(np.mean(resid_train)) / num_trees - self.forest_container.set_root_leaves(0, init_root) - forest_sampler.update_residual(forest_dataset_train, residual_train, self.forest_container, False, 0, True) - - # Run GFR (warm start) if specified - if self.num_gfr > 0: - gfr_indices = np.arange(self.num_gfr) - for i in range(self.num_gfr): - # Sample the forest - forest_sampler.sample_one_iteration( - self.forest_container, forest_dataset_train, residual_train, cpp_rng, feature_types, - cutpoint_grid_size, current_leaf_scale, variable_weights, current_sigma2, leaf_model_int, True, True - ) - - # Sample variance parameters (if requested) - if self.sample_sigma_global: - current_sigma2 = global_var_model.sample_one_iteration(residual_train, cpp_rng, nu, lamb) - self.global_var_samples[i] = current_sigma2*self.y_std*self.y_std - if self.sample_sigma_leaf: - self.leaf_scale_samples[i] = leaf_var_model.sample_one_iteration(self.forest_container, cpp_rng, a_leaf, b_leaf, i) - current_leaf_scale[0,0] = self.leaf_scale_samples[i] - - # Run MCMC - if self.num_burnin + self.num_mcmc > 0: - if self.num_burnin > 0: - burnin_indices = np.arange(self.num_gfr, self.num_gfr + self.num_burnin) - if self.num_mcmc > 0: - mcmc_indices = np.arange(self.num_gfr + self.num_burnin, self.num_gfr + self.num_burnin + self.num_mcmc) - for i in range(self.num_gfr, self.num_samples): - # Sample the forest - forest_sampler.sample_one_iteration( - self.forest_container, forest_dataset_train, residual_train, cpp_rng, feature_types, - cutpoint_grid_size, current_leaf_scale, variable_weights, current_sigma2, leaf_model_int, False, True - ) - - # Sample variance parameters (if requested) - if self.sample_sigma_global: - current_sigma2 = global_var_model.sample_one_iteration(residual_train, cpp_rng, nu, lamb) - self.global_var_samples[i] = current_sigma2*self.y_std*self.y_std - if self.sample_sigma_leaf: - self.leaf_scale_samples[i] = leaf_var_model.sample_one_iteration(self.forest_container, cpp_rng, a_leaf, b_leaf, i) - current_leaf_scale[0,0] = self.leaf_scale_samples[i] - - # Mark the model as sampled - self.sampled = True - - # Prediction indices to be stored - if self.num_mcmc > 0: - self.keep_indices = mcmc_indices - if keep_gfr: - self.keep_indices = np.concatenate((gfr_indices, self.keep_indices)) - else: - # Don't retain both GFR and burnin samples - if keep_burnin: - self.keep_indices = np.concatenate((burnin_indices, self.keep_indices)) - else: - if self.num_gfr > 0 and self.num_burnin > 0: - # Override keep_gfr = False since there are no MCMC samples - # Don't retain both GFR and burnin samples - self.keep_indices = gfr_indices - elif self.num_gfr <= 0 and self.num_burnin > 0: - self.keep_indices = burnin_indices - elif self.num_gfr > 0 and self.num_burnin <= 0: - self.keep_indices = gfr_indices - else: - raise RuntimeError("There are no samples to retain!") - - # Store predictions - yhat_train_raw = self.forest_container.forest_container_cpp.Predict(forest_dataset_train.dataset_cpp)[:,self.keep_indices] - self.y_hat_train = yhat_train_raw*self.y_std + self.y_bar - if self.has_test: - yhat_test_raw = self.forest_container.forest_container_cpp.Predict(forest_dataset_test.dataset_cpp)[:,self.keep_indices] - self.y_hat_test = yhat_test_raw*self.y_std + self.y_bar - - def predict(self, covariates: np.array, basis: np.array = None) -> np.array: - """Predict outcome from every retained forest of a BART sampler. - - :param covariates: Test set covariates - :type covariates: np.array - :param basis: Optional test set basis vector, must be provided if the model was trained with a leaf regression basis - :type basis: np.array, optional - :return: Array of predictions with as many rows as in ``covariates`` and as many columns as retained samples of the algorithm. - :rtype: np.array - """ - if not self.is_sampled(): - msg = ( - "This BCFModel instance is not fitted yet. Call 'fit' with " - "appropriate arguments before using this model." - ) - raise NotSampledError(msg) - - # Convert everything to standard shape (2-dimensional) - if covariates.ndim == 1: - covariates = np.expand_dims(covariates, 1) - if basis is not None: - if basis.ndim == 1: - basis = np.expand_dims(basis, 1) - - # Data checks - if basis is not None: - if basis.shape[0] != covariates.shape[0]: - raise ValueError("covariates and basis must have the same number of rows") - - pred_dataset = Dataset() - pred_dataset.add_covariates(covariates) - if basis is not None: - pred_dataset.add_basis(basis) - pred_raw = self.forest_container.forest_container_cpp.Predict(pred_dataset.dataset_cpp) - return pred_raw[:,self.keep_indices]*self.y_std + self.y_bar diff --git a/stochtree/bcf.py b/stochtree/bcf.py deleted file mode 100644 index 9b6a539..0000000 --- a/stochtree/bcf.py +++ /dev/null @@ -1,638 +0,0 @@ -import numpy as np -import pandas as pd -from sklearn.ensemble import HistGradientBoostingClassifier, HistGradientBoostingRegressor -from sklearn.model_selection import GridSearchCV, KFold -from typing import Optional -from scipy.linalg import lstsq -from scipy.stats import gamma -from .bart import BARTModel -from .data import Dataset, Residual -from .forest import ForestContainer -from .sampler import ForestSampler, RNG, GlobalVarianceModel, LeafVarianceModel -from .utils import NotSampledError - -class BCFModel: - """Class that handles sampling, storage, and serialization of causal BART models like BCF, XBCF, and Warm-Start BCF - """ - - def __init__(self) -> None: - # Internal flag for whether the sample() method has been run - self.sampled = False - self.rng = np.random.default_rng() - - def is_sampled(self) -> bool: - return self.sampled - - def sample(self, X_train: np.array, Z_train: np.array, y_train: np.array, pi_train: np.array = None, - X_test: np.array = None, Z_test: np.array = None, pi_test: np.array = None, feature_types: np.array = None, - cutpoint_grid_size = 100, sigma_leaf_mu: float = None, sigma_leaf_tau: float = None, - alpha_mu: float = 0.95, alpha_tau: float = 0.25, beta_mu: float = 2.0, beta_tau: float = 3.0, - min_samples_leaf_mu: int = 5, min_samples_leaf_tau: int = 5, nu: float = 3, lamb: float = None, - a_leaf_mu: float = 3, a_leaf_tau: float = 3, b_leaf_mu: float = None, b_leaf_tau: float = None, - q: float = 0.9, sigma2: float = None, num_trees_mu: int = 200, num_trees_tau: int = 50, - num_gfr: int = 5, num_burnin: int = 0, num_mcmc: int = 100, sample_sigma_global: bool = True, - sample_sigma_leaf_mu: bool = True, sample_sigma_leaf_tau: bool = False, propensity_covariate: str = "mu", - adaptive_coding: bool = True, b_0: float = -0.5, b_1: float = 0.5, random_seed: int = -1, - keep_burnin: bool = False, keep_gfr: bool = False) -> None: - """Runs a BCF sampler on provided training set. Outcome predictions and estimates of the prognostic and treatment effect functions - will be cached for the training set and (if provided) the test set. - - :param X_train: Covariates used to split trees in the ensemble. Can be passed as either a matrix or dataframe. - :type X_train: np.array - :param Z_train: Vector of (continuous or binary) treatment assignments. - :type Z_train: np.array - :param y_train: Outcome to be modeled by the ensemble. - :type y_train: np.array - :param pi_train: Optional vector of propensity scores. If not provided, this will be estimated from the data. - :type pi_train: np.array, optional - :param X_test: Optional test set of covariates used to define "out of sample" evaluation data. - :type X_test: np.array - :param Z_test: Optional test set of (continuous or binary) treatment assignments. - :type Z_test: np.array, optional - :param pi_test: Optional test set vector of propensity scores. If not provided (but ``X_test`` and ``Z_test`` are), this will be estimated from the data. - :type pi_test: np.array, optional - :param feature_types: Indicators of feature type (0 = numeric, 1 = ordered categorical, 2 = unordered categorical). If omitted, all covariates are assumed to be numeric. - :type feature_types: np.array, optional - :param cutpoint_grid_size: Maximum number of cutpoints to consider for each feature. Defaults to 100. - :type cutpoint_grid_size: int, optional - :param sigma_leaf_mu: Starting value of leaf node scale parameter for the prognostic forest. Calibrated internally as ``2/num_trees_mu`` if not set here. - :type sigma_leaf_mu: float, optional - :param sigma_leaf_tau: Starting value of leaf node scale parameter for the treatment effect forest. Calibrated internally as ``1/num_trees_mu`` if not set here. - :type sigma_leaf_tau: float, optional - :param alpha_mu: Prior probability of splitting for a tree of depth 0 for the prognostic forest. Tree split prior combines ``alpha_mu`` and ``beta_mu`` via ``alpha_mu*(1+node_depth)^-beta_mu``. - :type alpha_mu: float, optional - :param alpha_tau: Prior probability of splitting for a tree of depth 0 for the treatment effect forest. Tree split prior combines ``alpha_tau`` and ``beta_tau`` via ``alpha_tau*(1+node_depth)^-beta_tau``. - :type alpha_tau: float, optional - :param beta_mu: Exponent that decreases split probabilities for nodes of depth > 0 for the prognostic forest. Tree split prior combines ``alpha_mu`` and ``beta_mu`` via ``alpha_mu*(1+node_depth)^-beta_mu``. - :type beta_mu: float, optional - :param beta_tau: Exponent that decreases split probabilities for nodes of depth > 0 for the treatment effect forest. Tree split prior combines ``alpha_tau`` and ``beta_tau`` via ``alpha_tau*(1+node_depth)^-beta_tau``. - :type beta_tau: float, optional - :param min_samples_leaf_mu: Minimum allowable size of a leaf, in terms of training samples, for the prognostic forest. Defaults to 5. - :type min_samples_leaf_mu: int, optional - :param min_samples_leaf_tau: Minimum allowable size of a leaf, in terms of training samples, for the treatment effect forest. Defaults to 5. - :type min_samples_leaf_tau: int, optional - :param nu: Shape parameter in the ``IG(nu, nu*lambda)`` global error variance model. Defaults to 3. - :type nu: float, optional - :param lambda: Component of the scale parameter in the ``IG(nu, nu*lambda)`` global error variance prior. If not specified, this is calibrated as in Sparapani et al (2021). - :type lambda: float, optional - :param a_leaf_mu: Shape parameter in the ``IG(a_leaf_mu, b_leaf_mu)`` leaf node parameter variance model for the prognostic forest. Defaults to 3. - :type a_leaf_mu: float, optional - :param a_leaf_tau: Shape parameter in the ``IG(a_leaf_tau, b_leaf_tau)`` leaf node parameter variance model for the treatment effect forest. Defaults to 3. - :type a_leaf_tau: float, optional - :param b_leaf_mu: Scale parameter in the ``IG(a_leaf_mu, b_leaf_mu)`` leaf node parameter variance model for the prognostic forest. Calibrated internally as ``0.5/num_trees_mu`` if not set here. - :type b_leaf_mu: float, optional - :param b_leaf_tau: Scale parameter in the ``IG(a_leaf_tau, b_leaf_tau)`` leaf node parameter variance model for the treatment effect forest. Calibrated internally as ``0.5/num_trees_tau`` if not set here. - :type b_leaf_tau: float, optional - :param q: Quantile used to calibrated ``lambda`` as in Sparapani et al (2021). Defaults to 0.9. - :type q: float, optional - :param sigma2: Starting value of global variance parameter. Calibrated internally as in Sparapani et al (2021) if not set here. - :type sigma2: float, optional - :param num_trees_mu: Number of trees in the prognostic forest. Defaults to 200. - :type num_trees_mu: int, optional - :param num_trees: Number of trees in the treatment effect forest. Defaults to 50. - :type num_trees: int, optional - :param num_gfr: Number of "warm-start" iterations run using the grow-from-root algorithm (He and Hahn, 2021). Defaults to 5. - :type num_gfr: int, optional - :param num_burnin: Number of "burn-in" iterations of the MCMC sampler. Defaults to 0. - :type num_burnin: int, optional - :param num_mcmc: Number of "retained" iterations of the MCMC sampler. Defaults to 100. If this is set to 0, GFR (XBART) samples will be retained. - :type num_mcmc: int, optional - :param sample_sigma_global: Whether or not to update the ``sigma^2`` global error variance parameter based on ``IG(nu, nu*lambda)``. Defaults to True. - :type sample_sigma_global: bool, optional - :param sample_sigma_leaf_mu: Whether or not to update the leaf scale variance parameter based on ``IG(a_leaf_mu, b_leaf_mu)`` for the prognostic forest. Defaults to True. - :type sample_sigma_leaf_mu: bool, optional - :param sample_sigma_leaf_tau: Whether or not to update the leaf scale variance parameter based on ``IG(a_leaf_tau, b_leaf_tau)`` for the treatment effect forest. Defaults to True. - :type sample_sigma_leaf_tau: bool, optional - :param propensity_covariate: Whether to include the propensity score as a covariate in either or both of the forests. Enter "none" for neither, "mu" for the prognostic forest, "tau" for the treatment forest, and "both" for both forests. If this is not "none" and a propensity score is not provided, it will be estimated from (``X_train``, ``Z_train``) using ``BARTModel``. Defaults to "mu". - :type propensity_covariate: string, optional - :param adaptive_coding: Whether or not to use an "adaptive coding" scheme in which a binary treatment variable is not coded manually as (0,1) or (-1,1) but learned via parameters ``b_0`` and ``b_1`` that attach to the outcome model ``[b_0 (1-Z) + b_1 Z] tau(X)``. This is ignored when Z is not binary. Defaults to True. - :type adaptive_coding: bool, optional - :param b_0: Initial value of the "control" group coding parameter. This is ignored when Z is not binary. Default: -0.5. - :type b_0: bool, optional - :param b_1: Initial value of the "control" group coding parameter. This is ignored when Z is not binary. Default: 0.5. - :type b_1: bool, optional - :param random_seed: Integer parameterizing the C++ random number generator. If not specified, the C++ random number generator is seeded according to ``std::random_device``. - :type random_seed: int, optional - :param keep_burnin: Whether or not "burnin" samples should be included in predictions. Defaults to False. Ignored if num_mcmc = 0. - :type keep_burnin: bool, optional - :param keep_gfr: Whether or not "warm-start" / grow-from-root samples should be included in predictions. Defaults to False. Ignored if num_mcmc = 0. - :type keep_gfr: bool, optional - """ - # Convert everything to standard shape (2-dimensional) - if X_train.ndim == 1: - X_train = np.expand_dims(X_train, 1) - if Z_train.ndim == 1: - Z_train = np.expand_dims(Z_train, 1) - if y_train.ndim == 1: - y_train = np.expand_dims(y_train, 1) - if pi_train is not None: - if pi_train.ndim == 1: - pi_train = np.expand_dims(pi_train, 1) - if X_test is not None: - if X_train.ndim == 1: - X_train = np.expand_dims(X_train, 1) - if Z_test is not None: - if Z_test.ndim == 1: - Z_test = np.expand_dims(Z_test, 1) - if pi_test is not None: - if pi_test.ndim == 1: - pi_test = np.expand_dims(pi_test, 1) - - # Data checks - if X_test is not None: - if X_test.shape[1] != X_train.shape[1]: - raise ValueError("X_train and X_test must have the same number of columns") - if Z_test is not None: - if Z_test.shape[1] != Z_train.shape[1]: - raise ValueError("Z_train and Z_test must have the same number of columns") - if Z_train.shape[0] != X_train.shape[0]: - raise ValueError("X_train and Z_train must have the same number of rows") - if y_train.shape[0] != X_train.shape[0]: - raise ValueError("X_train and y_train must have the same number of rows") - if pi_train is not None: - if pi_train.shape[0] != X_train.shape[0]: - raise ValueError("X_train and pi_train must have the same number of rows") - if X_test is not None and Z_test is not None: - if X_test.shape[0] != Z_test.shape[0]: - raise ValueError("X_test and Z_test must have the same number of rows") - if X_test is not None and pi_test is not None: - if X_test.shape[0] != pi_test.shape[0]: - raise ValueError("X_test and pi_test must have the same number of rows") - - # Determine whether a test set is provided - self.has_test = X_test is not None - - # Unpack data dimensions - self.n_train = y_train.shape[0] - self.n_test = X_test.shape[0] if self.has_test else 0 - self.p_x = X_train.shape[1] - - # Check whether treatment is binary - self.binary_treatment = np.unique(Z_train).size == 2 - - # Adaptive coding will be ignored for continuous / ordered categorical treatments - self.adaptive_coding = adaptive_coding - if adaptive_coding and not self.binary_treatment: - self.adaptive_coding = False - - # Check if user has provided propensities that are needed in the model - if pi_train is None and propensity_covariate != "none": - self.bart_propensity_model = BARTModel() - if self.has_test: - pi_test = np.mean(self.bart_propensity_model.y_hat_test, axis = 1, keepdims = True) - self.bart_propensity_model.sample(X_train=X_train, y_train=Z_train, X_test=X_test, num_gfr=10, num_mcmc=10) - pi_train = np.mean(self.bart_propensity_model.y_hat_train, axis = 1, keepdims = True) - pi_test = np.mean(self.bart_propensity_model.y_hat_test, axis = 1, keepdims = True) - else: - self.bart_propensity_model.sample(X_train=X_train, y_train=Z_train, num_gfr=10, num_mcmc=10) - pi_train = np.mean(self.bart_propensity_model.y_hat_train, axis = 1, keepdims = True) - self.internal_propensity_model = True - else: - self.internal_propensity_model = False - - # Set feature type defaults if not provided - if feature_types is None: - feature_types = np.zeros(self.p_x) - - # Update covariates to include propensities if requested - if propensity_covariate == "mu": - feature_types_mu = np.append(feature_types, 0).astype('int') - feature_types_tau = feature_types.astype('int') - X_train_mu = np.c_[X_train, pi_train] - X_train_tau = X_train - if self.has_test: - X_test_mu = np.c_[X_test, pi_test] - X_test_tau = X_test - elif propensity_covariate == "tau": - feature_types_tau = np.append(feature_types, 0).astype('int') - feature_types_mu = feature_types.astype('int') - X_train_tau = np.c_[X_train, pi_train] - X_train_mu = X_train - if self.has_test: - X_test_tau = np.c_[X_test, pi_test] - X_test_mu = X_test - elif propensity_covariate == "both": - feature_types_tau = np.append(feature_types, 0).astype('int') - feature_types_mu = np.append(feature_types, 0).astype('int') - X_train_tau = np.c_[X_train, pi_train] - X_train_mu = np.c_[X_train, pi_train] - if self.has_test: - X_test_tau = np.c_[X_test, pi_test] - X_test_mu = np.c_[X_test, pi_test] - elif propensity_covariate == "none": - feature_types_tau = feature_types.astype('int') - feature_types_mu = feature_types.astype('int') - X_train_tau = X_train - X_train_mu = X_train - if self.has_test: - X_test_tau = X_test - X_test_mu = X_test - else: - raise ValueError("propensity_covariate must be one of 'mu', 'tau', 'both', or 'none'") - - # Store propensity score requirements of the BCF forests - self.propensity_covariate = propensity_covariate - - # Set variable weights for the prognostic and treatment effect forests - variable_weights_mu = np.repeat(1.0/X_train_mu.shape[1], X_train_mu.shape[1]) - variable_weights_tau = np.repeat(1.0/X_train_tau.shape[1], X_train_tau.shape[1]) - - # Scale outcome - self.y_bar = np.squeeze(np.mean(y_train)) - self.y_std = np.squeeze(np.std(y_train)) - resid_train = (y_train-self.y_bar)/self.y_std - - # Calibrate priors for global sigma^2 and sigma_leaf_mu / sigma_leaf_tau - if lamb is None: - reg_basis = np.c_[np.ones(self.n_train),X_train] - reg_soln = lstsq(reg_basis, np.squeeze(resid_train)) - sigma2hat = reg_soln[1] / self.n_train - quantile_cutoff = q - lamb = (sigma2hat*gamma.ppf(1-quantile_cutoff,nu))/nu - sigma2 = sigma2hat if sigma2 is None else sigma2 - b_leaf_mu = np.squeeze(np.var(resid_train)) / num_trees_mu if b_leaf_mu is None else b_leaf_mu - b_leaf_tau = np.squeeze(np.var(resid_train)) / (2*num_trees_tau) if b_leaf_tau is None else b_leaf_tau - sigma_leaf_mu = np.squeeze(np.var(resid_train)) / num_trees_mu if sigma_leaf_mu is None else sigma_leaf_mu - sigma_leaf_tau = np.squeeze(np.var(resid_train)) / (2*num_trees_tau) if sigma_leaf_tau is None else sigma_leaf_tau - current_sigma2 = sigma2 - current_leaf_scale_mu = np.array([[sigma_leaf_mu]]) - current_leaf_scale_tau = np.array([[sigma_leaf_tau]]) - - # Container of variance parameter samples - self.num_gfr = num_gfr - self.num_burnin = num_burnin - self.num_mcmc = num_mcmc - self.num_samples = num_gfr + num_burnin + num_mcmc - self.sample_sigma_global = sample_sigma_global - self.sample_sigma_leaf_mu = sample_sigma_leaf_mu - self.sample_sigma_leaf_tau = sample_sigma_leaf_tau - if sample_sigma_global: - self.global_var_samples = np.zeros(self.num_samples) - if sample_sigma_leaf_mu: - self.leaf_scale_mu_samples = np.zeros(self.num_samples) - if sample_sigma_leaf_tau: - self.leaf_scale_tau_samples = np.zeros(self.num_samples) - - # Prepare adaptive coding structure - if self.adaptive_coding: - if np.size(b_0) > 1 or np.size(b_1) > 1: - raise ValueError("b_0 and b_1 must be single numeric values") - if not (isinstance(b_0, (int, float)) or isinstance(b_1, (int, float))): - raise ValueError("b_0 and b_1 must be numeric values") - self.b0_samples = np.zeros(self.num_samples) - self.b1_samples = np.zeros(self.num_samples) - current_b_0 = b_0 - current_b_1 = b_1 - tau_basis_train = (1-Z_train)*current_b_0 + Z_train*current_b_1 - if self.has_test: - tau_basis_test = (1-Z_test)*current_b_0 + Z_test*current_b_1 - else: - tau_basis_train = Z_train - if self.has_test: - tau_basis_test = Z_test - - # Prognostic Forest Dataset (covariates) - forest_dataset_mu_train = Dataset() - forest_dataset_mu_train.add_covariates(X_train_mu) - if self.has_test: - forest_dataset_mu_test = Dataset() - forest_dataset_mu_test.add_covariates(X_test_mu) - - # Treatment Forest Dataset (covariates and treatment variable) - forest_dataset_tau_train = Dataset() - forest_dataset_tau_train.add_covariates(X_train_tau) - forest_dataset_tau_train.add_basis(tau_basis_train) - if self.has_test: - forest_dataset_tau_test = Dataset() - forest_dataset_tau_test.add_covariates(X_test_tau) - forest_dataset_tau_test.add_basis(tau_basis_test) - - # Residual - residual_train = Residual(resid_train) - - # C++ random number generator - if random_seed is None: - cpp_rng = RNG(-1) - else: - cpp_rng = RNG(random_seed) - - # Sampling data structures - forest_sampler_mu = ForestSampler(forest_dataset_mu_train, feature_types_mu, num_trees_mu, self.n_train, alpha_mu, beta_mu, min_samples_leaf_mu) - forest_sampler_tau = ForestSampler(forest_dataset_tau_train, feature_types_tau, num_trees_tau, self.n_train, alpha_tau, beta_tau, min_samples_leaf_tau) - - # Container of forest samples - self.forest_container_mu = ForestContainer(num_trees_mu, 1, True) - self.forest_container_tau = ForestContainer(num_trees_tau, Z_train.shape[1], False) - - # Variance samplers - if self.sample_sigma_global: - global_var_model = GlobalVarianceModel() - if self.sample_sigma_leaf_mu: - leaf_var_model_mu = LeafVarianceModel() - if self.sample_sigma_leaf_tau: - leaf_var_model_tau = LeafVarianceModel() - - # Initialize the leaves of each tree in the prognostic forest - init_mu = np.squeeze(np.mean(resid_train)) / num_trees_mu - self.forest_container_mu.set_root_leaves(0, init_mu) - forest_sampler_mu.update_residual(forest_dataset_mu_train, residual_train, self.forest_container_mu, False, 0, True) - - # Initialize the leaves of each tree in the treatment forest - self.forest_container_tau.set_root_leaves(0, 0.) - forest_sampler_tau.update_residual(forest_dataset_tau_train, residual_train, self.forest_container_tau, True, 0, True) - - # Run GFR (warm start) if specified - if self.num_gfr > 0: - gfr_indices = np.arange(self.num_gfr) - for i in range(self.num_gfr): - # Sample the prognostic forest - forest_sampler_mu.sample_one_iteration( - self.forest_container_mu, forest_dataset_mu_train, residual_train, cpp_rng, feature_types_mu, - cutpoint_grid_size, current_leaf_scale_mu, variable_weights_mu, current_sigma2, 0, True, True - ) - - # Sample variance parameters (if requested) - if self.sample_sigma_global: - current_sigma2 = global_var_model.sample_one_iteration(residual_train, cpp_rng, nu, lamb) - self.global_var_samples[i] = current_sigma2*self.y_std*self.y_std - if self.sample_sigma_leaf_mu: - self.leaf_scale_mu_samples[i] = leaf_var_model_mu.sample_one_iteration(self.forest_container_mu, cpp_rng, a_leaf_mu, b_leaf_mu, i) - current_leaf_scale_mu[0,0] = self.leaf_scale_mu_samples[i] - - # Sample the treatment forest - forest_sampler_tau.sample_one_iteration( - self.forest_container_tau, forest_dataset_tau_train, residual_train, cpp_rng, feature_types_tau, - cutpoint_grid_size, current_leaf_scale_tau, variable_weights_tau, current_sigma2, 1, True, True - ) - - # Sample variance parameters (if requested) - if self.sample_sigma_global: - current_sigma2 = global_var_model.sample_one_iteration(residual_train, cpp_rng, nu, lamb) - self.global_var_samples[i] = current_sigma2*self.y_std*self.y_std - if self.sample_sigma_leaf_tau: - self.leaf_scale_tau_samples[i] = leaf_var_model_tau.sample_one_iteration(self.forest_container_tau, cpp_rng, a_leaf_tau, b_leaf_tau, i) - current_leaf_scale_tau[0,0] = self.leaf_scale_tau_samples[i] - - # Sample coding parameters (if requested) - if self.adaptive_coding: - mu_x = self.forest_container_mu.predict_raw_single_forest(forest_dataset_mu_train, i) - tau_x = np.squeeze(self.forest_container_tau.predict_raw_single_forest(forest_dataset_tau_train, i)) - s_tt0 = np.sum(tau_x*tau_x*(np.squeeze(Z_train)==0)) - s_tt1 = np.sum(tau_x*tau_x*(np.squeeze(Z_train)==1)) - partial_resid_mu = np.squeeze(resid_train - mu_x) - s_ty0 = np.sum(tau_x*partial_resid_mu*(np.squeeze(Z_train)==0)) - s_ty1 = np.sum(tau_x*partial_resid_mu*(np.squeeze(Z_train)==1)) - current_b_0 = self.rng.normal(loc = (s_ty0/(s_tt0 + 2*current_sigma2)), - scale = np.sqrt(current_sigma2/(s_tt0 + 2*current_sigma2)), size = 1) - current_b_1 = self.rng.normal(loc = (s_ty1/(s_tt1 + 2*current_sigma2)), - scale = np.sqrt(current_sigma2/(s_tt1 + 2*current_sigma2)), size = 1) - tau_basis_train = (1-np.squeeze(Z_train))*current_b_0 + np.squeeze(Z_train)*current_b_1 - forest_dataset_tau_train.update_basis(tau_basis_train) - if self.has_test: - tau_basis_test = (1-np.squeeze(Z_test))*current_b_0 + np.squeeze(Z_test)*current_b_1 - forest_dataset_tau_test.update_basis(tau_basis_test) - self.b0_samples[i] = current_b_0 - self.b1_samples[i] = current_b_1 - - # Run MCMC - if self.num_burnin + self.num_mcmc > 0: - if self.num_burnin > 0: - burnin_indices = np.arange(self.num_gfr, self.num_gfr + self.num_burnin) - if self.num_mcmc > 0: - mcmc_indices = np.arange(self.num_gfr + self.num_burnin, self.num_gfr + self.num_burnin + self.num_mcmc) - for i in range(self.num_gfr, self.num_samples): - # Sample the prognostic forest - forest_sampler_mu.sample_one_iteration( - self.forest_container_mu, forest_dataset_mu_train, residual_train, cpp_rng, feature_types_mu, - cutpoint_grid_size, current_leaf_scale_mu, variable_weights_mu, current_sigma2, 0, False, True - ) - - # Sample variance parameters (if requested) - if self.sample_sigma_global: - current_sigma2 = global_var_model.sample_one_iteration(residual_train, cpp_rng, nu, lamb) - self.global_var_samples[i] = current_sigma2*self.y_std*self.y_std - if self.sample_sigma_leaf_mu: - self.leaf_scale_mu_samples[i] = leaf_var_model_mu.sample_one_iteration(self.forest_container_mu, cpp_rng, a_leaf_mu, b_leaf_mu, i) - current_leaf_scale_mu[0,0] = self.leaf_scale_mu_samples[i] - - # Sample the treatment forest - forest_sampler_tau.sample_one_iteration( - self.forest_container_tau, forest_dataset_tau_train, residual_train, cpp_rng, feature_types_tau, - cutpoint_grid_size, current_leaf_scale_tau, variable_weights_tau, current_sigma2, 1, False, True - ) - - # Sample variance parameters (if requested) - if self.sample_sigma_global: - current_sigma2 = global_var_model.sample_one_iteration(residual_train, cpp_rng, nu, lamb) - self.global_var_samples[i] = current_sigma2*self.y_std*self.y_std - if self.sample_sigma_leaf_tau: - self.leaf_scale_tau_samples[i] = leaf_var_model_tau.sample_one_iteration(self.forest_container_tau, cpp_rng, a_leaf_tau, b_leaf_tau, i) - current_leaf_scale_tau[0,0] = self.leaf_scale_tau_samples[i] - - # Sample coding parameters (if requested) - if self.adaptive_coding: - mu_x = self.forest_container_mu.predict_raw_single_forest(forest_dataset_mu_train, i) - tau_x = np.squeeze(self.forest_container_tau.predict_raw_single_forest(forest_dataset_tau_train, i)) - s_tt0 = np.sum(tau_x*tau_x*(np.squeeze(Z_train)==0)) - s_tt1 = np.sum(tau_x*tau_x*(np.squeeze(Z_train)==1)) - partial_resid_mu = np.squeeze(resid_train - mu_x) - s_ty0 = np.sum(tau_x*partial_resid_mu*(np.squeeze(Z_train)==0)) - s_ty1 = np.sum(tau_x*partial_resid_mu*(np.squeeze(Z_train)==1)) - current_b_0 = self.rng.normal(loc = (s_ty0/(s_tt0 + 2*current_sigma2)), - scale = np.sqrt(current_sigma2/(s_tt0 + 2*current_sigma2)), size = 1) - current_b_1 = self.rng.normal(loc = (s_ty1/(s_tt1 + 2*current_sigma2)), - scale = np.sqrt(current_sigma2/(s_tt1 + 2*current_sigma2)), size = 1) - tau_basis_train = (1-np.squeeze(Z_train))*current_b_0 + np.squeeze(Z_train)*current_b_1 - forest_dataset_tau_train.update_basis(tau_basis_train) - if self.has_test: - tau_basis_test = (1-np.squeeze(Z_test))*current_b_0 + np.squeeze(Z_test)*current_b_1 - forest_dataset_tau_test.update_basis(tau_basis_test) - self.b0_samples[i] = current_b_0 - self.b1_samples[i] = current_b_1 - - # Mark the model as sampled - self.sampled = True - - # Prediction indices to be stored - if self.num_mcmc > 0: - self.keep_indices = mcmc_indices - if keep_gfr: - self.keep_indices = np.concatenate((gfr_indices, self.keep_indices)) - else: - # Don't retain both GFR and burnin samples - if keep_burnin: - self.keep_indices = np.concatenate((burnin_indices, self.keep_indices)) - else: - if self.num_gfr > 0 and self.num_burnin > 0: - # Override keep_gfr = False since there are no MCMC samples - # Don't retain both GFR and burnin samples - self.keep_indices = gfr_indices - elif self.num_gfr <= 0 and self.num_burnin > 0: - self.keep_indices = burnin_indices - elif self.num_gfr > 0 and self.num_burnin <= 0: - self.keep_indices = gfr_indices - else: - raise RuntimeError("There are no samples to retain!") - - # Store predictions - mu_raw = self.forest_container_mu.forest_container_cpp.Predict(forest_dataset_mu_train.dataset_cpp) - self.mu_hat_train = mu_raw[:,self.keep_indices]*self.y_std + self.y_bar - tau_raw = self.forest_container_tau.forest_container_cpp.PredictRaw(forest_dataset_tau_train.dataset_cpp) - self.tau_hat_train = tau_raw[:,self.keep_indices]*self.y_std - if self.adaptive_coding: - adaptive_coding_weights = np.expand_dims(self.b1_samples[self.keep_indices] - self.b0_samples[self.keep_indices], axis=(0,2)) - self.tau_hat_train = self.tau_hat_train*adaptive_coding_weights - self.y_hat_train = self.mu_hat_train + Z_train*np.squeeze(self.tau_hat_train) - if self.has_test: - mu_raw_test = self.forest_container_mu.forest_container_cpp.Predict(forest_dataset_mu_test.dataset_cpp) - self.mu_hat_test = mu_raw_test[:,self.keep_indices]*self.y_std + self.y_bar - tau_raw_test = self.forest_container_tau.forest_container_cpp.PredictRaw(forest_dataset_tau_test.dataset_cpp) - self.tau_hat_test = tau_raw_test[:,self.keep_indices]*self.y_std - if self.adaptive_coding: - adaptive_coding_weights_test = np.expand_dims(self.b1_samples[self.keep_indices] - self.b0_samples[self.keep_indices], axis=(0,2)) - self.tau_hat_test = self.tau_hat_test*adaptive_coding_weights_test - self.y_hat_test = self.mu_hat_test + Z_test*np.squeeze(self.tau_hat_test) - - def predict_tau(self, X: np.array, Z: np.array, propensity: np.array = None) -> np.array: - """Predict CATE function for every provided observation. - - :param X: Test set covariates - :type X: np.array - :param Z: Test set treatment indicators - :type Z: np.array - :param propensity: Optional test set propensities. Must be provided if propensities were provided when ``.sample()`` was run and propensity scores were included in the CATE model. - :type propensity: np.array, optional - :return: Array with as many rows as in ``X`` and as many columns as retained samples of the algorithm. - :rtype: np.array - """ - if not self.is_sampled(): - msg = ( - "This BCFModel instance is not fitted yet. Call 'fit' with " - "appropriate arguments before using this model." - ) - raise NotSampledError(msg) - - # Convert everything to standard shape (2-dimensional) - if X.ndim == 1: - X = np.expand_dims(X, 1) - if Z.ndim == 1: - Z = np.expand_dims(Z, 1) - if propensity is not None: - if propensity.ndim == 1: - propensity = np.expand_dims(propensity, 1) - - # Data checks - if Z.shape[0] != X.shape[0]: - raise ValueError("X and Z must have the same number of rows") - if propensity is not None: - if propensity.shape[0] != X.shape[0]: - raise ValueError("X and propensity must have the same number of rows") - else: - if self.propensity_covariate == "tau": - if not self.internal_propensity_model: - raise ValueError("Propensity scores not provided, but no propensity model was trained during sampling") - else: - propensity = np.mean(self.bart_propensity_model.predict(X), axis=1, keepdims=True) - - # Update covariates to include propensities if requested - if self.propensity_covariate == "tau": - X_tau = np.c_[X, propensity] - else: - X_tau = X - - # Treatment Forest Dataset (covariates and treatment variable) - forest_dataset_tau = Dataset() - forest_dataset_tau.add_covariates(X_tau) - forest_dataset_tau.add_basis(Z) - - # Estimate treatment effect - tau_raw = self.forest_container_tau.forest_container_cpp.PredictRaw(forest_dataset_tau.dataset_cpp) - tau_raw = tau_raw*self.y_std - if self.adaptive_coding: - tau_raw = tau_raw*np.expand_dims(self.b1_samples - self.b0_samples, axis=(0,2)) - tau_x = tau_raw[:,self.keep_indices] - - # Return result matrices as a tuple - return tau_x - - def predict(self, X: np.array, Z: np.array, propensity: np.array = None) -> np.array: - """Predict outcome model components (CATE function and prognostic function) as well as overall outcome for every provided observation. - Predicted outcomes are computed as ``yhat = mu_x + Z*tau_x`` where mu_x is a sample of the prognostic function and tau_x is a sample of the treatment effect (CATE) function. - - :param X: Test set covariates - :type X: np.array - :param Z: Test set treatment indicators - :type Z: np.array - :param propensity: Optional test set propensities. Must be provided if propensities were provided when ``.sample()`` was run. - :type propensity: np.array, optional - :return: Tuple of arrays with as many rows as in ``X`` and as many columns as retained samples of the algorithm. The first entry of the tuple contains conditional average treatment effect (CATE) samples, the second entry contains prognostic effect samples, and the third entry contains outcome prediction samples - :rtype: tuple - """ - if not self.is_sampled(): - msg = ( - "This BCFModel instance is not fitted yet. Call 'fit' with " - "appropriate arguments before using this model." - ) - raise NotSampledError(msg) - - # Convert everything to standard shape (2-dimensional) - if X.ndim == 1: - X = np.expand_dims(X, 1) - if Z.ndim == 1: - Z = np.expand_dims(Z, 1) - if propensity is not None: - if propensity.ndim == 1: - propensity = np.expand_dims(propensity, 1) - - # Data checks - if Z.shape[0] != X.shape[0]: - raise ValueError("X and Z must have the same number of rows") - if propensity is not None: - if propensity.shape[0] != X.shape[0]: - raise ValueError("X and propensity must have the same number of rows") - else: - if self.propensity_covariate != "none": - if not self.internal_propensity_model: - raise ValueError("Propensity scores not provided, but no propensity model was trained during sampling") - else: - propensity = np.mean(self.bart_propensity_model.predict(X), axis=1, keepdims=True) - - # Update covariates to include propensities if requested - if self.propensity_covariate == "mu": - X_mu = np.c_[X, propensity] - X_tau = X - elif self.propensity_covariate == "tau": - X_mu = X - X_tau = np.c_[X, propensity] - elif self.propensity_covariate == "both": - X_mu = np.c_[X, propensity] - X_tau = np.c_[X, propensity] - elif self.propensity_covariate == "none": - X_mu = X - X_tau = X - - # Prognostic Forest Dataset (covariates) - forest_dataset_mu = Dataset() - forest_dataset_mu.add_covariates(X_mu) - - # Treatment Forest Dataset (covariates and treatment variable) - forest_dataset_tau = Dataset() - forest_dataset_tau.add_covariates(X_tau) - forest_dataset_tau.add_basis(Z) - - # Estimate prognostic term - mu_raw = self.forest_container_mu.forest_container_cpp.Predict(forest_dataset_mu.dataset_cpp) - mu_x = mu_raw[:,self.keep_indices]*self.y_std + self.y_bar - - # Estimate treatment effect - tau_raw = self.forest_container_tau.forest_container_cpp.PredictRaw(forest_dataset_tau.dataset_cpp) - tau_raw = tau_raw*self.y_std - if self.adaptive_coding: - tau_raw = tau_raw*np.expand_dims(self.b1_samples - self.b0_samples, axis=(0,2)) - tau_x = tau_raw[:,self.keep_indices] - - # Outcome predictions - yhat_x = mu_x + Z*tau_x - - # Return result matrices as a tuple - return (tau_x, mu_x, yhat_x) diff --git a/stochtree/data.py b/stochtree/data.py deleted file mode 100644 index 20b01e6..0000000 --- a/stochtree/data.py +++ /dev/null @@ -1,50 +0,0 @@ -""" -Python classes wrapping C++ data objects -""" -import numpy as np -from stochtree_cpp import ForestDatasetCpp, ResidualCpp - -class Dataset: - def __init__(self) -> None: - # Initialize a ForestDatasetCpp object - self.dataset_cpp = ForestDatasetCpp() - - def add_covariates(self, covariates: np.array): - """ - Add covariates to a dataset - """ - covariates_ = np.expand_dims(covariates, 1) if np.ndim(covariates) == 1 else covariates - n, p = covariates_.shape - covariates_rowmajor = np.ascontiguousarray(covariates) - self.dataset_cpp.AddCovariates(covariates_rowmajor, n, p, True) - - def add_basis(self, basis: np.array): - """ - Add basis matrix to a dataset - """ - basis_ = np.expand_dims(basis, 1) if np.ndim(basis) == 1 else basis - n, p = basis_.shape - basis_rowmajor = np.ascontiguousarray(basis_) - self.dataset_cpp.AddBasis(basis_rowmajor, n, p, True) - - def update_basis(self, basis: np.array): - """ - Update basis matrix in a dataset - """ - basis_ = np.expand_dims(basis, 1) if np.ndim(basis) == 1 else basis - n, p = basis_.shape - basis_rowmajor = np.ascontiguousarray(basis_) - self.dataset_cpp.UpdateBasis(basis_rowmajor, n, p, True) - - def add_variance_weights(self, variance_weights: np.array): - """ - Add variance weights to a dataset - """ - n = variance_weights.size - self.dataset_cpp.AddVarianceWeights(variance_weights, n) - -class Residual: - def __init__(self, residual: np.array) -> None: - # Initialize a ResidualCpp object - n = residual.size - self.residual_cpp = ResidualCpp(residual, n) diff --git a/stochtree/forest.py b/stochtree/forest.py deleted file mode 100644 index 9b80e58..0000000 --- a/stochtree/forest.py +++ /dev/null @@ -1,44 +0,0 @@ -""" -Python classes wrapping C++ forest container object -""" -import numpy as np -from .data import Dataset, Residual -# from .serialization import JSONSerializer -from stochtree_cpp import ForestContainerCpp -from typing import Union - -class ForestContainer: - def __init__(self, num_trees: int, output_dimension: int, leaf_constant: bool) -> None: - # Initialize a ForestContainerCpp object - self.forest_container_cpp = ForestContainerCpp(num_trees, output_dimension, leaf_constant) - - def predict(self, dataset: Dataset) -> np.array: - # Predict samples from Dataset - return self.forest_container_cpp.Predict(dataset.dataset_cpp) - - def predict_raw(self, dataset: Dataset) -> np.array: - # Predict raw leaf values for a specific forest (indexed by forest_num) from Dataset - return self.forest_container_cpp.PredictRaw(dataset.dataset_cpp) - - def predict_raw_single_forest(self, dataset: Dataset, forest_num: int) -> np.array: - # Predict raw leaf values for a specific forest (indexed by forest_num) from Dataset - return self.forest_container_cpp.PredictRawSingleForest(dataset.dataset_cpp, forest_num) - - def set_root_leaves(self, forest_num: int, leaf_value: Union[float, np.array]) -> None: - # Predict raw leaf values for a specific forest (indexed by forest_num) from Dataset - if not isinstance(leaf_value, np.ndarray) and not isinstance(leaf_value, float): - raise ValueError("leaf_value must be either a floating point number or a numpy array") - if isinstance(leaf_value, np.ndarray): - leaf_value = np.squeeze(leaf_value) - if len(leaf_value.shape) != 1: - raise ValueError("leaf_value must be either a one-dimensional array") - self.forest_container_cpp.SetRootVector(forest_num, leaf_value, leaf_value.shape[0]) - else: - self.forest_container_cpp.SetRootValue(forest_num, leaf_value) - - def save_to_json_file(self, json_filename: str) -> None: - self.forest_container_cpp.SaveToJsonFile(json_filename) - - def load_from_json_file(self, json_filename: str) -> None: - self.forest_container_cpp.LoadFromJsonFile(json_filename) - \ No newline at end of file diff --git a/stochtree/sampler.py b/stochtree/sampler.py deleted file mode 100644 index 8b1a1ab..0000000 --- a/stochtree/sampler.py +++ /dev/null @@ -1,55 +0,0 @@ -""" -Python classes wrapping C++ sampler objects -""" -import numpy as np -from .data import Dataset, Residual -from .forest import ForestContainer -from stochtree_cpp import RngCpp, ForestSamplerCpp, GlobalVarianceModelCpp, LeafVarianceModelCpp - -class RNG: - def __init__(self, random_seed: int) -> None: - # Initialize a ForestDatasetCpp object - self.rng_cpp = RngCpp(random_seed) - - -class ForestSampler: - def __init__(self, dataset: Dataset, feature_types: np.array, num_trees: int, num_obs: int, alpha: float, beta: float, min_samples_leaf: int) -> None: - # Initialize a ForestDatasetCpp object - self.forest_sampler_cpp = ForestSamplerCpp(dataset.dataset_cpp, feature_types, num_trees, num_obs, alpha, beta, min_samples_leaf) - - def sample_one_iteration(self, forest_container: ForestContainer, dataset: Dataset, residual: Residual, rng: RNG, - feature_types: np.array, cutpoint_grid_size: int, leaf_model_scale_input: np.array, - variable_weights: np.array, global_variance: float, leaf_model_int: int, gfr: bool, pre_initialized: bool): - """ - Sample one iteration of a forest using the specified model and tree sampling algorithm - """ - self.forest_sampler_cpp.SampleOneIteration(forest_container.forest_container_cpp, dataset.dataset_cpp, residual.residual_cpp, rng.rng_cpp, - feature_types, cutpoint_grid_size, leaf_model_scale_input, variable_weights, - global_variance, leaf_model_int, gfr, pre_initialized) - - def update_residual(self, dataset: Dataset, residual: Residual, forest_container: ForestContainer, requires_basis: bool, forest_num: int, add: bool) -> None: - forest_container.forest_container_cpp.UpdateResidual(dataset.dataset_cpp, residual.residual_cpp, self.forest_sampler_cpp, requires_basis, forest_num, add) - - -class GlobalVarianceModel: - def __init__(self) -> None: - # Initialize a GlobalVarianceModelCpp object - self.variance_model_cpp = GlobalVarianceModelCpp() - - def sample_one_iteration(self, residual: Residual, rng: RNG, nu: float, lamb: float) -> float: - """ - Sample one iteration of a forest using the specified model and tree sampling algorithm - """ - return self.variance_model_cpp.SampleOneIteration(residual.residual_cpp, rng.rng_cpp, nu, lamb) - - -class LeafVarianceModel: - def __init__(self) -> None: - # Initialize a LeafVarianceModelCpp object - self.variance_model_cpp = LeafVarianceModelCpp() - - def sample_one_iteration(self, forest_container: ForestContainer, rng: RNG, a: float, b: float, sample_num: int) -> float: - """ - Sample one iteration of a forest using the specified model and tree sampling algorithm - """ - return self.variance_model_cpp.SampleOneIteration(forest_container.forest_container_cpp, rng.rng_cpp, a, b, sample_num) diff --git a/stochtree/serialization.py b/stochtree/serialization.py deleted file mode 100644 index 9c7d04b..0000000 --- a/stochtree/serialization.py +++ /dev/null @@ -1,183 +0,0 @@ -import warnings -import numpy as np -import pandas as pd -from scipy.linalg import lstsq -from scipy.stats import gamma -from .forest import ForestContainer -from stochtree_cpp import JsonCpp - -class JSONSerializer: - """Class that handles serialization and deserialization of stochastic forest models - """ - - def __init__(self) -> None: - self.json_cpp = JsonCpp() - self.num_forests = 0 - self.forest_labels = [] - - def add_forest(self, forest_samples: ForestContainer) -> None: - """Adds a container of forest samples to a json object - - :param forest_samples: Samples of a tree ensemble - :type forest_samples: ForestContainer - """ - forest_label = self.json_cpp.AddForest(forest_samples.forest_container_cpp) - self.num_forests += 1 - self.forest_labels.append(forest_label) - - def add_scalar(self, field_name: str, field_value: float, subfolder_name: str = None) -> None: - """Adds a scalar (numeric) value to a json object - - :param field_name: Name of the json field / label under which the numeric value will be stored - :type field_name: str - :param field_value: Numeric value to be stored - :type field_value: float - :param subfolder_name: Name of "subfolder" under which ``field_name`` to be stored in the json hierarchy - :type subfolder_name: str, optional - """ - if subfolder_name is None: - self.json_cpp.AddDouble(field_name, field_value) - else: - self.json_cpp.AddDoubleSubfolder(subfolder_name, field_name, field_value) - - def add_boolean(self, field_name: str, field_value: bool, subfolder_name: str = None) -> None: - """Adds a scalar (boolean) value to a json object - - :param field_name: Name of the json field / label under which the boolean value will be stored - :type field_name: str - :param field_value: Boolean value to be stored - :type field_value: bool - :param subfolder_name: Name of "subfolder" under which ``field_name`` to be stored in the json hierarchy - :type subfolder_name: str, optional - """ - if subfolder_name is None: - self.json_cpp.AddBool(field_name, field_value) - else: - self.json_cpp.AddBoolSubfolder(subfolder_name, field_name, field_value) - - def add_string(self, field_name: str, field_value: str, subfolder_name: str = None) -> None: - """Adds a string to a json object - - :param field_name: Name of the json field / label under which the numeric value will be stored - :type field_name: str - :param field_value: String field to be stored - :type field_value: str - :param subfolder_name: Name of "subfolder" under which ``field_name`` to be stored in the json hierarchy - :type subfolder_name: str, optional - """ - if subfolder_name is None: - self.json_cpp.AddString(field_name, field_value) - else: - self.json_cpp.AddStringSubfolder(subfolder_name, field_name, field_value) - - def add_numeric_vector(self, field_name: str, field_vector: np.array, subfolder_name: str = None) -> None: - """Adds a numeric vector (stored as a numpy array) to a json object - - :param field_name: Name of the json field / label under which the numeric vector will be stored - :type field_name: str - :param field_vector: Numpy array containing the vector to be stored in json. Should be one-dimensional. - :type field_vector: np.array - :param subfolder_name: Name of "subfolder" under which ``field_name`` to be stored in the json hierarchy - :type subfolder_name: str, optional - """ - # Runtime checks - if not isinstance(field_vector, np.ndarray): - raise ValueError("field_vector must be a numpy array") - field_vector = np.squeeze(field_vector) - if field_vector.ndim > 1: - warnings.warn("field_vector has more than 1 dimension. It will be flattened in row-major order using np.ravel()") - field_vector = np.ravel(field_vector, order = "C") - - if subfolder_name is None: - self.json_cpp.AddDoubleVector(field_name, field_vector) - else: - self.json_cpp.AddDoubleVectorSubfolder(subfolder_name, field_name, field_vector) - - def add_string_vector(self, field_name: str, field_vector: list, subfolder_name: str = None) -> None: - """Adds a list of strings to a json object as an array - - :param field_name: Name of the json field / label under which the string list will be stored - :type field_name: str - :param field_vector: Python list of strings containing the array to be stored in json - :type field_vector: list - :param subfolder_name: Name of "subfolder" under which ``field_name`` to be stored in the json hierarchy - :type subfolder_name: str, optional - """ - # Runtime checks - if not isinstance(field_vector, list): - raise ValueError("field_vector must be a list") - - if subfolder_name is None: - self.json_cpp.AddStringVector(field_name, field_vector) - else: - self.json_cpp.AddStringVectorSubfolder(subfolder_name, field_name, field_vector) - - def get_scalar(self, field_name: str, subfolder_name: str = None) -> float: - """Retrieves a scalar (numeric) value from a json object - - :param field_name: Name of the json field / label under which the numeric value is stored - :type field_name: str - :param subfolder_name: Name of "subfolder" under which ``field_name`` is stored in the json hierarchy - :type subfolder_name: str, optional - """ - if subfolder_name is None: - return self.json_cpp.ExtractDouble(field_name) - else: - return self.json_cpp.ExtractDoubleSubfolder(subfolder_name, field_name) - - def get_boolean(self, field_name: str, subfolder_name: str = None) -> bool: - """Retrieves a scalar (boolean) value from a json object - - :param field_name: Name of the json field / label under which the boolean value is stored - :type field_name: str - :param subfolder_name: Name of "subfolder" under which ``field_name`` is stored in the json hierarchy - :type subfolder_name: str, optional - """ - if subfolder_name is None: - return self.json_cpp.ExtractBool(field_name) - else: - return self.json_cpp.ExtractBoolSubfolder(subfolder_name, field_name) - - def get_string(self, field_name: str, subfolder_name: str = None) -> str: - """Retrieve a string to a json object - - :param field_name: Name of the json field / label under which the numeric value is stored - :type field_name: str - :param subfolder_name: Name of "subfolder" under which ``field_name`` is stored in the json hierarchy - :type subfolder_name: str, optional - """ - if subfolder_name is None: - return self.json_cpp.ExtractString(field_name) - else: - return self.json_cpp.ExtractStringSubfolder(subfolder_name, field_name) - - def get_numeric_vector(self, field_name: str, subfolder_name: str = None) -> np.array: - """Adds a string to a json object - - :param field_name: Name of the json field / label under which the numeric vector is stored - :type field_name: str - :param subfolder_name: Name of "subfolder" under which ``field_name`` to be stored in the json hierarchy - :type subfolder_name: str, optional - """ - if subfolder_name is None: - return self.json_cpp.ExtractDoubleVector(field_name) - else: - return self.json_cpp.ExtractDoubleVectorSubfolder(subfolder_name, field_name) - - def get_string_vector(self, field_name: str, subfolder_name: str = None) -> list: - """Adds a string to a json object - - :param field_name: Name of the json field / label under which the string list is stored - :type field_name: str - :param subfolder_name: Name of "subfolder" under which ``field_name`` to be stored in the json hierarchy - :type subfolder_name: str, optional - """ - if subfolder_name is None: - return self.json_cpp.ExtractStringVector(field_name) - else: - return self.json_cpp.ExtractStringVectorSubfolder(subfolder_name, field_name) - - def get_forest_container(self, forest_label: str) -> ForestContainer: - result = ForestContainer(0, 1, True) - result.forest_container_cpp.LoadFromJson(self.json_cpp, forest_label) - return result diff --git a/stochtree/utils.py b/stochtree/utils.py deleted file mode 100644 index 2e67743..0000000 --- a/stochtree/utils.py +++ /dev/null @@ -1,10 +0,0 @@ - -class NotSampledError(ValueError, AttributeError): - """Exception class to raise if attempting to predict from a model before it has been sampled. - - This class inherits from both ValueError and AttributeError to help with - exception handling and backward compatibility. - - Renamed from scikit-learn's "NotFittedError" - https://github.com/scikit-learn/scikit-learn/blob/8721245511de2f225ff5f9aa5f5fadce663cd4a3/sklearn/exceptions.py#L45C7-L45C21 - """ \ No newline at end of file diff --git a/test/test_json.py b/test/test_json.py deleted file mode 100644 index db88d3d..0000000 --- a/test/test_json.py +++ /dev/null @@ -1,71 +0,0 @@ -import numpy as np -from stochtree import BARTModel, JSONSerializer, ForestContainer, Dataset - -class TestJson: - def test_value(self): - json_test = JSONSerializer() - a = 1.5 - b = True - c = "Example" - json_test.add_scalar("a", a) - json_test.add_boolean("b", b) - json_test.add_string("c", c) - assert a == json_test.get_scalar("a") - assert b == json_test.get_boolean("b") - assert c == json_test.get_string("c") - - def test_array(self): - json_test = JSONSerializer() - a = np.array([1.5,2.4,3.3]) - b = ["a","b","c"] - json_test.add_numeric_vector("a", a) - json_test.add_string_vector("b", b) - np.testing.assert_array_equal(a, json_test.get_numeric_vector("a")) - assert b == json_test.get_string_vector("b") - - def test_forest(self): - # Generate sample data - random_seed = 1234 - rng = np.random.default_rng(random_seed) - n = 1000 - p_X = 10 - p_W = 1 - X = rng.uniform(0, 1, (n, p_X)) - def outcome_mean(X): - return np.where( - (X[:,0] >= 0.0) & (X[:,0] < 0.25), -7.5, - np.where( - (X[:,0] >= 0.25) & (X[:,0] < 0.5), -2.5, - np.where( - (X[:,0] >= 0.5) & (X[:,0] < 0.75), 2.5, - 7.5 - ) - ) - ) - epsilon = rng.normal(0, 1, n) - y = outcome_mean(X) + epsilon - - # Train a BART model - bart_model = BARTModel() - bart_model.sample(X_train=X, y_train=y, num_gfr=10, num_mcmc=10) - - # Extract original predictions - forest_preds_y_mcmc_cached = bart_model.y_hat_train - - # Extract original predictions - forest_preds_y_mcmc_retrieved = bart_model.predict(X) - - # Roundtrip to / from JSON - json_test = JSONSerializer() - json_test.add_forest(bart_model.forest_container) - forest_container = json_test.get_forest_container("forest_0") - - # Predict from the deserialized forest container - forest_dataset = Dataset() - forest_dataset.add_covariates(X) - forest_preds_json_reload = forest_container.predict(forest_dataset)[:,bart_model.keep_indices] - forest_preds_json_reload = forest_preds_json_reload*bart_model.y_std + bart_model.y_bar - # Check the predictions - np.testing.assert_almost_equal(forest_preds_y_mcmc_cached, forest_preds_json_reload) - np.testing.assert_almost_equal(forest_preds_y_mcmc_retrieved, forest_preds_json_reload) - \ No newline at end of file From bf8f1edd7d6e7c5cf1e79e2cd32ede25171453fe Mon Sep 17 00:00:00 2001 From: Drew Herren Date: Fri, 5 Jul 2024 02:35:57 -0300 Subject: [PATCH 2/4] Removed submodules --- pybind11 | 1 - src/stochtree-cpp | 1 - 2 files changed, 2 deletions(-) delete mode 160000 pybind11 delete mode 160000 src/stochtree-cpp diff --git a/pybind11 b/pybind11 deleted file mode 160000 index 01ab935..0000000 --- a/pybind11 +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 01ab935612a6800c4ad42957808d6cbd30047902 diff --git a/src/stochtree-cpp b/src/stochtree-cpp deleted file mode 160000 index 10c1d07..0000000 --- a/src/stochtree-cpp +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 10c1d0793ab872823a7aebf486cf2a847c402243 From c47b9768c75221968a2446c8b7b689fb143ef5e3 Mon Sep 17 00:00:00 2001 From: Drew Herren Date: Fri, 5 Jul 2024 02:37:06 -0300 Subject: [PATCH 3/4] Removed remaining duplicated source code --- .gitmodules | 0 src/stochtree.cpp | 762 ---------------------------------------------- 2 files changed, 762 deletions(-) delete mode 100644 .gitmodules delete mode 100644 src/stochtree.cpp diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index e69de29..0000000 diff --git a/src/stochtree.cpp b/src/stochtree.cpp deleted file mode 100644 index 0380828..0000000 --- a/src/stochtree.cpp +++ /dev/null @@ -1,762 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define STRINGIFY(x) #x -#define MACRO_STRINGIFY(x) STRINGIFY(x) - -namespace py = pybind11; -using data_size_t = StochTree::data_size_t; - -enum ForestLeafModel { - kConstant, - kUnivariateRegression, - kMultivariateRegression -}; - -class ForestDatasetCpp { - public: - ForestDatasetCpp() { - // Initialize pointer to C++ ForestDataset class - dataset_ = std::make_unique(); - } - ~ForestDatasetCpp() {} - - void AddCovariates(py::array_t covariate_matrix, data_size_t num_row, int num_col, bool row_major) { - // Extract pointer to contiguous block of memory - double* data_ptr = static_cast(covariate_matrix.mutable_data()); - - // Load covariates - dataset_->AddCovariates(data_ptr, num_row, num_col, row_major); - } - - void AddBasis(py::array_t basis_matrix, data_size_t num_row, int num_col, bool row_major) { - // Extract pointer to contiguous block of memory - double* data_ptr = static_cast(basis_matrix.mutable_data()); - - // Load covariates - dataset_->AddBasis(data_ptr, num_row, num_col, row_major); - } - - void UpdateBasis(py::array_t basis_matrix, data_size_t num_row, int num_col, bool row_major) { - // Extract pointer to contiguous block of memory - double* data_ptr = static_cast(basis_matrix.mutable_data()); - - // Load covariates - dataset_->UpdateBasis(data_ptr, num_row, num_col, row_major); - } - - void AddVarianceWeights(py::array_t weight_vector, data_size_t num_row) { - // Extract pointer to contiguous block of memory - double* data_ptr = static_cast(weight_vector.mutable_data()); - - // Load covariates - dataset_->AddVarianceWeights(data_ptr, num_row); - } - - data_size_t NumRows() { - return dataset_->NumObservations(); - } - - StochTree::ForestDataset* GetDataset() { - return dataset_.get(); - } - - private: - std::unique_ptr dataset_; -}; - -class ResidualCpp { - public: - ResidualCpp(py::array_t residual_array, data_size_t num_row) { - // Extract pointer to contiguous block of memory - double* data_ptr = static_cast(residual_array.mutable_data()); - - // Initialize pointer to C++ ColumnVector class - residual_ = std::make_unique(data_ptr, num_row); - } - ~ResidualCpp() {} - - StochTree::ColumnVector* GetData() { - return residual_.get(); - } - - private: - std::unique_ptr residual_; -}; - -class RngCpp { - public: - RngCpp(int random_seed = -1) { - if (random_seed == -1) { - std::random_device rd; - rng_ = std::make_unique(rd()); - } else { - rng_ = std::make_unique(random_seed); - } - } - ~RngCpp() {} - - std::mt19937* GetRng() { - return rng_.get(); - } - - private: - std::unique_ptr rng_; -}; - -// Forward declarations -class ForestSamplerCpp; -class JsonCpp; - -class ForestContainerCpp { - public: - ForestContainerCpp(int num_trees, int output_dimension = 1, bool is_leaf_constant = true) { - // Initialize pointer to C++ ForestContainer class - forest_samples_ = std::make_unique(num_trees, output_dimension, is_leaf_constant); - num_trees_ = num_trees; - output_dimension_ = output_dimension; - is_leaf_constant_ = is_leaf_constant; - } - ~ForestContainerCpp() {} - - int OutputDimension() { - return forest_samples_->OutputDimension(); - } - - int NumSamples() { - return forest_samples_->NumSamples(); - } - - py::array_t Predict(ForestDatasetCpp& dataset) { - // Predict from the forest container - data_size_t n = dataset.NumRows(); - int num_samples = this->NumSamples(); - StochTree::ForestDataset* data_ptr = dataset.GetDataset(); - std::vector output_raw = forest_samples_->Predict(*data_ptr); - - // Convert result to a matrix - auto result = py::array_t(py::detail::any_container({n, num_samples})); - auto accessor = result.mutable_unchecked<2>(); - // py::buffer_info buf = result.request(); - // double *ptr = static_cast(buf.ptr); - for (size_t i = 0; i < n; i++) { - for (int j = 0; j < num_samples; j++) { - // NOTE: converting from "column-major" to "row-major" here - accessor(i,j) = output_raw[j*n + i]; - // ptr[i*num_samples + j] = output_raw[j*n + i]; - } - } - - return result; - } - - py::array_t PredictRaw(ForestDatasetCpp& dataset) { - // Predict from the forest container - data_size_t n = dataset.NumRows(); - int num_samples = this->NumSamples(); - int output_dim = this->OutputDimension(); - StochTree::ForestDataset* data_ptr = dataset.GetDataset(); - std::vector output_raw = forest_samples_->PredictRaw(*data_ptr); - - // Convert result to 3 dimensional array (n x num_samples x output_dim) - auto result = py::array_t(py::detail::any_container({n, num_samples, output_dim})); - auto accessor = result.mutable_unchecked<3>(); - // py::buffer_info buf = result.request(); - // double *ptr = static_cast(buf.ptr); - for (size_t i = 0; i < n; i++) { - for (int j = 0; j < output_dim; j++) { - for (int k = 0; k < num_samples; k++) { - accessor(i,j,k) = output_raw[k*(output_dim*n) + i*output_dim + j]; - // ptr[i*(output_dim*num_samples) + j*output_dim + k] = output_raw[k*(output_dim*n) + i*output_dim + j]; - } - } - } - - return result; - } - - py::array_t PredictRawSingleForest(ForestDatasetCpp& dataset, int forest_num) { - // Predict from the forest container - data_size_t n = dataset.NumRows(); - int num_samples = this->NumSamples(); - int output_dim = this->OutputDimension(); - StochTree::ForestDataset* data_ptr = dataset.GetDataset(); - std::vector output_raw = forest_samples_->PredictRaw(*data_ptr, forest_num); - - // Convert result to a matrix - auto result = py::array_t(py::detail::any_container({n, output_dim})); - auto accessor = result.mutable_unchecked<2>(); - // py::buffer_info buf = result.request(); - // double *ptr = static_cast(buf.ptr); - for (size_t i = 0; i < n; i++) { - for (int j = 0; j < output_dim; j++) { - accessor(i,j) = output_raw[i*output_dim + j]; - // ptr[i*output_dim + j] = output_raw[i*output_dim + j]; - } - } - - return result; - } - - void SetRootValue(int forest_num, double leaf_value) { - forest_samples_->InitializeRoot(leaf_value); - } - - void SetRootVector(int forest_num, py::array_t& leaf_vector, int leaf_size) { - std::vector leaf_vector_converted(leaf_size); - for (int i = 0; i < leaf_size; i++) { - leaf_vector_converted[i] = leaf_vector.at(i); - } - forest_samples_->InitializeRoot(leaf_vector_converted); - } - - void UpdateResidual(ForestDatasetCpp& dataset, ResidualCpp& residual, ForestSamplerCpp& sampler, bool requires_basis, int forest_num, bool add); - - void SaveToJsonFile(std::string json_filename) { - forest_samples_->SaveToJsonFile(json_filename); - } - - void LoadFromJsonFile(std::string json_filename) { - forest_samples_->LoadFromJsonFile(json_filename); - } - - void LoadFromJson(JsonCpp& json, std::string forest_label); - - StochTree::ForestContainer* GetContainer() { - return forest_samples_.get(); - } - - StochTree::TreeEnsemble* GetForest(int i) { - return forest_samples_->GetEnsemble(i); - } - - nlohmann::json ToJson() { - return forest_samples_->to_json(); - } - - private: - std::unique_ptr forest_samples_; - int num_trees_; - int output_dimension_; - bool is_leaf_constant_; -}; - -class ForestSamplerCpp { - public: - ForestSamplerCpp(ForestDatasetCpp& dataset, py::array_t feature_types, int num_trees, data_size_t num_obs, double alpha, double beta, int min_samples_leaf) { - // Convert vector of integers to std::vector of enum FeatureType - std::vector feature_types_(feature_types.size()); - for (int i = 0; i < feature_types.size(); i++) { - feature_types_[i] = static_cast(feature_types.at(i)); - } - - // Initialize pointer to C++ ForestTracker and TreePrior classes - StochTree::ForestDataset* dataset_ptr = dataset.GetDataset(); - tracker_ = std::make_unique(dataset_ptr->GetCovariates(), feature_types_, num_trees, num_obs); - split_prior_ = std::make_unique(alpha, beta, min_samples_leaf); - } - ~ForestSamplerCpp() {} - - StochTree::ForestTracker* GetTracker() {return tracker_.get();} - - void SampleOneIteration(ForestContainerCpp& forest_samples, ForestDatasetCpp& dataset, ResidualCpp& residual, RngCpp& rng, - py::array_t feature_types, int cutpoint_grid_size, py::array_t leaf_model_scale_input, - py::array_t variable_weights, double global_variance, int leaf_model_int, bool gfr = true, bool pre_initialized = false) { - // Unpack feature types - std::vector feature_types_(feature_types.size()); - for (int i = 0; i < feature_types.size(); i++) { - feature_types_[i] = static_cast(feature_types.at(i)); - } - - // Convert leaf model type to enum - ForestLeafModel leaf_model_enum; - if (leaf_model_int == 0) leaf_model_enum = ForestLeafModel::kConstant; - else if (leaf_model_int == 1) leaf_model_enum = ForestLeafModel::kUnivariateRegression; - else if (leaf_model_int == 2) leaf_model_enum = ForestLeafModel::kMultivariateRegression; - - // Unpack leaf model parameters - double leaf_scale; - Eigen::MatrixXd leaf_scale_matrix; - if ((leaf_model_enum == ForestLeafModel::kConstant) || - (leaf_model_enum == ForestLeafModel::kUnivariateRegression)) { - leaf_scale = leaf_model_scale_input.at(0,0); - } else if (leaf_model_enum == ForestLeafModel::kMultivariateRegression) { - int num_row = leaf_model_scale_input.shape(0); - int num_col = leaf_model_scale_input.shape(1); - leaf_scale_matrix.resize(num_row, num_col); - for (int i = 0; i < num_row; i++) { - for (int j = 0; j < num_col; j++) { - leaf_scale_matrix(i,j) = leaf_model_scale_input.at(i,j); - } - } - } - - // Convert variable weights to std::vector - std::vector var_weights_vector(variable_weights.size()); - for (int i = 0; i < variable_weights.size(); i++) { - var_weights_vector[i] = variable_weights.at(i); - } - - // Run one iteration of the sampler - StochTree::ForestContainer* forest_sample_ptr = forest_samples.GetContainer(); - StochTree::ForestDataset* forest_data_ptr = dataset.GetDataset(); - StochTree::ColumnVector* residual_data_ptr = residual.GetData(); - std::mt19937* rng_ptr = rng.GetRng(); - if (gfr) { - InternalSampleGFR(*forest_sample_ptr, *forest_data_ptr, *residual_data_ptr, *rng_ptr, feature_types_, var_weights_vector, - leaf_model_enum, leaf_scale_matrix, global_variance, leaf_scale, cutpoint_grid_size, pre_initialized); - } else { - InternalSampleMCMC(*forest_sample_ptr, *forest_data_ptr, *residual_data_ptr, *rng_ptr, feature_types_, var_weights_vector, - leaf_model_enum, leaf_scale_matrix, global_variance, leaf_scale, cutpoint_grid_size, pre_initialized); - } - } - - private: - std::unique_ptr tracker_; - std::unique_ptr split_prior_; - - void InternalSampleGFR(StochTree::ForestContainer& forest_samples, StochTree::ForestDataset& dataset, StochTree::ColumnVector& residual, std::mt19937& rng, - std::vector& feature_types, std::vector& var_weights_vector, ForestLeafModel leaf_model_enum, - Eigen::MatrixXd& leaf_scale_matrix, double global_variance, double leaf_scale, int cutpoint_grid_size, bool pre_initialized) { - if (leaf_model_enum == ForestLeafModel::kConstant) { - StochTree::GaussianConstantLeafModel leaf_model = StochTree::GaussianConstantLeafModel(leaf_scale); - StochTree::GFRForestSampler sampler = StochTree::GFRForestSampler(cutpoint_grid_size); - sampler.SampleOneIter(*(tracker_.get()), forest_samples, leaf_model, dataset, residual, *(split_prior_.get()), rng, var_weights_vector, global_variance, feature_types, pre_initialized); - } else if (leaf_model_enum == ForestLeafModel::kUnivariateRegression) { - StochTree::GaussianUnivariateRegressionLeafModel leaf_model = StochTree::GaussianUnivariateRegressionLeafModel(leaf_scale); - StochTree::GFRForestSampler sampler = StochTree::GFRForestSampler(cutpoint_grid_size); - sampler.SampleOneIter(*(tracker_.get()), forest_samples, leaf_model, dataset, residual, *(split_prior_.get()), rng, var_weights_vector, global_variance, feature_types, pre_initialized); - } else if (leaf_model_enum == ForestLeafModel::kMultivariateRegression) { - StochTree::GaussianMultivariateRegressionLeafModel leaf_model = StochTree::GaussianMultivariateRegressionLeafModel(leaf_scale_matrix); - StochTree::GFRForestSampler sampler = StochTree::GFRForestSampler(cutpoint_grid_size); - sampler.SampleOneIter(*(tracker_.get()), forest_samples, leaf_model, dataset, residual, *(split_prior_.get()), rng, var_weights_vector, global_variance, feature_types, pre_initialized); - } - } - - void InternalSampleMCMC(StochTree::ForestContainer& forest_samples, StochTree::ForestDataset& dataset, StochTree::ColumnVector& residual, std::mt19937& rng, - std::vector& feature_types, std::vector& var_weights_vector, ForestLeafModel leaf_model_enum, - Eigen::MatrixXd& leaf_scale_matrix, double global_variance, double leaf_scale, int cutpoint_grid_size, bool pre_initialized) { - if (leaf_model_enum == ForestLeafModel::kConstant) { - StochTree::GaussianConstantLeafModel leaf_model = StochTree::GaussianConstantLeafModel(leaf_scale); - StochTree::MCMCForestSampler sampler = StochTree::MCMCForestSampler(); - sampler.SampleOneIter(*(tracker_.get()), forest_samples, leaf_model, dataset, residual, *(split_prior_.get()), rng, var_weights_vector, global_variance, pre_initialized); - } else if (leaf_model_enum == ForestLeafModel::kUnivariateRegression) { - StochTree::GaussianUnivariateRegressionLeafModel leaf_model = StochTree::GaussianUnivariateRegressionLeafModel(leaf_scale); - StochTree::MCMCForestSampler sampler = StochTree::MCMCForestSampler(); - sampler.SampleOneIter(*(tracker_.get()), forest_samples, leaf_model, dataset, residual, *(split_prior_.get()), rng, var_weights_vector, global_variance, pre_initialized); - } else if (leaf_model_enum == ForestLeafModel::kMultivariateRegression) { - StochTree::GaussianMultivariateRegressionLeafModel leaf_model = StochTree::GaussianMultivariateRegressionLeafModel(leaf_scale_matrix); - StochTree::MCMCForestSampler sampler = StochTree::MCMCForestSampler(); - sampler.SampleOneIter(*(tracker_.get()), forest_samples, leaf_model, dataset, residual, *(split_prior_.get()), rng, var_weights_vector, global_variance, pre_initialized); - } - } -}; - -class GlobalVarianceModelCpp { - public: - GlobalVarianceModelCpp() { - var_model_ = StochTree::GlobalHomoskedasticVarianceModel(); - } - ~GlobalVarianceModelCpp() {} - - double SampleOneIteration(ResidualCpp& residual, RngCpp& rng, double nu, double lamb) { - StochTree::ColumnVector* residual_ptr = residual.GetData(); - std::mt19937* rng_ptr = rng.GetRng(); - return var_model_.SampleVarianceParameter(residual_ptr->GetData(), nu, lamb, *rng_ptr); - } - - private: - StochTree::GlobalHomoskedasticVarianceModel var_model_; -}; - -class LeafVarianceModelCpp { - public: - LeafVarianceModelCpp() { - var_model_ = StochTree::LeafNodeHomoskedasticVarianceModel(); - } - ~LeafVarianceModelCpp() {} - - double SampleOneIteration(ForestContainerCpp& forest_samples, RngCpp& rng, double a, double b, int sample_num) { - StochTree::ForestContainer* forest_sample_ptr = forest_samples.GetContainer(); - std::mt19937* rng_ptr = rng.GetRng(); - return var_model_.SampleVarianceParameter(forest_sample_ptr->GetEnsemble(sample_num), a, b, *rng_ptr); - } - - private: - StochTree::LeafNodeHomoskedasticVarianceModel var_model_; -}; - -void ForestContainerCpp::UpdateResidual(ForestDatasetCpp& dataset, ResidualCpp& residual, ForestSamplerCpp& sampler, bool requires_basis, int forest_num, bool add) { - // Determine whether or not we are adding forest_num to the residuals - std::function op; - if (add) op = std::plus(); - else op = std::minus(); - - // Perform the update (addition / subtraction) operation - StochTree::UpdateResidualEntireForest(*(sampler.GetTracker()), *(dataset.GetDataset()), *(residual.GetData()), forest_samples_->GetEnsemble(forest_num), requires_basis, op); -} - -class JsonCpp { - public: - JsonCpp() { - // Initialize pointer to C++ nlohmann::json class - json_ = std::make_unique(); - nlohmann::json forests = nlohmann::json::object(); - json_->emplace("forests", forests); - json_->emplace("num_forests", 0); - } - ~JsonCpp() {} - - void LoadFile(std::string filename) { - std::ifstream f(filename); - *json_ = nlohmann::json::parse(f); - } - - void SaveFile(std::string filename) { - std::ofstream output_file(filename); - output_file << *json_ << std::endl; - } - - std::string DumpJson() { - return json_->dump(); - } - - std::string AddForest(ForestContainerCpp& forest_samples) { - int forest_num = json_->at("num_forests"); - std::string forest_label = "forest_" + std::to_string(forest_num); - nlohmann::json forest_json = forest_samples.ToJson(); - json_->at("forests").emplace(forest_label, forest_json); - json_->at("num_forests") = forest_num + 1; - return forest_label; - } - - void AddDouble(std::string field_name, double field_value) { - if (json_->contains(field_name)) { - json_->at(field_name) = field_value; - } else { - json_->emplace(std::pair(field_name, field_value)); - } - } - - void AddDoubleSubfolder(std::string subfolder_name, std::string field_name, double field_value) { - if (json_->contains(subfolder_name)) { - if (json_->at(subfolder_name).contains(field_name)) { - json_->at(subfolder_name).at(field_name) = field_value; - } else { - json_->at(subfolder_name).emplace(std::pair(field_name, field_value)); - } - } else { - json_->emplace(std::pair(subfolder_name, nlohmann::json::object())); - json_->at(subfolder_name).emplace(std::pair(field_name, field_value)); - } - } - - void AddBool(std::string field_name, bool field_value) { - if (json_->contains(field_name)) { - json_->at(field_name) = field_value; - } else { - json_->emplace(std::pair(field_name, field_value)); - } - } - - void AddBoolSubfolder(std::string subfolder_name, std::string field_name, bool field_value) { - if (json_->contains(subfolder_name)) { - if (json_->at(subfolder_name).contains(field_name)) { - json_->at(subfolder_name).at(field_name) = field_value; - } else { - json_->at(subfolder_name).emplace(std::pair(field_name, field_value)); - } - } else { - json_->emplace(std::pair(subfolder_name, nlohmann::json::object())); - json_->at(subfolder_name).emplace(std::pair(field_name, field_value)); - } - } - - void AddString(std::string field_name, std::string field_value) { - if (json_->contains(field_name)) { - json_->at(field_name) = field_value; - } else { - json_->emplace(std::pair(field_name, field_value)); - } - } - - void AddStringSubfolder(std::string subfolder_name, std::string field_name, std::string field_value) { - if (json_->contains(subfolder_name)) { - if (json_->at(subfolder_name).contains(field_name)) { - json_->at(subfolder_name).at(field_name) = field_value; - } else { - json_->at(subfolder_name).emplace(std::pair(field_name, field_value)); - } - } else { - json_->emplace(std::pair(subfolder_name, nlohmann::json::object())); - json_->at(subfolder_name).emplace(std::pair(field_name, field_value)); - } - } - - void AddDoubleVector(std::string field_name, py::array_t field_vector) { - int vec_length = field_vector.size(); - auto accessor = field_vector.mutable_unchecked<1>(); - if (json_->contains(field_name)) { - json_->at(field_name).clear(); - for (int i = 0; i < vec_length; i++) { - json_->at(field_name).emplace_back(accessor(i)); - } - } else { - json_->emplace(std::pair(field_name, nlohmann::json::array())); - for (int i = 0; i < vec_length; i++) { - json_->at(field_name).emplace_back(accessor(i)); - } - } - } - - void AddDoubleVectorSubfolder(std::string subfolder_name, std::string field_name, py::array_t field_vector) { - int vec_length = field_vector.size(); - auto accessor = field_vector.mutable_unchecked<1>(); - if (json_->contains(subfolder_name)) { - if (json_->at(subfolder_name).contains(field_name)) { - json_->at(subfolder_name).at(field_name).clear(); - for (int i = 0; i < vec_length; i++) { - json_->at(subfolder_name).at(field_name).emplace_back(accessor(i)); - } - } else { - json_->at(subfolder_name).emplace(std::pair(field_name, nlohmann::json::array())); - for (int i = 0; i < vec_length; i++) { - json_->at(subfolder_name).at(field_name).emplace_back(accessor(i)); - } - } - } else { - json_->emplace(std::pair(subfolder_name, nlohmann::json::object())); - json_->at(subfolder_name).emplace(std::pair(field_name, nlohmann::json::array())); - for (int i = 0; i < vec_length; i++) { - json_->at(subfolder_name).at(field_name).emplace_back(accessor(i)); - } - } - } - - void AddStringVector(std::string field_name, std::vector& field_vector) { - int vec_length = field_vector.size(); - if (json_->contains(field_name)) { - json_->at(field_name).clear(); - for (int i = 0; i < vec_length; i++) { - json_->at(field_name).emplace_back(field_vector.at(i)); - } - } else { - json_->emplace(std::pair(field_name, nlohmann::json::array())); - for (int i = 0; i < vec_length; i++) { - json_->at(field_name).emplace_back(field_vector.at(i)); - } - } - } - - void AddStringVectorSubfolder(std::string subfolder_name, std::string field_name, std::vector& field_vector) { - int vec_length = field_vector.size(); - if (json_->contains(subfolder_name)) { - if (json_->at(subfolder_name).contains(field_name)) { - json_->at(subfolder_name).at(field_name).clear(); - for (int i = 0; i < vec_length; i++) { - json_->at(subfolder_name).at(field_name).emplace_back(field_vector.at(i)); - } - } else { - json_->at(subfolder_name).emplace(std::pair(field_name, nlohmann::json::array())); - for (int i = 0; i < vec_length; i++) { - json_->at(subfolder_name).at(field_name).emplace_back(field_vector.at(i)); - } - } - } else { - json_->emplace(std::pair(subfolder_name, nlohmann::json::object())); - json_->at(subfolder_name).emplace(std::pair(field_name, nlohmann::json::array())); - for (int i = 0; i < vec_length; i++) { - json_->at(subfolder_name).at(field_name).emplace_back(field_vector.at(i)); - } - } - } - - bool ContainsField(std::string field_name) { - if (json_->contains(field_name)) { - return true; - } else { - return false; - } - } - - bool ContainsFieldSubfolder(std::string subfolder_name, std::string field_name) { - if (json_->contains(subfolder_name)) { - if (json_->at(subfolder_name).contains(field_name)) { - return true; - } else { - return false; - } - } else { - return false; - } - } - - double ExtractDouble(std::string field_name) { - return json_->at(field_name); - } - - double ExtractDoubleSubfolder(std::string subfolder_name, std::string field_name) { - return json_->at(subfolder_name).at(field_name); - } - - bool ExtractBool(std::string field_name) { - return json_->at(field_name); - } - - bool ExtractBoolSubfolder(std::string subfolder_name, std::string field_name) { - return json_->at(subfolder_name).at(field_name); - } - - std::string ExtractString(std::string field_name) { - return json_->at(field_name); - } - - std::string ExtractStringSubfolder(std::string subfolder_name, std::string field_name) { - return json_->at(subfolder_name).at(field_name); - } - - py::array_t ExtractDoubleVector(std::string field_name) { - auto json_vec = json_->at(field_name); - ssize_t json_vec_length = json_->at(field_name).size(); - auto result = py::array_t(py::detail::any_container({json_vec_length})); - auto accessor = result.mutable_unchecked<1>(); - for (size_t i = 0; i < json_vec_length; i++) { - accessor(i) = json_vec.at(i); - } - return result; - } - - py::array_t ExtractDoubleVectorSubfolder(std::string subfolder_name, std::string field_name) { - auto json_vec = json_->at(subfolder_name).at(field_name); - ssize_t json_vec_length = json_->at(subfolder_name).at(field_name).size(); - auto result = py::array_t(py::detail::any_container({json_vec_length})); - auto accessor = result.mutable_unchecked<1>(); - for (size_t i = 0; i < json_vec_length; i++) { - accessor(i) = json_vec.at(i); - } - return result; - } - - std::vector ExtractStringVector(std::string field_name) { - auto json_vec = json_->at(field_name); - ssize_t json_vec_length = json_->at(field_name).size(); - auto result = std::vector(json_vec_length); - for (size_t i = 0; i < json_vec_length; i++) { - result.at(i) = json_vec.at(i); - } - return result; - } - - std::vector ExtractStringVectorSubfolder(std::string subfolder_name, std::string field_name) { - auto json_vec = json_->at(subfolder_name).at(field_name); - ssize_t json_vec_length = json_->at(subfolder_name).at(field_name).size(); - auto result = std::vector(json_vec_length); - for (size_t i = 0; i < json_vec_length; i++) { - result.at(i) = json_vec.at(i); - } - return result; - } - - nlohmann::json SubsetJsonForest(std::string forest_label) { - return json_->at("forests").at(forest_label); - } - - private: - std::unique_ptr json_; -}; - -void ForestContainerCpp::LoadFromJson(JsonCpp& json, std::string forest_label) { - nlohmann::json forest_json = json.SubsetJsonForest(forest_label); - forest_samples_->Reset(); - forest_samples_->from_json(forest_json); -} - -PYBIND11_MODULE(stochtree_cpp, m) { - py::class_(m, "JsonCpp") - .def(py::init<>()) - .def("LoadFile", &JsonCpp::LoadFile) - .def("SaveFile", &JsonCpp::SaveFile) - .def("DumpJson", &JsonCpp::DumpJson) - .def("AddDouble", &JsonCpp::AddDouble) - .def("AddDoubleSubfolder", &JsonCpp::AddDoubleSubfolder) - .def("AddBool", &JsonCpp::AddBool) - .def("AddBoolSubfolder", &JsonCpp::AddBoolSubfolder) - .def("AddString", &JsonCpp::AddString) - .def("AddStringSubfolder", &JsonCpp::AddStringSubfolder) - .def("AddDoubleVector", &JsonCpp::AddDoubleVector) - .def("AddDoubleVectorSubfolder", &JsonCpp::AddDoubleVectorSubfolder) - .def("AddStringVector", &JsonCpp::AddStringVector) - .def("AddStringVectorSubfolder", &JsonCpp::AddStringVectorSubfolder) - .def("AddForest", &JsonCpp::AddForest) - .def("ContainsField", &JsonCpp::ContainsField) - .def("ContainsFieldSubfolder", &JsonCpp::ContainsFieldSubfolder) - .def("ExtractDouble", &JsonCpp::ExtractDouble) - .def("ExtractDoubleSubfolder", &JsonCpp::ExtractDoubleSubfolder) - .def("ExtractBool", &JsonCpp::ExtractBool) - .def("ExtractBoolSubfolder", &JsonCpp::ExtractBoolSubfolder) - .def("ExtractString", &JsonCpp::ExtractString) - .def("ExtractStringSubfolder", &JsonCpp::ExtractStringSubfolder) - .def("ExtractDoubleVector", &JsonCpp::ExtractDoubleVector) - .def("ExtractDoubleVectorSubfolder", &JsonCpp::ExtractDoubleVectorSubfolder) - .def("ExtractStringVector", &JsonCpp::ExtractStringVector) - .def("ExtractStringVectorSubfolder", &JsonCpp::ExtractStringVectorSubfolder) - .def("SubsetJsonForest", &JsonCpp::SubsetJsonForest); - - py::class_(m, "ForestDatasetCpp") - .def(py::init<>()) - .def("AddCovariates", &ForestDatasetCpp::AddCovariates) - .def("AddBasis", &ForestDatasetCpp::AddBasis) - .def("UpdateBasis", &ForestDatasetCpp::UpdateBasis) - .def("AddVarianceWeights", &ForestDatasetCpp::AddVarianceWeights) - .def("NumRows", &ForestDatasetCpp::NumRows); - - py::class_(m, "ResidualCpp") - .def(py::init,data_size_t>()); - - py::class_(m, "RngCpp") - .def(py::init()); - - py::class_(m, "ForestContainerCpp") - .def(py::init()) - .def("OutputDimension", &ForestContainerCpp::OutputDimension) - .def("NumSamples", &ForestContainerCpp::NumSamples) - .def("Predict", &ForestContainerCpp::Predict) - .def("PredictRaw", &ForestContainerCpp::PredictRaw) - .def("PredictRawSingleForest", &ForestContainerCpp::PredictRawSingleForest) - .def("SetRootValue", &ForestContainerCpp::SetRootValue) - .def("SetRootVector", &ForestContainerCpp::SetRootVector) - .def("UpdateResidual", &ForestContainerCpp::UpdateResidual) - .def("SaveToJsonFile", &ForestContainerCpp::SaveToJsonFile) - .def("LoadFromJsonFile", &ForestContainerCpp::LoadFromJsonFile) - .def("LoadFromJson", &ForestContainerCpp::LoadFromJson); - - py::class_(m, "ForestSamplerCpp") - .def(py::init, int, data_size_t, double, double, int>()) - .def("SampleOneIteration", &ForestSamplerCpp::SampleOneIteration); - - py::class_(m, "GlobalVarianceModelCpp") - .def(py::init<>()) - .def("SampleOneIteration", &GlobalVarianceModelCpp::SampleOneIteration); - - py::class_(m, "LeafVarianceModelCpp") - .def(py::init<>()) - .def("SampleOneIteration", &LeafVarianceModelCpp::SampleOneIteration); - -#ifdef VERSION_INFO - m.attr("__version__") = MACRO_STRINGIFY(VERSION_INFO); -#else - m.attr("__version__") = "dev"; -#endif -} \ No newline at end of file From 365b448bc739df79686316af994576913d78af0c Mon Sep 17 00:00:00 2001 From: Drew Herren Date: Fri, 5 Jul 2024 02:38:55 -0300 Subject: [PATCH 4/4] Updated directory refs in doc workflow --- .github/workflows/docs.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index a8eb5a1..868ce67 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -35,22 +35,22 @@ jobs: - name: Install Package with Relevant Dependencies run: | pip install --upgrade pip - pip install -r docs/requirements.txt + pip install -r python_docs/requirements.txt pip install . - name: Build HTML run: | - sphinx-build -M html docs/source/ docs/_build/ + sphinx-build -M html python_docs/source/ python_docs/_build/ - name: Upload Artifact uses: actions/upload-artifact@v4 with: path: - docs/_build/html/ + python_docs/_build/html/ - name: Deploy to GitHub Pages uses: peaceiris/actions-gh-pages@v4 if: github.ref == 'refs/heads/main' with: github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: docs/_build/html + publish_dir: python_docs/_build/html