(X: np.ndarray, y: np.ndarray)
| 19 | |
| 20 | |
| 21 | def create_spark_df(X: np.ndarray, y: np.ndarray) -> DataFrame: |
| 22 | return spark.createDataFrame( |
| 23 | spark.sparkContext.parallelize( |
| 24 | [(Vectors.dense(features), float(label)) for features, label in zip(X, y)] |
| 25 | ), |
| 26 | ["features", "label"], |
| 27 | ) |
| 28 | |
| 29 | |
| 30 | # load diabetes dataset (regression dataset) |
no outgoing calls
no test coverage detected