Skip to content

Instantly share code, notes, and snippets.

View guyernest's full-sized avatar
🎯
Focusing

Guy (MLGuy) guyernest

🎯
Focusing
View GitHub Profile
@guyernest
guyernest / sentiment_analysis_dataset_sample.json
Last active September 14, 2025 19:34
Sentiment analysis dataset sample
{
"version": "1.0",
"metadata": {
"name": "Customer Sentiment Analysis Dataset",
"description": "Analyze customer feedback sentiment (positive, negative, neutral) with product categories for e-commerce and retail businesses.",
"created_date": "2025-01-14",
"dataset_type": "classification",
"total_samples": 20,
"export_timestamp": "2025-01-14T10:00:00Z",
"tags": ["sentiment", "classification", "customer-feedback", "e-commerce"],
@guyernest
guyernest / email_classification_enriched.json
Created August 5, 2025 23:37
Email Classification Dataset Sample
{
"version": "1.0",
"metadata": {
"created_date": "2025-08-05",
"total_samples": 15,
"dataset_type": "email_classification",
"description": "Sample dataset for testing email classification as 'For Action' or 'FYI' with department metadata",
"export_timestamp": "2025-08-05T20:00:00Z"
},
"samples": [
@guyernest
guyernest / mcp-multi-layer-security.md
Created July 23, 2025 01:53
MCP Multi-Layer Security Model
graph TB
    subgraph "Enterprise Security Layers"
        subgraph "Infrastructure Security"
            APIGW[API Gateway<br/>- Rate limiting<br/>- DDoS protection<br/>- SSL termination]
            Auth[Lambda Authorizer<br/>- JWT validation<br/>- Enterprise claims<br/>- 5-min caching]
        end
        
        subgraph "Identity & Access"
            Cognito[AWS Cognito<br/>- Enterprise SSO<br/>- MFA enforcement<br/>- Group-based access]
@guyernest
guyernest / mcp-highlevel-secure_flow.md
Created July 23, 2025 01:17
MCP High Level Secure Flow
graph LR
    subgraph "AI Client Layer"
        AI[AI Tools<br/>Claude, GPT, etc.]
    end

    subgraph "Security Gateway"
        Gateway[API Gateway<br/>+ Lambda Authorizer]
    end
@guyernest
guyernest / oauth-macp.md
Last active July 23, 2025 00:50
Detailed OAuth2 + MCP Protocol Flow
sequenceDiagram
    participant Enterprise as Enterprise User
    participant AI as AI Client<br/>(Claude/Inspector)
    participant APIGW as API Gateway
    participant OAuth2 as OAuth2 Proxy
    participant Auth as Lambda Authorizer
    participant Cognito as AWS Cognito
    participant MCP as MCP Server
    participant Data as Enterprise Data
@guyernest
guyernest / step-functions-agent-definition.json
Created December 24, 2024 03:13
Step Functions Definition for an AI Agent
{
"Comment": "AI Agent Implementation",
"QueryLanguage": "JSONata",
"StartAt": "Call LLM",
"States": {
"Call LLM": {
"Type": "Task",
"Resource": "arn:aws:states:::lambda:invoke",
"Retry": [
{
select * from
(select cast(category as integer) as item_num_history, date_trunc('day', calendar_date) as sales_day, sum(sales) as demand
from forecast.compressed_data group by 1,2) as a
right join
(select *, date_trunc('day', from_iso8601_timestamp(date)) as forecast_day, cast(item_id AS integer) as item_num_forecast
from forecast.output_train_1217_category) as b
@guyernest
guyernest / export_forecast.py
Created May 18, 2019 15:36
Forecast Pipeline 06
# Request for a forecast based on time and product filter
forecastResponse = forecastquery.get_forecast(
PredictorName=predictorName,
StartDate='2018-01-01T00:00:00Z',
EndDate='2018-01-10T00:00:00Z',
Interval="day",
Filters={"item_id":"012"}
)
@guyernest
guyernest / deploy_predictor.py
Created May 18, 2019 14:41
Forecast Pipeline 05
forecast.deploy_predictor(PredictorName=predictorName)
while True:
deployedPredictorStatus = forecast.describe_deployed_predictor(
PredictorName=predictorName
)['Status']
print(deployedPredictorStatus)
if deployedPredictorStatus != 'ACTIVE' and deployedPredictorStatus != 'FAILED':
sleep(30)
else:
@guyernest
guyernest / predictor_creation.py
Last active May 18, 2019 14:04
Forecast Pipeline 04
predictorName= project+'_ARIMA'
# We will create forecast prediction for two months (60 days)
forecastHorizon = 60
# Starting the predictor creation job
createPredictorResponse=forecast.create_predictor(
RecipeName=recipe,
DatasetGroupName= datasetGroupName ,
PredictorName=predictorName,