You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
885 B
32 lines
885 B
# see https://github.com/hastic/hastic-server/wiki/Custom-model |
|
|
|
from models import Model, AnalyticSegment, ModelState, ModelType |
|
from analytic_types import AnalyticUnitId, ModelCache |
|
from analytic_types.learning_info import LearningInfo |
|
import utils |
|
|
|
import pandas as pd |
|
from typing import List, Optional |
|
|
|
|
|
class CustomModel(Model): |
|
def do_fit( |
|
self, |
|
dataframe: pd.DataFrame, |
|
labeled_segments: List[AnalyticSegment], |
|
deleted_segments: List[AnalyticSegment], |
|
learning_info: LearningInfo |
|
) -> None: |
|
pass |
|
|
|
def do_detect(self, dataframe: pd.DataFrame) -> list: |
|
return [] |
|
|
|
def find_segment_center(self, dataframe: pd.DataFrame, start: int, end: int) -> int: |
|
pass |
|
|
|
def get_model_type(self) -> ModelType: |
|
pass |
|
|
|
def get_state(self, cache: Optional[ModelCache] = None) -> ModelState: |
|
pass
|
|
|