Skip to content

Instantly share code, notes, and snippets.

View zz2115's full-sized avatar
:octocat:

z zz2115

:octocat:
View GitHub Profile
This file has been truncated, but you can view the full file.
<!DOCTYPE html>
<html lang="en">
<head><meta charset="utf-8"/>
<meta content="width=device-width, initial-scale=1.0" name="viewport"/>
<title>Financial Fraud Detection Using Python</title><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.1.10/require.min.js"></script>
<style type="text/css">
pre { line-height: 125%; }
td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
@zz2115
zz2115 / APTutor.md
Created May 13, 2025 23:48
Prompt Collection

You are a highly decorated, nationally recognized AP teacher with 15+ years of experience fostering critical thinking and exam success. A student has come to you for help with the following question. Provide a comprehensive, step-by-step solution, mirroring how you would explain it to a student in class. Include: a clear restatement of the question's core task, identification of relevant concepts/historical context/formulas/theories, a detailed breakdown of the solution process (showing all work where applicable), justification for each step, potential pitfalls students often encounter, and a concluding statement summarizing the answer and offering advice for similar problems. Assume the student has a solid foundational understanding of the course material but needs guidance applying it to this specific challenge.

@zz2115
zz2115 / README.md
Created May 1, 2025 03:26
Actions of a Great Data Scientist

Actions of a Great Data Scientist

Instead of simply copying notebooks, a great data scientist would:

  • Create original solutions tailored to specific business problems
  • Deeply understand and properly document methodologies
  • Build upon others' work while adding significant improvements
  • Contribute back to the community with novel approaches

Rather than training models blindly, they would:

@zz2115
zz2115 / README.md
Created April 20, 2025 20:33
fraud graph in retail banking

Okay, here are several use cases for leveraging graph databases and graph analytics in fraud detection within the retail banking sector:

Graph technology is particularly well-suited for fraud detection because fraud often involves complex, hidden relationships between seemingly unrelated entities (people, accounts, devices, locations, transactions). Graph databases excel at modeling, traversing, and analyzing these connections in ways traditional relational databases struggle with.

Key Graph Techniques Used:

Link Analysis: This involves tracing direct and indirect connections between different entities (nodes) in the graph. It helps uncover suspicious relationships, such as an applicant sharing an address or phone number with a known fraudster, even several connections away.

Community Detection: Algorithms like Louvain identify clusters or tightly-knit groups of entities within the graph. These communities can represent organized fraud rings collaborating on activities like creating synthetic ident

@zz2115
zz2115 / redshift_custom.py
Created April 14, 2025 01:40
sqlalchemy redshift_custom
from sqlalchemy.dialects import registry
from sqlalchemy.dialects.postgresql.psycopg2 import PGDialect_psycopg2
class RedshiftPostgresDialect(PGDialect_psycopg2):
def _set_backslash_escapes(self, connection):
self._backslash_escapes = "off"
registry.register("redshift_custom", __name__, "RedshiftPostgresDialect")
from sqlalchemy import create_engine
db = create_engine("redshift_custom://user:password@redshifthost:5439/dev")
@zz2115
zz2115 / duckdb.md
Created April 7, 2025 01:40
duckdb

duckdb -cmd "CREATE VIEW view_name AS FROM 'filename.csv';" -ui