Skip to content

Commit

Permalink
re-gen
Browse files Browse the repository at this point in the history
  • Loading branch information
fulpm committed Oct 14, 2024
1 parent 20c4e93 commit 5ddbc40
Show file tree
Hide file tree
Showing 10 changed files with 340 additions and 358 deletions.
Binary file modified src/assets/howso.caml
Binary file not shown.
Binary file modified src/assets/migrations.caml
Binary file not shown.
8 changes: 4 additions & 4 deletions src/engine/Trainee.ts
Original file line number Diff line number Diff line change
Expand Up @@ -685,9 +685,9 @@ export class Trainee implements BaseTrainee {
* @param request The operation parameters.
* @returns The response of the operation, including any warnings.
*/
public async react(request: schemas.ReactRequest): Promise<ClientResponse<schemas.Reaction>> {
public async react(request: schemas.ReactRequest): Promise<ClientResponse<schemas.ReactResponse>> {
await this.client.autoResolveTrainee(this.id);
const response = await this.client.execute<schemas.Reaction>(this.id, "react", request);
const response = await this.client.execute<schemas.ReactResponse>(this.id, "react", request);
this.client.autoPersistTrainee(this.id);
return { payload: response.payload, warnings: response.warnings };
}
Expand Down Expand Up @@ -749,9 +749,9 @@ export class Trainee implements BaseTrainee {
* @param request The operation parameters.
* @returns The response of the operation, including any warnings.
*/
public async reactSeries(request: schemas.ReactSeriesRequest): Promise<ClientResponse<schemas.SeriesReaction>> {
public async reactSeries(request: schemas.ReactSeriesRequest): Promise<ClientResponse<schemas.ReactSeriesResponse>> {
await this.client.autoResolveTrainee(this.id);
const response = await this.client.execute<schemas.SeriesReaction>(this.id, "react_series", request);
const response = await this.client.execute<schemas.ReactSeriesResponse>(this.id, "react_series", request);
this.client.autoPersistTrainee(this.id);
return { payload: response.payload, warnings: response.warnings };
}
Expand Down
165 changes: 165 additions & 0 deletions src/types/schemas/React.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,21 @@
* Run reacts in a batch, output a an assoc of list of outputs from each individual react.
*/
import type { CaseIndices } from "./CaseIndices";
import type { CaseMDA } from "./CaseMDA";
import type { Cases } from "./Cases";
import type { CategoricalActionProbabilities } from "./CategoricalActionProbabilities";
import type { DesiredConviction } from "./DesiredConviction";
import type { DistanceRatioParts } from "./DistanceRatioParts";
import type { FeatureBounds } from "./FeatureBounds";
import type { FeatureMetricIndex } from "./FeatureMetricIndex";
import type { FullCaseContribution } from "./FullCaseContribution";
import type { GenerateNewCases } from "./GenerateNewCases";
import type { NewCaseThreshold } from "./NewCaseThreshold";
import type { OutlyingFeatureValuesIndex } from "./OutlyingFeatureValuesIndex";
import type { ReactDetails } from "./ReactDetails";
import type { ReactionPredictionStats } from "./ReactionPredictionStats";
import type { RobustCaseContribution } from "./RobustCaseContribution";
import type { SimilarCaseIndex } from "./SimilarCaseIndex";
import type { UseCaseWeights } from "./UseCaseWeights";

export type ReactRequest = {
Expand Down Expand Up @@ -385,3 +395,158 @@ export type ReactRequest = {
*/
weight_feature?: string;
};

export type ReactResponse = {
/**
* The list of action features in the order the action values are returned.
*/
action_features: string[];
/**
* A list of lists of predicted values for each case.
*/
action_values: any[][];
/**
* A list of lists of boundary cases for each given case.
*/
boundary_cases?: Cases[];
/**
* A list of lists of maps containing the case index and full contribution to the action feature for each influential case of each given case.
*/
case_contributions_full?: FullCaseContribution[][];
/**
* A list of lists of maps containing the case index and robust contribution to the action feature for each influential case of each given case.
*/
case_contributions_robust?: RobustCaseContribution[][];
/**
* A list of lists of maps containing the case index and full directional contribution to the action feature each given case.
*/
case_directional_feature_contributions_full?: FeatureMetricIndex[];
/**
* A list of lists of maps containing the case index and robust directional contribution to the action feature each given case.
*/
case_directional_feature_contributions_robust?: FeatureMetricIndex[];
/**
* A list of lists of maps containing the case index and full contribution to the action feature each given case.
*/
case_feature_contributions_full?: FeatureMetricIndex[];
/**
* A list of lists of maps containing the case index and robust contribution to the action feature each given case.
*/
case_feature_contributions_robust?: FeatureMetricIndex[];
/**
* A list of maps from feature name to the full prediction residual for each given case.
*/
case_feature_residuals_full?: FeatureMetricIndex[];
/**
* A list of maps from feature name to the robust prediction residual for each given case.
*/
case_feature_residuals_robust?: FeatureMetricIndex[];
/**
* A list of maps from feature name to feature full residual conviction for each given case.
*/
case_feature_residual_convictions_full?: FeatureMetricIndex[];
/**
* A list of maps from feature name to feature robust residual conviction for each given case.
*/
case_feature_residual_convictions_robust?: FeatureMetricIndex[];
/**
* A list of lists of maps containing the case index and full MDA for each influential case of each given case.
*/
case_mda_full?: CaseMDA[][];
/**
* A list of lists of maps containing the case index and robust MDA for each influential case of each given case.
*/
case_mda_robust?: CaseMDA[][];
/**
* A list of maps of feature names to their estimated probabilities of each class for the given cases.
*/
categorical_action_probabilities?: Record<string, CategoricalActionProbabilities>[];
/**
* A list of maps defining the local feature robust directional contributions of the action feature for each feature in the query.
*/
directional_feature_contributions_full?: FeatureMetricIndex[];
/**
* A list of maps defining the local feature robust directional contributions of the action feature for each feature in the query.
*/
directional_feature_contributions_robust?: FeatureMetricIndex[];
/**
* The computed distance contribution for each given case.
*/
distance_contribution?: number[];
/**
* The computed distance ratio for each given case.
*/
distance_ratio?: number[];
/**
* A list of the parts that are used to compute the distance ratio for each case.
*/
distance_ratio_parts?: DistanceRatioParts[];
/**
* A list of maps defining the local feature full contributions of the action feature for each feature in the query.
*/
feature_contributions_full?: FeatureMetricIndex[];
/**
* A list of maps defining the local feature robust contributions of the action feature for each feature in the query.
*/
feature_contributions_robust?: FeatureMetricIndex[];
/**
* A list of maps defining the local feature full MDA of the action feature for each feature in the query given the prediction was already made as the given action value.
*/
feature_mda_ex_post_full?: FeatureMetricIndex[];
/**
* A list of maps defining the local feature robust MDA of the action feature for each feature in the query given the prediction was already made as the given action value.
*/
feature_mda_ex_post_robust?: FeatureMetricIndex[];
/**
* A list of maps defining the local feature full MDA of the action feature for each feature in the query.
*/
feature_mda_full?: FeatureMetricIndex[];
/**
* A list of maps defining the local feature robust MDA of the action feature for each feature in the query.
*/
feature_mda_robust?: FeatureMetricIndex[];
/**
* A list of maps defining the local feature full residuals for each feature in the query.
*/
feature_residuals_full?: FeatureMetricIndex[];
/**
* A list of maps defining the local feature robust residuals for each feature in the query.
*/
feature_residuals_robust?: FeatureMetricIndex[];
/**
* A list of the amount of generation attempts taken for each synthesized case. Only returned if `generate_new_cases` is 'attempt' or 'always'.
*/
generate_attempts?: number[];
/**
* A list of maps from feature name to feature values indicating how feature values would be predicted if the given hypothetical values were true.
*/
hypothetical_values?: Record<string, any>[];
/**
* A list of lists of influential cases for each given case.
*/
influential_cases?: Cases[];
/**
* A list of lists of the most similar cases to each given case.
*/
most_similar_cases?: Cases[];
/**
* A list of lists of maps describing the most similar case indices and their distance from each given case.
*/
most_similar_case_indices?: SimilarCaseIndex[][];
/**
* A list of maps defining the observational errors for each feature defined in the feature attributes.
*/
observational_errors?: FeatureMetricIndex[];
/**
* A list of maps from feature name to map describing the outlying values and the extreme observed among similar cases.
*/
outlying_feature_values?: OutlyingFeatureValuesIndex[];
/**
* A list of maps containing the resulting prediction stats for the region of cases nearest to each given case.
*/
prediction_stats?: ReactionPredictionStats[];
/**
* The computed similarity conviction for each given case.
*/
similarity_conviction?: number[];
};
4 changes: 2 additions & 2 deletions src/types/schemas/ReactGroup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,11 @@ export type ReactGroupResponse = {
*/
kl_divergence_removal?: number[];
/**
* The P-value of adding each group of cases to the model.
* The p-value of adding each group of cases to the model.
*/
p_value_of_addition?: number[];
/**
* The P-value of removing each group of cases to the model.
* The p-value of removing each group of cases to the model.
*/
p_value_of_removal?: number[];
};
165 changes: 165 additions & 0 deletions src/types/schemas/ReactSeries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
* corresponding "series" where "series" is the completed 'matrix' for the corresponding action_features and derived_action_features.
*/
import type { CaseIndices } from "./CaseIndices";
import type { Cases } from "./Cases";
import type { CategoricalActionProbabilities } from "./CategoricalActionProbabilities";
import type { DesiredConviction } from "./DesiredConviction";
import type { FeatureBounds } from "./FeatureBounds";
import type { GenerateNewCases } from "./GenerateNewCases";
Expand Down Expand Up @@ -256,3 +258,166 @@ export type ReactSeriesRequest = {
*/
weight_feature?: string;
};

export type ReactSeriesResponse = {
/**
* The list of feature names that correspond to the values in each list of values in 'action_values'.
*/
action_features: string[];
/**
* A list of individual series.
*/
action_values: any[][][];
/**
* A list of aggregated categorical action probabilities for each nominal features across all the cases of each series.
*/
aggregated_categorical_action_probabilities?: Record<string, CategoricalActionProbabilities>[];
/**
* Experimental. The same detail as in standard #react, but accumulated for each case in each series.
*/
boundary_cases?: any;
/**
* Experimental. The same detail as in standard #react, but accumulated for each case in each series.
*/
case_contributions_full?: any;
/**
* Experimental. The same detail as in standard #react, but accumulated for each case in each series.
*/
case_contributions_robust?: any;
/**
* Experimental. The same detail as in standard #react, but accumulated for each case in each series.
*/
case_directional_feature_contributions_full?: any;
/**
* Experimental. The same detail as in standard #react, but accumulated for each case in each series.
*/
case_directional_feature_contributions_robust?: any;
/**
* Experimental. The same detail as in standard #react, but accumulated for each case in each series.
*/
case_feature_contributions_full?: any;
/**
* Experimental. The same detail as in standard #react, but accumulated for each case in each series.
*/
case_feature_contributions_robust?: any;
/**
* Experimental. The same detail as in standard #react, but accumulated for each case in each series.
*/
case_feature_residuals_full?: any;
/**
* Experimental. The same detail as in standard #react, but accumulated for each case in each series.
*/
case_feature_residuals_robust?: any;
/**
* Experimental. The same detail as in standard #react, but accumulated for each case in each series.
*/
case_feature_residual_convictions_full?: any;
/**
* Experimental. The same detail as in standard #react, but accumulated for each case in each series.
*/
case_feature_residual_convictions_robust?: any;
/**
* Experimental. The same detail as in standard #react, but accumulated for each case in each series.
*/
case_mda_full?: any;
/**
* Experimental. The same detail as in standard #react, but accumulated for each case in each series.
*/
case_mda_robust?: any;
/**
* A list of the detail result lists for each case of each series.
*/
categorical_action_probabilities?: Record<string, CategoricalActionProbabilities>[][];
/**
* Experimental. The same detail as in standard #react, but accumulated for each case in each series.
*/
directional_feature_contributions_full?: any;
/**
* Experimental. The same detail as in standard #react, but accumulated for each case in each series.
*/
directional_feature_contributions_robust?: any;
/**
* Experimental. The same detail as in standard #react, but accumulated for each case in each series.
*/
distance_contribution?: any;
/**
* Experimental. The same detail as in standard #react, but accumulated for each case in each series.
*/
distance_ratio?: any;
/**
* Experimental. The same detail as in standard #react, but accumulated for each case in each series.
*/
distance_ratio_parts?: any;
/**
* Experimental. The same detail as in standard #react, but accumulated for each case in each series.
*/
feature_contributions_full?: any;
/**
* Experimental. The same detail as in standard #react, but accumulated for each case in each series.
*/
feature_contributions_robust?: any;
/**
* Experimental. The same detail as in standard #react, but accumulated for each case in each series.
*/
feature_mda_ex_post_full?: any;
/**
* Experimental. The same detail as in standard #react, but accumulated for each case in each series.
*/
feature_mda_ex_post_robust?: any;
/**
* Experimental. The same detail as in standard #react, but accumulated for each case in each series.
*/
feature_mda_full?: any;
/**
* Experimental. The same detail as in standard #react, but accumulated for each case in each series.
*/
feature_mda_robust?: any;
/**
* Experimental. The same detail as in standard #react, but accumulated for each case in each series.
*/
feature_residuals_full?: any;
/**
* Experimental. The same detail as in standard #react, but accumulated for each case in each series.
*/
feature_residuals_robust?: any;
/**
* A list of the detail result lists for each case of each series.
*/
generate_attempts?: number[][];
/**
* Experimental. The same detail as in standard #react, but accumulated for each case in each series.
*/
hypothetical_values?: any;
/**
* A list of the detail result lists for each case of each series.
*/
influential_cases?: Cases[][];
/**
* Experimental. The same detail as in standard #react, but accumulated for each case in each series.
*/
most_similar_cases?: any;
/**
* Experimental. The same detail as in standard #react, but accumulated for each case in each series.
*/
most_similar_case_indices?: any;
/**
* Experimental. The same detail as in standard #react, but accumulated for each case in each series.
*/
observational_errors?: any;
/**
* Experimental. The same detail as in standard #react, but accumulated for each case in each series.
*/
outlying_feature_values?: any;
/**
* Experimental. The same detail as in standard #react, but accumulated for each case in each series.
*/
prediction_stats?: any;
/**
* A list of generation attempts for each series as a whole.
*/
series_generate_attempts?: number[];
/**
* Experimental. The same detail as in standard #react, but accumulated for each case in each series.
*/
similarity_conviction?: any;
};
Loading

0 comments on commit 5ddbc40

Please sign in to comment.