# Get paths to toy data file
df_file <- system.file(
"extdata", "sample_data_frame.csv", package = "maxent.ot"
)
# Fit weights to dataframe with no biases
tableaux_df <- read.csv(df_file)
fit_model <- optimize_weights(tableaux_df)
predict_probabilities(tableaux_df, fit_model$weights)
# Do so with a temperature parameter
predict_probabilities(tableaux_df, fit_model$weights, temperature = 2)
# Save predictions to a file
tmp_output <- tempfile()
predict_probabilities(tableaux_df, fit_model$weights, output_path=tmp_output)
Run the code above in your browser using DataLab