Skip to content

SSA time series samples #1788

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

Merged
merged 5 commits into from
Dec 3, 2018
Merged

SSA time series samples #1788

merged 5 commits into from
Dec 3, 2018

Conversation

montebhoover
Copy link
Contributor

Samples for SsaChangePointDetectorPrediction and SsaSpikeDetectorPrediction.

// 4 0 2.16 0.00 0.24
// 100 0 86.23 0.00 2076098.24
// 200 0 171.38 0.00 809668524.21
// 300 1 256.83 0.01 22130423541.93 <-- alert is on, note that delay is expected
Copy link
Member

@codemzs codemzs Nov 30, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

93 <-- alert is on, note that delay is expected [](start = 59, length = 50)

Can you please add the indicator when the mode was saved/loaded? Same for other test. #Resolved

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea, I'll add that.


In reply to: 238001208 [](ancestors = 238001208)


// Setup SsaChangePointDetector arguments
string outputColumnName = "Prediction";
string inputColumnName = "Value";
Copy link
Member

@codemzs codemzs Nov 30, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Value"; [](start = 37, length = 8)

nameof(SsaChangePointData.Value) and same for Prediction as well for both the files. #Resolved

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Done.


In reply to: 238001359 [](ancestors = 238001359)

Copy link
Member

@codemzs codemzs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🕐

Copy link
Member

@codemzs codemzs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

var data = new List<SsaSpikeData>();
for (int i = 0; i < TrainingSeasons; i++)
for (int j = 0; j < SeasonalitySize; j++)
data.Add(new SsaSpikeData(j));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Data generation used accross samples consider moving them in the Microsoft.ML.SamplesUtils.DatasetUtils.

// 100 1 98.21 0.00 <-- alert is on, predicted spike
// 0 0 - 13.83 0.29
// 1 0 - 1.74 0.44
// 2 0 - 0.47 0.46
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doe it make sense to limit the preview/data to something smaller,maybe like 7 rows ?

foreach (var prediction in predictionColumn)
Console.WriteLine("{0}\t{1:0.00}\t{2:0.00}", prediction.Prediction[0], prediction.Prediction[1], prediction.Prediction[2]);
Console.WriteLine("{0}\t{1}\t{2:0.00}\t{3:0.00}", data[k++].Value, prediction.Prediction[0], prediction.Prediction[1], prediction.Prediction[2]);
Console.WriteLine("");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Console.WriteLine(""); [](start = 11, length = 23)

remove, and include the newline in the above.

foreach (var prediction in predictionColumn)
Console.WriteLine("{0}\t{1:0.00}\t{2:0.00}", prediction.Prediction[0], prediction.Prediction[1], prediction.Prediction[2]);
Console.WriteLine("{0}\t{1}\t{2:0.00}\t{3:0.00}", data[k++].Value, prediction.Prediction[0], prediction.Prediction[1], prediction.Prediction[2]);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"{0}\t{1}\t{2:0.00}\t{3:0.00}" [](start = 34, length = 30)

think we prefer interpolation.


// This example shows spike detection as above, but demonstrates how to train a model
// that can run predictions on streaming data, and how to persist the trained model and then re-load it.
public static void SsaSpikeDetectorPrediction()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comment as in the other PR; maybe the end-to-end should go on tutorials. The API call usage should go here.

Copy link
Member

@sfilipi sfilipi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@montebhoover montebhoover merged commit 93156b6 into dotnet:master Dec 3, 2018
@montebhoover montebhoover deleted the samples branch December 3, 2018 18:57
@ghost ghost locked as resolved and limited conversation to collaborators Mar 26, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants