class_docstr: Compute element-wise time elapsed between time index and a reference start time.
  
  Creates a column(s) which represents: `t` - `start`, where `start` is
  a reference time and `t` is the time index. The type of `start` must be
  compatible with the index of `X` used in `.fit()` and `.transform()`.
  
  The output can be converted to an integer representing the number of periods
  elapsed since the start time by setting `to_numeric=True`. The period is
  determined by the frequency of the index. For example, if the `freq` of
  the index is "MS" or "M" then the output is the integer number of months
  between `t` and `start`.
  
  Parameters
  ----------
  start : a list of start times, optional, default=None (use earliest time in index)
      a "start time" can be one of the following types:
  
      * int: Start time to compute the time elapsed, use when index is integer.
      * time-like: `Period` or `datetime`
          Start time to compute the time elapsed.
      * str: String is converted to datetime or period, depending on the index type,             to give the start time.
  
  to_numeric : string, optional (default=True)
      Return the integer number of periods elapsed since `start`; the period
      is defined by the frequency of the data. Converts datetime types to
      pd.Period before calculating time differences.
  freq : 'str', optional, default=None
      Only used when X has a pd.DatetimeIndex without a specified frequency.
      Specifies the frequency of the index of your data. The string should
      match a pandas offset alias:
      https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases
  keep_original_columns :  boolean, optional, default=False
      Keep original columns in X passed to `.transform()`.
  positive_only :  boolean, optional, default=False
      Clips negative values to zero when `to_numeric` is True.
  
  Examples
  --------
  >>> from sktime.datasets import load_airline
  >>> from sktime.transformations.series.time_since import TimeSince
  >>> X = load_airline()
  
      Create a single column with time elapsed since start date of time series.
      The output is in units of integer number of months, same as the index `freq`.
  
  >>> transformer = TimeSince()
  >>> Xt = transformer.fit_transform(X)
  
      Create multiple columns with different start times. The output is in units
      of integer number of months, same as the index `freq`.
  
  >>> transformer = TimeSince(["2000-01", "2000-02"])
  >>> Xt = transformer.fit_transform(X)
class_docstr_tok: ["Compute","element-wise","time","elapsed","between","time","index","and","a","reference","start","time",".","Creates","a","column","(","s",")","which","represents",":","`","t","`","-","`","start","`",",","where","`","start","`","is","a","reference","time","and","`","t","`","is","the","time","index",".","The","type","of","`","start","`","must","be","compatible","with","the","index","of","`","X","`","used","in","`",".fit","(",")","`","and","`",".transform","(",")","`",".","The","output","can","be","converted","to","an","integer","representing","the","number","of","periods","elapsed","since","the","start","time","by","setting","`","to_numeric=True","`",".","The","period","is","determined","by","the","frequency","of","the","index",".","For","example",",","if","the","`","freq","`","of","the","index","is","``","MS","''","or","``","M","''","then","the","output","is","the","integer","number","of","months","between","`","t","`","and","`","start","`",".","Parameters","--","--","--","--","--","start",":","a","list","of","start","times",",","optional",",","default=None","(","use","earliest","time","in","index",")","a","``","start","time","''","can","be","one","of","the","following","types",":","*","int",":","Start","time","to","compute","the","time","elapsed",",","use","when","index","is","integer",".","*","time-like",":","`","Period","`","or","`","datetime","`","Start","time","to","compute","the","time","elapsed",".","*","str",":","String","is","converted","to","datetime","or","period",",","depending","on","the","index","type",",","to","give","the","start","time",".","to_numeric",":","string",",","optional","(","default=True",")","Return","the","integer","number","of","periods","elapsed","since","`","start","`",";","the","period","is","defined","by","the","frequency","of","the","data",".","Converts","datetime","types","to","pd.Period","before","calculating","time","differences",".","freq",":","'str","'",",","optional",",","default=None","Only","used","when","X","has","a","pd.DatetimeIndex","without","a","specified","frequency",".","Specifies","the","frequency","of","the","index","of","your","data",".","The","string","should","match","a","pandas","offset","alias",":","https",":","\/\/pandas.pydata.org\/pandas-docs\/stable\/user_guide\/timeseries.html","#","offset-aliases","keep_original_columns",":","boolean",",","optional",",","default=False","Keep","original","columns","in","X","passed","to","`",".transform","(",")","`",".","positive_only",":","boolean",",","optional",",","default=False","Clips","negative","values","to","zero","when","`","to_numeric","`","is","True",".","Examples","--","--","--","--",">",">",">","from","sktime.datasets","import","load_airline",">",">",">","from","sktime.transformations.series.time_since","import","TimeSince",">",">",">","X","=","load_airline","(",")","Create","a","single","column","with","time","elapsed","since","start","date","of","time","series",".","The","output","is","in","units","of","integer","number","of","months",",","same","as","the","index","`","freq","`",".",">",">",">","transformer","=","TimeSince","(",")",">",">",">","Xt","=","transformer.fit_transform","(","X",")","Create","multiple","columns","with","different","start","times",".","The","output","is","in","units","of","integer","number","of","months",",","same","as","the","index","`","freq","`",".",">",">",">","transformer","=","TimeSince","(","[","``","2000-01","''",",","``","2000-02","''","]",")",">",">",">","Xt","=","transformer.fit_transform","(","X",")"]
code: def __init__(
      self,
      start: list[str | datetime.datetime | pd.Period | None]
      | None = None,
      *,
      to_numeric: bool | None = True,
      freq: str | None = None,
      keep_original_columns: bool | None = False,
      positive_only: bool | None = False,
  ):
      self.start = start
      self.to_numeric = to_numeric
      self.freq = freq
      self.keep_original_columns = keep_original_columns
      self.positive_only = positive_only
      super().__init__()
  
file_path: sktime/sktime/transformations/series/time_since.py
imports: from __future__ import annotations
  import datetime
  import warnings
  from string import digits
  import numpy
  import pandas
  from pandas.tseries.frequencies import get_period_alias
  from sktime.transformations.base import BaseTransformer
label_desc: Use image node_id 1 to create a new TimeSince object from inherited base classes: BaseTransformer with example: obj = TimeSince(start)