반응형

머신 런닝등에서 배치잡을 위한 프로그램

아파치꺼

설치과정은 회사 직원분이 설치해 주셔서 모름 ....

바로 스크립트 들어가자

대소문자 따짐 ....

from airflow.models.dag import DAG
from airflow.operators.bash import BashOperator

import datetime
import pendulum

# 한국 시간 timezone 설정
kst = pendulum.timezone("Asia/Seoul")
# 한국 시간 2021년 1월 1일 시작, 오전 8시마다 실행되는 DAG 설정
dag = DAG(
     "tutorial",
    default_args={
        "depends_on_past": True,
        "retries": 1,
        "retry_delay": datetime.timedelta(minutes=3),
    },
    start_date=pendulum.datetime(2021, 1, 1, tz=kst),
    schedule_interval="0 * * * *",
    catchup=False,
)


t1 = BashOperator(
    task_id="himari_test_1",
    bash_command='echo test1',
    dag=dag
)

t2 = BashOperator(
    task_id="himari_test_2",
    bash_command='echo test2',
    dag=dag
)

t1 >> t2

https://m.blog.naver.com/wideeyed/221565240108
요기 블로그가 잘 나온 듯

'프로그래밍' 카테고리의 다른 글

블루아카이브 1위  (0) 2023.01.25
airflow 도커 오퍼레이터  (0) 2023.01.10
blazor ui 컨포넌트  (0) 2023.01.03
wsl2 고정 ip처럼 사용하기  (0) 2022.12.06
docker network mode  (0) 2022.12.06
반응형

https://learn.microsoft.com/en-us/dotnet/machine-learning/tutorials/sales-anomaly-detection

 

Tutorial: Detect anomalies in product sales - ML.NET

Learn how to build an anomaly detection application for product sales data. This tutorial creates a .NET Core console application using C# in Visual Studio 2019.

learn.microsoft.com

 

https://github.com/dotnet/samples/tree/main/machine-learning/tutorials/ProductSalesAnomalyDetection

 

GitHub - dotnet/samples: Sample code referenced by the .NET documentation

Sample code referenced by the .NET documentation. Contribute to dotnet/samples development by creating an account on GitHub.

github.com

 

잘은 되는 거 같은데 원하는 지점 찾는 게 힘드네!

 

 Console.WriteLine("Detect temporary changes in pattern");

    // STEP 2: Set the training algorithm
    // <SnippetAddSpikeTrainer>
    var iidSpikeEstimator = mlContext.Transforms.DetectIidSpike(outputColumnName: nameof(ProductSalesPrediction.Prediction), inputColumnName: nameof(ProductSalesData.Given), confidence: 99.949, pvalueHistoryLength: docSize / 4);
    // </SnippetAddSpikeTrainer>

    // STEP 3: Create the transform
    // Create the spike detection transform
    Console.WriteLine("=============== Training the model ===============");
    // <SnippetTrainModel1>
    ITransformer iidSpikeTransform = iidSpikeEstimator.Fit(CreateEmptyDataView(mlContext));
    // </SnippetTrainModel1>

    Console.WriteLine("=============== End of training process ===============");
    //Apply data transformation to create predictions.
    // <SnippetTransformData1>
    IDataView transformedData = iidSpikeTransform.Transform(productSales);
    // </SnippetTransformData1>

    // <SnippetCreateEnumerable1>
    var predictions = mlContext.Data.CreateEnumerable<ProductSalesPrediction>(transformedData, reuseRowObject: false);
    // </SnippetCreateEnumerable1>

    // <SnippetDisplayHeader1>
    Console.WriteLine("Alert\tScore\tP-Value");
    // </SnippetDisplayHeader1>

    // <SnippetDisplayResults1>

    foreach (var p in predictions)
    {
       var results = $"{idx++}\t{p.Prediction[0]}\t{p.Prediction[1]:f2}\t{p.Prediction[2]:F2}\t";
        if (p.Prediction[0] == 1)
        {
            Console.WriteLine(results);
        }
        Console.WriteLine(results);
    }
 

'프로그래밍' 카테고리의 다른 글

Perforce Install in Ubuntu  (0) 2022.10.20
트랜잭션 문제  (0) 2022.10.18
게임 전투 데이터 AI 치터 판별 팁  (0) 2022.10.17
jetbrains fleet  (0) 2022.10.13
Golang How to check if a map contains a key  (0) 2022.10.12

+ Recent posts