Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoPR azure-ai-anomalydetector] Cleaning build for TypeSpec data plane services #5376

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@

/**
* Package containing the implementations for AnomalyDetector. The Anomaly Detector API detects anomalies automatically
* in time series data. It supports two kinds of mode, one is for stateless using, another is for stateful using. In
* stateless mode, there are three functionalities. Entire Detect is for detecting the whole series with model trained
* by the time series, Last Detect is detecting last point with model trained by points before. ChangePoint Detect is
* for detecting trend changes in time series. In stateful mode, user can store time series, the stored time series will
* be used for detection anomalies. Under this mode, user can still use the above three functionalities by only giving a
* time range without preparing time series in client side. Besides the above three functionalities, stateful model also
* provide group based detection and labeling service. By leveraging labeling service user can provide labels for each
* detection result, these labels will be used for retuning or regenerating detection models. Inconsistency detection is
* a kind of group based detection, this detection will find inconsistency ones in a set of time series. By using
* anomaly detector service, business customers can discover incidents and establish a logic flow for root cause
* analysis.
* in time series data. It supports both a stateless detection mode and a stateful detection mode. In stateless mode,
* there are three functionalities. Entire Detect is for detecting the whole series, with the model trained by the time
* series. Last Detect is for detecting the last point, with the model trained by points before. ChangePoint Detect is
* for detecting trend changes in the time series. In stateful mode, the user can store time series. The stored time
* series will be used for detection anomalies. In this mode, the user can still use the preceding three functionalities
* by only giving a time range without preparing time series on the client side. Besides the preceding three
* functionalities, the stateful model provides group-based detection and labeling services. By using the labeling
* service, the user can provide labels for each detection result. These labels will be used for retuning or
* regenerating detection models. Inconsistency detection is a kind of group-based detection that finds inconsistencies
* in a set of time series. By using the anomaly detector service, business customers can discover incidents and
* establish a logic flow for root cause analysis.
*/
package com.azure.ai.anomalydetector.implementation;
Original file line number Diff line number Diff line change
Expand Up @@ -4,48 +4,43 @@

package com.azure.ai.anomalydetector.models;

import com.azure.core.util.ExpandableStringEnum;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import java.util.Collection;

/** Defines values for AlignMode. */
public enum AlignMode {
/** Enum value Inner. */
INNER("Inner"),
public final class AlignMode extends ExpandableStringEnum<AlignMode> {
/** Static value Inner for AlignMode. */
public static final AlignMode INNER = fromString("Inner");

/** Enum value Outer. */
OUTER("Outer");
/** Static value Outer for AlignMode. */
public static final AlignMode OUTER = fromString("Outer");

/** The actual serialized value for a AlignMode instance. */
private final String value;

AlignMode(String value) {
this.value = value;
}
/**
* Creates a new instance of AlignMode value.
*
* @deprecated Use the {@link #fromString(String)} factory method.
*/
@Deprecated
public AlignMode() {}

/**
* Parses a serialized value to a AlignMode instance.
* Creates or finds a AlignMode from its string representation.
*
* @param value the serialized value to parse.
* @return the parsed AlignMode object, or null if unable to parse.
* @param name a name to look for.
* @return the corresponding AlignMode.
*/
@JsonCreator
public static AlignMode fromString(String value) {
if (value == null) {
return null;
}
AlignMode[] items = AlignMode.values();
for (AlignMode item : items) {
if (item.toString().equalsIgnoreCase(value)) {
return item;
}
}
return null;
public static AlignMode fromString(String name) {
return fromString(name, AlignMode.class);
}

/** {@inheritDoc} */
@JsonValue
@Override
public String toString() {
return this.value;
/**
* Gets known AlignMode values.
*
* @return known AlignMode values.
*/
public static Collection<AlignMode> values() {
return values(AlignMode.class);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,24 @@
import com.azure.core.annotation.Fluent;
import com.fasterxml.jackson.annotation.JsonProperty;

/** An optional field, indicating the manner to align multiple variables. */
/** Manner of aligning multiple variables. */
@Fluent
public final class AlignPolicy {
/*
* An optional field, indicating how to align different variables to the same
* time-range. Either Inner or Outer.
* Field that indicates how to align different variables to the same
* time range.
*/
@JsonProperty(value = "alignMode")
private AlignMode alignMode;

/*
* An optional field, indicating how missing values will be filled. One of
* Previous, Subsequent, Linear, Zero, Fixed.
* Field that indicates how missing values will be filled.
*/
@JsonProperty(value = "fillNAMethod")
private FillNAMethod fillNAMethod;

/*
* An optional field. Required when fillNAMethod is Fixed.
* Field that's required when fillNAMethod is Fixed.
*/
@JsonProperty(value = "paddingValue")
private Double paddingValue;
Expand All @@ -34,8 +33,7 @@ public final class AlignPolicy {
public AlignPolicy() {}

/**
* Get the alignMode property: An optional field, indicating how to align different variables to the same
* time-range. Either Inner or Outer.
* Get the alignMode property: Field that indicates how to align different variables to the same time range.
*
* @return the alignMode value.
*/
Expand All @@ -44,8 +42,7 @@ public AlignMode getAlignMode() {
}

/**
* Set the alignMode property: An optional field, indicating how to align different variables to the same
* time-range. Either Inner or Outer.
* Set the alignMode property: Field that indicates how to align different variables to the same time range.
*
* @param alignMode the alignMode value to set.
* @return the AlignPolicy object itself.
Expand All @@ -56,8 +53,7 @@ public AlignPolicy setAlignMode(AlignMode alignMode) {
}

/**
* Get the fillNAMethod property: An optional field, indicating how missing values will be filled. One of Previous,
* Subsequent, Linear, Zero, Fixed.
* Get the fillNAMethod property: Field that indicates how missing values will be filled.
*
* @return the fillNAMethod value.
*/
Expand All @@ -66,8 +62,7 @@ public FillNAMethod getFillNAMethod() {
}

/**
* Set the fillNAMethod property: An optional field, indicating how missing values will be filled. One of Previous,
* Subsequent, Linear, Zero, Fixed.
* Set the fillNAMethod property: Field that indicates how missing values will be filled.
*
* @param fillNAMethod the fillNAMethod value to set.
* @return the AlignPolicy object itself.
Expand All @@ -78,7 +73,7 @@ public AlignPolicy setFillNAMethod(FillNAMethod fillNAMethod) {
}

/**
* Get the paddingValue property: An optional field. Required when fillNAMethod is Fixed.
* Get the paddingValue property: Field that's required when fillNAMethod is Fixed.
*
* @return the paddingValue value.
*/
Expand All @@ -87,7 +82,7 @@ public Double getPaddingValue() {
}

/**
* Set the paddingValue property: An optional field. Required when fillNAMethod is Fixed.
* Set the paddingValue property: Field that's required when fillNAMethod is Fixed.
*
* @param paddingValue the paddingValue value to set.
* @return the AlignPolicy object itself.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public final class AnomalyDetectionModel {
private OffsetDateTime lastUpdatedTime;

/*
* Training result of a model including its status, errors and diagnostics
* Training result of a model, including its status, errors, and diagnostics
* information.
*/
@JsonProperty(value = "modelInfo")
Expand Down Expand Up @@ -79,7 +79,8 @@ public OffsetDateTime getLastUpdatedTime() {
}

/**
* Get the modelInfo property: Training result of a model including its status, errors and diagnostics information.
* Get the modelInfo property: Training result of a model, including its status, errors, and diagnostics
* information.
*
* @return the modelInfo value.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import com.azure.core.annotation.Immutable;
import com.fasterxml.jackson.annotation.JsonProperty;

/** Interpretation of the anomalous timestamp. */
/** Interpretation of the anomalous time stamp. */
@Immutable
public final class AnomalyInterpretation {
/*
Expand All @@ -17,14 +17,14 @@ public final class AnomalyInterpretation {
private String variable;

/*
* This score shows the percentage contributing to the anomalous timestamp. A
* This score shows the percentage that contributes to the anomalous time stamp. It's a
* number between 0 and 1.
*/
@JsonProperty(value = "contributionScore")
private Double contributionScore;

/*
* Correlation changes among the anomalous variables
* Correlation changes among the anomalous variables.
*/
@JsonProperty(value = "correlationChanges")
private CorrelationChanges correlationChanges;
Expand All @@ -42,8 +42,8 @@ public String getVariable() {
}

/**
* Get the contributionScore property: This score shows the percentage contributing to the anomalous timestamp. A
* number between 0 and 1.
* Get the contributionScore property: This score shows the percentage that contributes to the anomalous time stamp.
* It's a number between 0 and 1.
*
* @return the contributionScore value.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@
@Immutable
public final class AnomalyState {
/*
* The timestamp for this anomaly.
* Time stamp for this anomaly.
*/
@JsonProperty(value = "timestamp", required = true)
private OffsetDateTime timestamp;

/*
* The detailed value of this anomalous timestamp.
* Detailed value of this anomalous time stamp.
*/
@JsonProperty(value = "value")
private AnomalyValue value;

/*
* Error message for the current timestamp.
* Error message for the current time stamp.
*/
@JsonProperty(value = "errors")
private List<ErrorResponse> errors;
Expand All @@ -42,7 +42,7 @@ private AnomalyState(@JsonProperty(value = "timestamp", required = true) OffsetD
}

/**
* Get the timestamp property: The timestamp for this anomaly.
* Get the timestamp property: Time stamp for this anomaly.
*
* @return the timestamp value.
*/
Expand All @@ -51,7 +51,7 @@ public OffsetDateTime getTimestamp() {
}

/**
* Get the value property: The detailed value of this anomalous timestamp.
* Get the value property: Detailed value of this anomalous time stamp.
*
* @return the value value.
*/
Expand All @@ -60,7 +60,7 @@ public AnomalyValue getValue() {
}

/**
* Get the errors property: Error message for the current timestamp.
* Get the errors property: Error message for the current time stamp.
*
* @return the errors value.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** Detailed information of the anomalous timestamp. */
/** Detailed information of the anomalous time stamp. */
@Immutable
public final class AnomalyValue {
/*
* True if an anomaly is detected at the current timestamp.
* True if an anomaly is detected at the current time stamp.
*/
@JsonProperty(value = "isAnomaly", required = true)
private boolean isAnomaly;
Expand All @@ -26,14 +26,13 @@ public final class AnomalyValue {
private double severity;

/*
* Raw anomaly score of severity, will help indicate the degree of abnormality as
* well.
* Raw anomaly score of severity, to help indicate the degree of abnormality.
*/
@JsonProperty(value = "score", required = true)
private double score;

/*
* Interpretation of this anomalous timestamp.
* Interpretation of this anomalous time stamp.
*/
@JsonProperty(value = "interpretation")
private List<AnomalyInterpretation> interpretation;
Expand All @@ -56,7 +55,7 @@ private AnomalyValue(
}

/**
* Get the isAnomaly property: True if an anomaly is detected at the current timestamp.
* Get the isAnomaly property: True if an anomaly is detected at the current time stamp.
*
* @return the isAnomaly value.
*/
Expand All @@ -75,7 +74,7 @@ public double getSeverity() {
}

/**
* Get the score property: Raw anomaly score of severity, will help indicate the degree of abnormality as well.
* Get the score property: Raw anomaly score of severity, to help indicate the degree of abnormality.
*
* @return the score value.
*/
Expand All @@ -84,7 +83,7 @@ public double getScore() {
}

/**
* Get the interpretation property: Interpretation of this anomalous timestamp.
* Get the interpretation property: Interpretation of this anomalous time stamp.
*
* @return the interpretation value.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
@Immutable
public final class CorrelationChanges {
/*
* The correlated variables that have correlation changes under an anomaly.
* Correlated variables that have correlation changes under an anomaly.
*/
@JsonProperty(value = "changedVariables")
private List<String> changedVariables;
Expand All @@ -21,7 +21,7 @@ public final class CorrelationChanges {
private CorrelationChanges() {}

/**
* Get the changedVariables property: The correlated variables that have correlation changes under an anomaly.
* Get the changedVariables property: Correlated variables that have correlation changes under an anomaly.
*
* @return the changedVariables value.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@
import com.fasterxml.jackson.annotation.JsonCreator;
import java.util.Collection;

/** Data schema of input data source: OneTable or MultiTable. The default DataSchema is OneTable. */
/** Data schema of the input data source. The default is OneTable. */
public final class DataSchema extends ExpandableStringEnum<DataSchema> {
/**
* OneTable means that your input data are all in one CSV file, which contains one 'timestamp' column and several
* variable columns. The default DataSchema is OneTable.
* OneTable means that your input data is in one CSV file, which contains one time stamp column and several variable
* columns. The default DataSchema value is OneTable.
*/
public static final DataSchema ONE_TABLE = fromString("OneTable");

/**
* MultiTable means that your input data are separated in multiple CSV files, in each file containing one
* 'timestamp' column and one 'variable' column, and the CSV file name should indicate the name of the variable. The
* default DataSchema is OneTable.
* MultiTable means that your input data is separated in multiple CSV files. Each file contains one time stamp
* column and one variable column, and the CSV file name should indicate the name of the variable. The default
* DataSchema value is OneTable.
*/
public static final DataSchema MULTI_TABLE = fromString("MultiTable");

Expand Down
Loading