1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84
|
// This file is autogenerated, DO NOT EDIT
// ml/df-analytics/apis/put-dfanalytics.asciidoc:822
[source, python]
----
resp = client.ml.put_data_frame_analytics(
id="flight_prices",
source={
"index": [
"kibana_sample_data_flights"
]
},
dest={
"index": "kibana_sample_flight_prices"
},
analysis={
"regression": {
"dependent_variable": "AvgTicketPrice",
"num_top_feature_importance_values": 2,
"feature_processors": [
{
"frequency_encoding": {
"field": "DestWeather",
"feature_name": "DestWeather_frequency",
"frequency_map": {
"Rain": 0.14604811155570188,
"Heavy Fog": 0.14604811155570188,
"Thunder & Lightning": 0.14604811155570188,
"Cloudy": 0.14604811155570188,
"Damaging Wind": 0.14604811155570188,
"Hail": 0.14604811155570188,
"Sunny": 0.14604811155570188,
"Clear": 0.14604811155570188
}
}
},
{
"target_mean_encoding": {
"field": "DestWeather",
"feature_name": "DestWeather_targetmean",
"target_map": {
"Rain": 626.5588814585794,
"Heavy Fog": 626.5588814585794,
"Thunder & Lightning": 626.5588814585794,
"Hail": 626.5588814585794,
"Damaging Wind": 626.5588814585794,
"Cloudy": 626.5588814585794,
"Clear": 626.5588814585794,
"Sunny": 626.5588814585794
},
"default_value": 624.0249512020454
}
},
{
"one_hot_encoding": {
"field": "DestWeather",
"hot_map": {
"Rain": "DestWeather_Rain",
"Heavy Fog": "DestWeather_Heavy Fog",
"Thunder & Lightning": "DestWeather_Thunder & Lightning",
"Cloudy": "DestWeather_Cloudy",
"Damaging Wind": "DestWeather_Damaging Wind",
"Hail": "DestWeather_Hail",
"Clear": "DestWeather_Clear",
"Sunny": "DestWeather_Sunny"
}
}
}
]
}
},
analyzed_fields={
"includes": [
"AvgTicketPrice",
"Cancelled",
"DestWeather",
"FlightDelayMin",
"DistanceMiles"
]
},
model_memory_limit="30mb",
)
print(resp)
----
|