({xs, ys})
| 39 | // Converts a row from the CSV into features and labels. |
| 40 | // Each feature field is normalized within training data constants: |
| 41 | const csvTransform = ({xs, ys}) => { |
| 42 | const values = [ |
| 43 | normalize(xs.px, PX_MIN, PX_MAX), normalize(xs.pz, PZ_MIN, PZ_MAX), |
| 44 | normalize(xs.sz_top, SZ_TOP_MIN, SZ_TOP_MAX), |
| 45 | normalize(xs.sz_bot, SZ_BOT_MIN, SZ_BOT_MAX), xs.left_handed_batter |
| 46 | ]; |
| 47 | return {xs: values, ys: ys.is_strike}; |
| 48 | }; |
| 49 | |
| 50 | const trainingData = |
| 51 | tf.data.csv(TRAIN_DATA_PATH, {columnConfigs: {is_strike: {isLabel: true}}}) |
nothing calls this directly
no test coverage detected