X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2) automl = AutoML( #results_path="AutoML_30", algorithms=["Random Forest"], total_time_limit=20, explain_level=0, # validation={"validation_type": "split"}, mode="Explain", # validation={"validation_type": "split"} validation={ "validation_type": "kfold", "k_folds": 2, "shuffle": True, "stratify": True, }, golden_features=True, feature_selection=True) automl.set_advanced(start_random_models=20, hill_climbing_steps=10, top_models_to_improve=3) automl.fit(X_train, y_train) predictions = automl.predict(X_test) print(predictions.head()) print(predictions.tail()) print(X_test.shape, predictions.shape) print("LogLoss", log_loss(y_test, predictions["prediction_>50K"]))
import pandas as pd import numpy as np from supervised.automl import AutoML # df = pd.read_csv("tests/data/iris_classes_missing_values_missing_target.csv") df = pd.read_csv("tests/data/iris_missing_values_missing_target.csv") X = df[["feature_1", "feature_2", "feature_3", "feature_4"]] y = df["class"] automl = AutoML( # results_path="AutoML_100", algorithms=[ "Linear", # "Xgboost", # "Random Forest" ], model_time_limit=1, tuning_mode="Normal", ) automl.set_advanced(start_random_models=1) automl.fit(X, y) predictions = automl.predict(X) print(predictions.head()) print(predictions.tail())