Skip to content

Instantly share code, notes, and snippets.

View jtrive84's full-sized avatar

James Triveri jtrive84

View GitHub Profile
@jtrive84
jtrive84 / requirements-gpu.txt
Last active March 5, 2026 19:01
GPU-compatible requirements file
--index-url https://download.pytorch.org/whl/cu124
--extra-index-url https://pypi.org/simple
# Core numeric / ML stack
numpy==2.4.2
pandas==3.0.1
scikit-learn==1.8.0
scipy==1.17.1
# PyTorch (GPU via cu124 index)
@jtrive84
jtrive84 / dict_filter.py
Created February 11, 2026 21:06
Filter DataFrame to match conditions specified in a dictionary
inp = {
"BLDGCLASS": "3",
"OCCTYPE": "47",
"NUMSTORIES": "1",
"FLOORAREA": "2500",
"YEARBUILT": "12/31/1985",
"COASTAL_DIST_GRP": "5-25 miles",
#"GU_AAL_RATE": 1.398584,
"FIPSCD": "12071",
"STATECODE": "FL",
@jtrive84
jtrive84 / requirements.txt
Last active March 8, 2026 03:01
Requirements file for second installment of NLP for risk modeling
# Core numeric / ML stack
numpy==2.4.2
pandas==3.0.1
scikit-learn==1.8.0
scipy==1.17.1
torch==2.6.0
# Hugging Face stack (Trainer-capable)
transformers==5.1.0
accelerate==1.13.0
@jtrive84
jtrive84 / geospatial-hubfest.ipynb
Created August 31, 2025 20:22
Hubfest geospatial notebook
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jtrive84
jtrive84 / pd_hasher.py
Created July 26, 2025 13:38
Create hash of multiple columns in Pandas
dfsf["hash_id"] = pd.util.hash_pandas_object(
dfsf[["FIPSCd", "CountyNm", "PolicyNo", "TermEffectiveDt", "InsuredNm", "TermExpirationDt", "LocationCityNm",
"ZipCd", "LatitudePt", "LongitudePt"]],
index=False
).astype(str)
@jtrive84
jtrive84 / freq-glm.ipynb
Created March 21, 2025 14:55
Intro to Frequency GLMs
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jtrive84
jtrive84 / folium-annimations.ipynb
Created February 18, 2025 02:17
folium annimation
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jtrive84
jtrive84 / dask.yaml
Last active January 1, 2025 22:02
Organic computing cluster environment file
name: dask
channels:
- conda-forge
- defaults
dependencies:
- python=3.12
- dask=2024.12.0
- dask-labextension=7.0.0
- numpy=2.2.1
- asyncssh=2.19.0
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jtrive84
jtrive84 / distance-to-coastline.ipynb
Created October 14, 2024 21:14
Distance to coastline notebook
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.